diff options
author | Matthew Woehlke <matthew.woehlke@kitware.com> | 2022-09-16 17:14:51 (GMT) |
---|---|---|
committer | Matthew Woehlke <matthew.woehlke@kitware.com> | 2022-09-16 17:14:51 (GMT) |
commit | d00d8537f6c52997f41535634c110116900e95c9 (patch) | |
tree | 182ce36bcfb35434f4f42302fd6077e6930835a8 | |
parent | 343685869716b2ac31876d3e4173ece46ea49efc (diff) | |
download | CMake-d00d8537f6c52997f41535634c110116900e95c9.zip CMake-d00d8537f6c52997f41535634c110116900e95c9.tar.gz CMake-d00d8537f6c52997f41535634c110116900e95c9.tar.bz2 |
Modules: Use new keyword-dispatched try_compile signature
Modify modules that ship with CMake and use the project flavor of
try_compile to use the new signature added by commit 56ae40cc59
(try_compile: Add PROJECT keyword-dispatched signature, 2022-09-14).
-rw-r--r-- | Modules/CMakeDetermineCompilerABI.cmake | 5 | ||||
-rw-r--r-- | Modules/CheckIPOSupported.cmake | 6 | ||||
-rw-r--r-- | Modules/FindSDL_sound.cmake | 6 | ||||
-rw-r--r-- | Modules/FortranCInterface.cmake | 8 | ||||
-rw-r--r-- | Modules/FortranCInterface/Detect.cmake | 8 |
5 files changed, 17 insertions, 16 deletions
diff --git a/Modules/CMakeDetermineCompilerABI.cmake b/Modules/CMakeDetermineCompilerABI.cmake index c148f8a..053effa 100644 --- a/Modules/CMakeDetermineCompilerABI.cmake +++ b/Modules/CMakeDetermineCompilerABI.cmake @@ -162,8 +162,9 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src) message(CHECK_START "Determine Intel Fortran Compiler Implicit Link Path") # Build a sample project which reports symbols. try_compile(IFORT_LIB_PATH_COMPILED - ${CMAKE_BINARY_DIR}/CMakeFiles/IntelVSImplicitPath - ${CMAKE_ROOT}/Modules/IntelVSImplicitPath + PROJECT IntelFortranImplicit + SOURCE_DIR ${CMAKE_ROOT}/Modules/IntelVSImplicitPath + BINARY_DIR ${CMAKE_BINARY_DIR}/CMakeFiles/IntelVSImplicitPath IntelFortranImplicit CMAKE_FLAGS "-DCMAKE_Fortran_FLAGS:STRING=${CMAKE_Fortran_FLAGS}" diff --git a/Modules/CheckIPOSupported.cmake b/Modules/CheckIPOSupported.cmake index 14262a1..9108e34 100644 --- a/Modules/CheckIPOSupported.cmake +++ b/Modules/CheckIPOSupported.cmake @@ -137,9 +137,9 @@ macro(_ipo_run_language_check language) try_compile( _IPO_LANGUAGE_CHECK_RESULT - "${bindir}" - "${srcdir}" - "${TRY_COMPILE_PROJECT_NAME}" + PROJECT "${TRY_COMPILE_PROJECT_NAME}" + SOURCE_DIR "${srcdir}" + BINARY_DIR "${bindir}" CMAKE_FLAGS "-DCMAKE_VERBOSE_MAKEFILE=ON" "-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON" diff --git a/Modules/FindSDL_sound.cmake b/Modules/FindSDL_sound.cmake index 6807522..d863e3c 100644 --- a/Modules/FindSDL_sound.cmake +++ b/Modules/FindSDL_sound.cmake @@ -185,9 +185,9 @@ if(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) try_compile( MY_RESULT - ${PROJECT_BINARY_DIR}/CMakeTmp - ${PROJECT_BINARY_DIR}/CMakeTmp - DetermineSoundLibs + PROJECT DetermineSoundLibs + SOURCE_DIR ${PROJECT_BINARY_DIR}/CMakeTmp + BINARY_DIR ${PROJECT_BINARY_DIR}/CMakeTmp OUTPUT_VARIABLE MY_OUTPUT ) diff --git a/Modules/FortranCInterface.cmake b/Modules/FortranCInterface.cmake index 53df01a..af025af 100644 --- a/Modules/FortranCInterface.cmake +++ b/Modules/FortranCInterface.cmake @@ -361,10 +361,10 @@ function(FortranCInterface_VERIFY) # Build a sample project which reports symbols. set(CMAKE_TRY_COMPILE_CONFIGURATION Release) try_compile(FortranCInterface_VERIFY_${lang}_COMPILED - ${FortranCInterface_BINARY_DIR}/Verify${lang} - ${FortranCInterface_SOURCE_DIR}/Verify - VerifyFortranC # project name - VerifyFortranC # target name + PROJECT VerifyFortranC + TARGET VerifyFortranC + SOURCE_DIR ${FortranCInterface_SOURCE_DIR}/Verify + BINARY_DIR ${FortranCInterface_BINARY_DIR}/Verify${lang} CMAKE_FLAGS -DVERIFY_CXX=${verify_cxx} -DCMAKE_VERBOSE_MAKEFILE=ON "-DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}" diff --git a/Modules/FortranCInterface/Detect.cmake b/Modules/FortranCInterface/Detect.cmake index 567fc37..6401aed 100644 --- a/Modules/FortranCInterface/Detect.cmake +++ b/Modules/FortranCInterface/Detect.cmake @@ -47,10 +47,10 @@ unset(_FortranCInterface_CMP0056) # Build a sample project which reports symbols. set(CMAKE_TRY_COMPILE_CONFIGURATION Release) try_compile(FortranCInterface_COMPILED - ${FortranCInterface_BINARY_DIR} - ${FortranCInterface_SOURCE_DIR} - FortranCInterface # project name - FortranCInterface # target name + PROJECT FortranCInterface + TARGET FortranCInterface + SOURCE_DIR ${FortranCInterface_SOURCE_DIR} + BINARY_DIR ${FortranCInterface_BINARY_DIR} CMAKE_FLAGS "-DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}" "-DCMAKE_Fortran_FLAGS:STRING=${CMAKE_Fortran_FLAGS}" |