mirror of
https://github.com/HowardHinnant/date.git
synced 2025-08-03 12:44:27 +02:00
Remove TZ_CXX_STANDARD and instead use CMAKE_CXX_STANDARD
* See https://cmake.org/cmake/help/v3.1/variable/CMAKE_CXX_STANDARD.html?highlight=cmake_cxx_standard
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required( VERSION 3.0.2 )
|
cmake_minimum_required( VERSION 3.1.0 )
|
||||||
|
|
||||||
project( date_prj )
|
project( date_prj )
|
||||||
|
|
||||||
@@ -6,6 +6,9 @@ include( GNUInstallDirs )
|
|||||||
|
|
||||||
find_package( Threads REQUIRED )
|
find_package( Threads REQUIRED )
|
||||||
|
|
||||||
|
# Override by setting on CMake command line.
|
||||||
|
set( CMAKE_CXX_STANDARD 17 CACHE STRING "The C++ standard whose features are requested.")
|
||||||
|
|
||||||
option( USE_SYSTEM_TZ_DB "Use the operating system's timezone database" OFF )
|
option( USE_SYSTEM_TZ_DB "Use the operating system's timezone database" OFF )
|
||||||
option( USE_TZ_DB_IN_DOT "Save the timezone database in the current folder" OFF )
|
option( USE_TZ_DB_IN_DOT "Save the timezone database in the current folder" OFF )
|
||||||
option( BUILD_TZ_STATIC "Build a static version of library" ON )
|
option( BUILD_TZ_STATIC "Build a static version of library" ON )
|
||||||
@@ -66,11 +69,6 @@ if( USE_TZ_DB_IN_DOT )
|
|||||||
target_compile_definitions( tz PRIVATE -DINSTALL=. )
|
target_compile_definitions( tz PRIVATE -DINSTALL=. )
|
||||||
endif( )
|
endif( )
|
||||||
|
|
||||||
if( NOT TZ_CXX_STANDARD )
|
|
||||||
set( TZ_CXX_STANDARD 17 )
|
|
||||||
endif( )
|
|
||||||
|
|
||||||
set_property(TARGET tz PROPERTY CXX_STANDARD ${TZ_CXX_STANDARD})
|
|
||||||
target_link_libraries( tz ${CMAKE_THREAD_LIBS_INIT} ${OPTIONAL_LIBRARIES} )
|
target_link_libraries( tz ${CMAKE_THREAD_LIBS_INIT} ${OPTIONAL_LIBRARIES} )
|
||||||
|
|
||||||
# add include folders to the library and targets that consume it
|
# add include folders to the library and targets that consume it
|
||||||
@@ -124,7 +122,6 @@ if ( ENABLE_DATE_TESTING )
|
|||||||
set( BIN_NAME ${PREFIX}_bin )
|
set( BIN_NAME ${PREFIX}_bin )
|
||||||
set( TST_NAME ${PREFIX}_test )
|
set( TST_NAME ${PREFIX}_test )
|
||||||
add_executable( ${BIN_NAME} EXCLUDE_FROM_ALL ${TEST_FILE} )
|
add_executable( ${BIN_NAME} EXCLUDE_FROM_ALL ${TEST_FILE} )
|
||||||
set_property(TARGET ${BIN_NAME} PROPERTY CXX_STANDARD ${TZ_CXX_STANDARD})
|
|
||||||
add_test( ${TST_NAME} ${BIN_NAME} )
|
add_test( ${TST_NAME} ${BIN_NAME} )
|
||||||
target_link_libraries( ${BIN_NAME} tz )
|
target_link_libraries( ${BIN_NAME} tz )
|
||||||
add_dependencies( testit ${BIN_NAME} )
|
add_dependencies( testit ${BIN_NAME} )
|
||||||
|
Reference in New Issue
Block a user