summaryrefslogtreecommitdiff
path: root/Modules/CheckPrototypeDefinition.cmake
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-02-09 10:34:37 +0100
committerBrad King <brad.king@kitware.com>2013-02-22 08:35:39 -0500
commit236133e79e2d047810eeba90915e38d9861e2a22 (patch)
tree25265f06106cbc0403c53f6705e14baac002687c /Modules/CheckPrototypeDefinition.cmake
parent1c0597c25bf69a9c73e3d4f6ab68d16b5e56a271 (diff)
downloadcmake-236133e79e2d047810eeba90915e38d9861e2a22.tar.gz
Handle targets in the LINK_LIBRARIES of try_compile.
Imported targets are re-exported so that they can be used by the try_compile generated code with target_link_libraries. This makes the use of the cmake_expand_imported_targets macro obsolete. The macro is not able to expand the generator expressions which may appear in the IMPORTED_LINK_INTERFACE_LIBRARIES content. Instead it just sees them as 'not a target'.
Diffstat (limited to 'Modules/CheckPrototypeDefinition.cmake')
-rw-r--r--Modules/CheckPrototypeDefinition.cmake7
1 files changed, 2 insertions, 5 deletions
diff --git a/Modules/CheckPrototypeDefinition.cmake b/Modules/CheckPrototypeDefinition.cmake
index 74b94b86fe..2342b3c4f7 100644
--- a/Modules/CheckPrototypeDefinition.cmake
+++ b/Modules/CheckPrototypeDefinition.cmake
@@ -34,7 +34,6 @@
# License text for the above reference.)
#
-include("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
get_filename_component(__check_proto_def_dir "${CMAKE_CURRENT_LIST_FILE}" PATH)
@@ -46,10 +45,8 @@ function(CHECK_PROTOTYPE_DEFINITION _FUNCTION _PROTOTYPE _RETURN _HEADER _VARIAB
set(CHECK_PROTOTYPE_DEFINITION_FLAGS ${CMAKE_REQUIRED_FLAGS})
if (CMAKE_REQUIRED_LIBRARIES)
- # this one translates potentially used imported library targets to their files on disk
- cmake_expand_imported_targets(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
set(CHECK_PROTOTYPE_DEFINITION_LIBS
- "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
+ LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
else()
set(CHECK_PROTOTYPE_DEFINITION_LIBS)
endif()
@@ -78,8 +75,8 @@ function(CHECK_PROTOTYPE_DEFINITION _FUNCTION _PROTOTYPE _RETURN _HEADER _VARIAB
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckPrototypeDefinition.c
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
+ ${CHECK_PROTOTYPE_DEFINITION_LIBS}
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${CHECK_PROTOTYPE_DEFINITION_FLAGS}
- "${CHECK_PROTOTYPE_DEFINITION_LIBS}"
"${CMAKE_SYMBOL_EXISTS_INCLUDES}"
OUTPUT_VARIABLE OUTPUT)