diff options
author | David Cole <david.cole@kitware.com> | 2012-02-21 20:58:27 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2012-02-21 20:58:27 (GMT) |
commit | 8ef15df7000bc514b941f04784bccb340f9638b4 (patch) | |
tree | bd9f342759ea7b1f08db3a9e5dcbca9b2d3c7a44 /Modules/CheckCXXSourceCompiles.cmake | |
parent | bf6560091d2d3cc2c57852d414580643036a1974 (diff) | |
parent | 35c48e12706f9426eda43b3b077925a2fab0df44 (diff) | |
download | CMake-8ef15df7000bc514b941f04784bccb340f9638b4.zip CMake-8ef15df7000bc514b941f04784bccb340f9638b4.tar.gz CMake-8ef15df7000bc514b941f04784bccb340f9638b4.tar.bz2 |
Merge topic 'HandleTargetsInCMakeRequiredLibraries'
35c48e1 Check*.cmake: Expand imported targets in CMAKE_REQUIRED_LIBRARIES
61cb4ea bootstrap: move while() and endwhile() into the bootstrap build
c9f2886 -don't pull in CheckTypeSize.cmake from the cmake which is being built
628f365 -remove trailing whitespace
Diffstat (limited to 'Modules/CheckCXXSourceCompiles.cmake')
-rw-r--r-- | Modules/CheckCXXSourceCompiles.cmake | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Modules/CheckCXXSourceCompiles.cmake b/Modules/CheckCXXSourceCompiles.cmake index 0491b37..7f7336e 100644 --- a/Modules/CheckCXXSourceCompiles.cmake +++ b/Modules/CheckCXXSourceCompiles.cmake @@ -24,6 +24,9 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) +INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake") + + MACRO(CHECK_CXX_SOURCE_COMPILES SOURCE VAR) IF("${VAR}" MATCHES "^${VAR}$") SET(_FAIL_REGEX) @@ -41,8 +44,10 @@ MACRO(CHECK_CXX_SOURCE_COMPILES SOURCE VAR) SET(MACRO_CHECK_FUNCTION_DEFINITIONS "-D${VAR} ${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_CXX_SOURCE_COMPILES_ADD_LIBRARIES - "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") + "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}") ELSE(CMAKE_REQUIRED_LIBRARIES) SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES) ENDIF(CMAKE_REQUIRED_LIBRARIES) |