From ca91728ba4701ab3e62a19d1dd46057af12f3f15 Mon Sep 17 00:00:00 2001 From: Otto Sievert Date: Wed, 14 Oct 2020 10:08:06 -0700 Subject: [PATCH] reference the pkgconfig file differently in cmake - reference it in the directory next to the CMakeLists file not in the current working directory - this allows this project to be included (via add_subdirectory()) as a sub-project in other CMake projects --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6d0e52b..917fdb6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,7 +14,7 @@ add_library(GPMF_PARSER_LIB ${LIB_SOURCES}) set_target_properties(GPMF_PARSER_LIB PROPERTIES OUTPUT_NAME "${PROJECT_NAME}") set(PC_LINK_FLAGS "-l${PROJECT_NAME}") -configure_file("${CMAKE_SOURCE_DIR}/${PROJECT_NAME}.pc.in" "${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc" @ONLY) +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.pc.in" "${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc" @ONLY) install(TARGETS GPMF_PARSER_BIN DESTINATION "bin") install(TARGETS GPMF_PARSER_LIB DESTINATION "lib")