From b2eb392a07a7871610b96b38ae4f6b7f571b3297 Mon Sep 17 00:00:00 2001 From: Noel Eck Date: Wed, 24 May 2017 16:22:10 -0700 Subject: [PATCH] src/CMakeLists.txt: Fix for BINARY_DIR property Both the .pc and .pom file creation flows rely on the per-target property BINARY_DIR. This target property was added in CMake 3.4 so .pc and .pom file generation was broken for CMake versions < 3.4. This commit creates a new per-target property (TARGET_BINARY_DIR) which is set to ${CMAKE_CURRENT_BINARY_DIR} so that it's usable on CMake versions before 3.4. Signed-off-by: Noel Eck --- src/CMakeLists.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f859b57c..e70f85ff 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -83,7 +83,7 @@ function (_gen_pkg_config_per_target LABEL) get_target_property(libname ${target} PKG_CONFIG_NAME) get_target_property(libdescription ${target} PKG_CONFIG_DESCRIPTION) get_target_property(reqlibname ${target} PKG_EXT_REQ_LIBS) - get_target_property(BINARY_DIR ${target} BINARY_DIR) + get_target_property(BINARY_DIR ${target} TARGET_BINARY_DIR) # Get a list of in-project dependency targets for this target _get_dependency_targets(${target} DEPLIBS) @@ -127,7 +127,7 @@ function (_gen_pom_per_target) get_target_property(libname ${target} PKG_CONFIG_NAME) get_target_property(libdescription ${target} PKG_CONFIG_DESCRIPTION) get_target_property(reqlibname ${target} PKG_EXT_REQ_LIBS) - get_target_property(BINARY_DIR ${target} BINARY_DIR) + get_target_property(BINARY_DIR ${target} TARGET_BINARY_DIR) # Get a list of in-project dependency targets for this target _get_dependency_targets(${target} DEPLIBS) @@ -730,10 +730,11 @@ function(upm_module_init) endif (BUILDSWIGJAVA) endif (NOT IS_C_LIBRARY) - # Add additional properties to this target (used later for .pc file creation) + # Add additional properties to this target (used later for .pc/pom file creation) set_target_properties(${libname} PROPERTIES PKG_CONFIG_NAME "${libprefix}${basename}") set_target_properties(${libname} PROPERTIES PKG_CONFIG_DESCRIPTION "${libdescription}") set_target_properties(${libname} PROPERTIES PKG_EXT_REQ_LIBS "${reqlibname}") + set_target_properties(${libname} PROPERTIES TARGET_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}") # Skip doxygen run on C (for now) if (BUILDDOC AND NOT IS_C_LIBRARY)