diff options
author | Brad King <brad.king@kitware.com> | 2019-01-30 15:36:24 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-01-30 15:36:24 (GMT) |
commit | e3b26f0004e20c11818e8c6cdd6c778c379d8c67 (patch) | |
tree | 404d0d0275af1a39bf6c6ef504913c578dfd480e /Source/kwsys | |
parent | 748d024551d8f447046363ad617fc72bdd977fd2 (diff) | |
parent | c22e373a3077a90a4f1ed509774412a0ab82d992 (diff) | |
download | CMake-e3b26f0004e20c11818e8c6cdd6c778c379d8c67.zip CMake-e3b26f0004e20c11818e8c6cdd6c778c379d8c67.tar.gz CMake-e3b26f0004e20c11818e8c6cdd6c778c379d8c67.tar.bz2 |
Merge branch 'upstream-KWSys' into update-kwsys
* upstream-KWSys:
KWSys 2019-01-30 (ce89cada)
Diffstat (limited to 'Source/kwsys')
-rw-r--r-- | Source/kwsys/CMakeLists.txt | 25 | ||||
-rw-r--r-- | Source/kwsys/kwsysPlatformTests.cmake | 5 |
2 files changed, 20 insertions, 10 deletions
diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt index b33aa80..e7da994 100644 --- a/Source/kwsys/CMakeLists.txt +++ b/Source/kwsys/CMakeLists.txt @@ -42,6 +42,10 @@ # SET(KWSYS_HEADER_ROOT ${PROJECT_BINARY_DIR}) # INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR}) # +# KWSYS_CXX_STANDARD = A value for CMAKE_CXX_STANDARD within KWSys. +# Set to empty string to use no default value. +# KWSYS_CXX_COMPILE_FEATURES = target_compile_features arguments for KWSys. +# # Optional settings to setup install rules are as follows: # # KWSYS_INSTALL_BIN_DIR = The installation target directories into @@ -82,25 +86,17 @@ # any outside mailing list and no documentation of the change will be # written. -CMAKE_MINIMUM_REQUIRED(VERSION 2.6.3 FATAL_ERROR) +CMAKE_MINIMUM_REQUIRED(VERSION 3.1 FATAL_ERROR) FOREACH(p - CMP0022 # CMake 2.8, Define link interface - required by android_mk export - CMP0025 # CMake 3.0, Compiler id for Apple Clang is now AppleClang. - CMP0042 # CMake 3.0, MACOSX_RPATH is enabled by default. - CMP0048 # CMake 3.0, Let the project command manage version variables. CMP0056 # CMake 3.2, Honor link flags in try_compile() source-file signature. CMP0063 # CMake 3.3, Honor visibility properties for all target types. + CMP0067 # CMake 3.8, Honor language standard in try_compile source-file signature. CMP0069 # CMake 3.9, INTERPROCEDURAL_OPTIMIZATION is enforced when enabled. ) IF(POLICY ${p}) CMAKE_POLICY(SET ${p} NEW) ENDIF() ENDFOREACH() -SET(CMAKE_LEGACY_CYGWIN_WIN32 0) - -IF(CMAKE_VERSION VERSION_LESS 3.0) - SET(KWSYS_SPLIT_OBJECTS_FROM_INTERFACE 0) -ENDIF() #----------------------------------------------------------------------------- # If a namespace is not specified, use "kwsys" and enable testing. @@ -121,6 +117,12 @@ SET_PROPERTY(DIRECTORY "KWSYS_HEADER(%)=<${KWSYS_NAMESPACE}/%>" ) +if(KWSYS_CXX_STANDARD) + set(CMAKE_CXX_STANDARD "${KWSYS_CXX_STANDARD}") +elseif(NOT DEFINED CMAKE_CXX_STANDARD AND NOT DEFINED KWSYS_CXX_STANDARD) + set(CMAKE_CXX_STANDARD 11) +endif() + # Select library components. IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR) SET(KWSYS_ENABLE_C 1) @@ -884,6 +886,8 @@ IF(KWSYS_C_SRCS OR KWSYS_CXX_SRCS) ${KWSYS_TARGET_INTERFACE}) TARGET_SOURCES(${KWSYS_TARGET_LINK} INTERFACE $<TARGET_OBJECTS:${KWSYS_TARGET_OBJECT}>) + target_compile_features(${KWSYS_TARGET_OBJECT} PRIVATE ${KWSYS_CXX_COMPILE_FEATURES}) + target_compile_features(${KWSYS_TARGET_INTERFACE} INTERFACE ${KWSYS_CXX_COMPILE_FEATURES}) ELSE() SET(KWSYS_TARGET_INTERFACE ${KWSYS_NAMESPACE}) SET(KWSYS_TARGET_OBJECT ${KWSYS_NAMESPACE}) @@ -892,6 +896,7 @@ IF(KWSYS_C_SRCS OR KWSYS_CXX_SRCS) SET(KWSYS_LINK_DEPENDENCY PUBLIC) ADD_LIBRARY(${KWSYS_TARGET_INTERFACE} ${KWSYS_LIBRARY_TYPE} ${KWSYS_C_SRCS} ${KWSYS_CXX_SRCS}) + target_compile_features(${KWSYS_TARGET_INTERFACE} PUBLIC ${KWSYS_CXX_COMPILE_FEATURES}) ENDIF() if (KWSYS_ALIAS_TARGET) add_library(${KWSYS_ALIAS_TARGET} ALIAS ${KWSYS_TARGET_INTERFACE}) diff --git a/Source/kwsys/kwsysPlatformTests.cmake b/Source/kwsys/kwsysPlatformTests.cmake index 5386a49..28d3f68 100644 --- a/Source/kwsys/kwsysPlatformTests.cmake +++ b/Source/kwsys/kwsysPlatformTests.cmake @@ -7,11 +7,16 @@ SET(KWSYS_PLATFORM_TEST_FILE_CXX kwsysPlatformTestsCXX.cxx) 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}} COMPILE_DEFINITIONS -DTEST_${var} ${KWSYS_PLATFORM_TEST_DEFINES} ${KWSYS_PLATFORM_TEST_EXTRA_FLAGS} CMAKE_FLAGS "-DLINK_LIBRARIES:STRING=${KWSYS_PLATFORM_TEST_LINK_LIBRARIES}" + ${maybe_cxx_standard} OUTPUT_VARIABLE OUTPUT) IF(${var}_COMPILED) FILE(APPEND |