From f203c68832c7f6b71c9ae6f26b004bea66671a60 Mon Sep 17 00:00:00 2001 From: Philip Pfaffe Date: Tue, 6 Nov 2018 15:18:17 +0000 Subject: [PATCH] [CMake] Fix generation of exported targets in build directory CMake generates the exports file wrongly if the CMAKE_BUILD_TYPE is unset for multi-configuration generators. The generated file lib/cmake/polly/PollyExports-all.cmake then contains: set_target_properties(LLVMPolly PROPERTIES IMPORTED_LOCATION_ my_build_dir/lib/LLVMPolly.so) set_target_properties(Polly PROPERTIES IMPORTED_LOCATION_ my_build_dir/lib/libPolly.a) This patch conditionalizes the underscore. Patch by: Marcin Copik Differential Revision: D53376 git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@346231 91177308-0d34-0410-b5e6-96231b3b80d8 --- cmake/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 969292cd..211f9551 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -60,7 +60,7 @@ foreach(tgt IN LISTS POLLY_CONFIG_EXPORTED_TARGETS) if (NOT tgt_type STREQUAL "INTERFACE_LIBRARY") set(POLLY_EXPORTS "set_target_properties(${tgt} PROPERTIES - IMPORTED_LOCATION_$> $) + IMPORTED_LOCATION$<$>:_$>> $) ${POLLY_EXPORTS}") endif() endforeach(tgt) @@ -111,7 +111,7 @@ foreach(tgt IN LISTS POLLY_CONFIG_EXPORTED_TARGETS) if (NOT tgt_type STREQUAL "INTERFACE_LIBRARY") set(POLLY_EXPORTS "set_target_properties(${tgt} PROPERTIES - IMPORTED_LOCATION$<$>:_> \${CMAKE_CURRENT_LIST_DIR}/${tgt_path}) + IMPORTED_LOCATION$<$>:_$>> \${CMAKE_CURRENT_LIST_DIR}/${tgt_path}) ${POLLY_EXPORTS}") endif() endforeach(tgt) -- 2.11.4.GIT