mirror of
https://github.com/HowardHinnant/date.git
synced 2025-01-14 01:37:57 +08:00
Create CMakeList.txt
This is an implementation of cmake config relating to #18
This commit is contained in:
parent
15a63ec819
commit
9c39772731
50
CMakeList.txt
Normal file
50
CMakeList.txt
Normal file
@ -0,0 +1,50 @@
|
||||
cmake_minimum_required( VERSION 2.8.12 )
|
||||
|
||||
project( date_prj )
|
||||
|
||||
#add_definitions( -DUSE_AUTOLOAD=1 )
|
||||
#add_definitions( -DHAS_REMOTE_API=1 )
|
||||
#add_definitions( -DUSE_OS_TZDB=0 )
|
||||
#add_definitions( -DINSTALL=. )
|
||||
|
||||
option( USE_SYSTEM_TZ_DB "Use the operating system's timezone database" OFF )
|
||||
|
||||
find_package( Threads REQUIRED )
|
||||
|
||||
if( USE_SYSTEM_TZ_DB )
|
||||
add_definitions( -DUSE_AUTOLOAD=0 )
|
||||
add_definitions( -DHAS_REMOTE_API=0 )
|
||||
add_definitions( -DUSE_OS_TZDB=1 )
|
||||
else( )
|
||||
find_package( CURL REQUIRED )
|
||||
find_package( OpenSSL REQUIRED )
|
||||
include_directories( SYSTEM ${OPENSSL_INCLUDE_DIR} )
|
||||
include_directories( SYSTEM ${CURL_INCLUDE_DIRS} )
|
||||
set( OPTIONAL_LIBRARIES ${CURL_LIBRARIES} ${OPENSSL_LIBRARIES} )
|
||||
endif( )
|
||||
|
||||
set( HEADER_FOLDER "include" )
|
||||
set( SOURCE_FOLDER "src" )
|
||||
set( TEST_FOLDER "test" )
|
||||
|
||||
include_directories( ${HEADER_FOLDER} )
|
||||
|
||||
# This is needed so IDE's live MSVC show header files
|
||||
set( HEADER_FILES
|
||||
${HEADER_FOLDER}/date/chrono_io.h
|
||||
${HEADER_FOLDER}/date/date.h
|
||||
${HEADER_FOLDER}/date/ios.h
|
||||
${HEADER_FOLDER}/date/islamic.h
|
||||
${HEADER_FOLDER}/date/iso_week.h
|
||||
${HEADER_FOLDER}/date/julian.h
|
||||
${HEADER_FOLDER}/date/tz.h
|
||||
${HEADER_FOLDER}/date/tz_private.h
|
||||
)
|
||||
|
||||
add_library( tz SHARED ${HEADER_FILES} ${SOURCE_FOLDER}/tz.cpp )
|
||||
set_property(TARGET tz PROPERTY CXX_STANDARD 14)
|
||||
target_link_libraries( tz ${CMAKE_THREAD_LIBS_INIT} ${OPTIONAL_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} )
|
||||
|
||||
|
||||
install( TARGETS tz DESTINATION lib )
|
||||
install( DIRECTORY ${HEADER_FOLDER}/ DESTINATION include/ )
|
Loading…
x
Reference in New Issue
Block a user