summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-03-02 16:11:12 (GMT)
committerBrad King <brad.king@kitware.com>2023-03-02 16:11:12 (GMT)
commit1caf5cbd6a681396998606bf2d1ccb4512bb8769 (patch)
tree34ac42647dcd2484d3cb83dd0c7b3a45c8343f2c /Source
parent9f309e655fe87b8d2193c8e719a8748ad3e3c382 (diff)
parent5433eea1a9b16435c129042f4481152e834eb519 (diff)
downloadCMake-1caf5cbd6a681396998606bf2d1ccb4512bb8769.zip
CMake-1caf5cbd6a681396998606bf2d1ccb4512bb8769.tar.gz
CMake-1caf5cbd6a681396998606bf2d1ccb4512bb8769.tar.bz2
Merge branch 'upstream-KWSys' into update-kwsys
# By KWSys Upstream * upstream-KWSys: KWSys 2023-03-02 (ea806689)
Diffstat (limited to 'Source')
-rw-r--r--Source/kwsys/kwsysPlatformTests.cmake63
1 files changed, 34 insertions, 29 deletions
diff --git a/Source/kwsys/kwsysPlatformTests.cmake b/Source/kwsys/kwsysPlatformTests.cmake
index 89be4b8..6c006bc 100644
--- a/Source/kwsys/kwsysPlatformTests.cmake
+++ b/Source/kwsys/kwsysPlatformTests.cmake
@@ -8,9 +8,6 @@ macro(KWSYS_PLATFORM_TEST lang var description invert)
if(NOT DEFINED ${var}_COMPILED)
message(STATUS "${description}")
set(maybe_cxx_standard "")
- if(CMAKE_VERSION VERSION_LESS 3.8 AND CMAKE_CXX_STANDARD)
- set(maybe_cxx_standard "-DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}")
- endif()
try_compile(${var}_COMPILED
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/${KWSYS_PLATFORM_TEST_FILE_${lang}}
@@ -18,14 +15,16 @@ macro(KWSYS_PLATFORM_TEST lang var description invert)
CMAKE_FLAGS "-DLINK_LIBRARIES:STRING=${KWSYS_PLATFORM_TEST_LINK_LIBRARIES}"
${maybe_cxx_standard}
OUTPUT_VARIABLE OUTPUT)
- if(${var}_COMPILED)
- file(APPEND
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
- "${description} compiled with the following output:\n${OUTPUT}\n\n")
- else()
- file(APPEND
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
- "${description} failed to compile with the following output:\n${OUTPUT}\n\n")
+ if(CMAKE_VERSION VERSION_LESS 3.26)
+ if(${var}_COMPILED)
+ file(APPEND
+ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ "${description} compiled with the following output:\n${OUTPUT}\n\n")
+ else()
+ file(APPEND
+ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ "${description} failed to compile with the following output:\n${OUTPUT}\n\n")
+ endif()
endif()
if(${invert} MATCHES INVERT)
if(${var}_COMPILED)
@@ -67,19 +66,23 @@ macro(KWSYS_PLATFORM_TEST_RUN lang var description invert)
# Note that ${var} will be a 0 return value on success.
if(${var}_COMPILED)
- if(${var})
+ if(CMAKE_VERSION VERSION_LESS 3.26)
+ if(${var})
+ file(APPEND
+ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ "${description} compiled but failed to run with the following output:\n${OUTPUT}\n\n")
+ else()
+ file(APPEND
+ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ "${description} compiled and ran with the following output:\n${OUTPUT}\n\n")
+ endif()
+ endif()
+ else()
+ if(CMAKE_VERSION VERSION_LESS 3.26)
file(APPEND
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
- "${description} compiled but failed to run with the following output:\n${OUTPUT}\n\n")
- else()
- file(APPEND
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
- "${description} compiled and ran with the following output:\n${OUTPUT}\n\n")
+ "${description} failed to compile with the following output:\n${OUTPUT}\n\n")
endif()
- else()
- file(APPEND
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
- "${description} failed to compile with the following output:\n${OUTPUT}\n\n")
set(${var} -1 CACHE INTERNAL "${description} failed to compile.")
endif()
@@ -188,14 +191,16 @@ macro(KWSYS_PLATFORM_INFO_TEST lang var description)
OUTPUT_VARIABLE OUTPUT
COPY_FILE ${KWSYS_PLATFORM_INFO_FILE}
)
- if(${var}_COMPILED)
- file(APPEND
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
- "${description} compiled with the following output:\n${OUTPUT}\n\n")
- else()
- file(APPEND
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
- "${description} failed to compile with the following output:\n${OUTPUT}\n\n")
+ if(CMAKE_VERSION VERSION_LESS 3.26)
+ if(${var}_COMPILED)
+ file(APPEND
+ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ "${description} compiled with the following output:\n${OUTPUT}\n\n")
+ else()
+ file(APPEND
+ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ "${description} failed to compile with the following output:\n${OUTPUT}\n\n")
+ endif()
endif()
if(${var}_COMPILED)
message(STATUS "${description} - compiled")