From fe63f0bb5fc1263398bb0d5ffe6d45e50774b820 Mon Sep 17 00:00:00 2001 From: Michael Ellery Date: Wed, 15 Jan 2020 19:08:15 -0800 Subject: [PATCH] Add MANUAL_TZ_DB configure option: (#527) * Add MANUAL_TZ_DB configure option: FIXES: #458 * [fold] address review feedback --- CMakeLists.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d9e2e80..d476e42 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,6 +27,7 @@ get_directory_property( has_parent PARENT_DIRECTORY ) 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( MANUAL_TZ_DB "User will set TZ DB manually by invoking set_install in their code" OFF ) option( USE_TZ_DB_IN_DOT "Save the timezone database in the current folder" OFF ) option( BUILD_SHARED_LIBS "Build a shared version of library" OFF ) option( ENABLE_DATE_TESTING "Enable unit tests" OFF ) @@ -48,6 +49,7 @@ function( print_option OPT ) endfunction( ) print_option( USE_SYSTEM_TZ_DB ) +print_option( MANUAL_TZ_DB ) print_option( USE_TZ_DB_IN_DOT ) print_option( BUILD_SHARED_LIBS ) print_option( ENABLE_DATE_TESTING ) @@ -98,12 +100,12 @@ if( BUILD_TZ_LIB ) $ ) target_compile_definitions( tz PRIVATE - AUTO_DOWNLOAD=$,0,1> - HAS_REMOTE_API=$,0,1> + AUTO_DOWNLOAD=$,$>,0,1> + HAS_REMOTE_API=$,$>,0,1> $<$,$>:DATE_BUILD_DLL=1> $<$:INSTALL=.> PUBLIC - USE_OS_TZDB=$,$>>,1,0> + USE_OS_TZDB=$,$>,$>>,1,0> INTERFACE $<$,$>:DATE_USE_DLL=1> ) set(TZ_HEADERS include/date/tz.h) @@ -119,7 +121,7 @@ if( BUILD_TZ_LIB ) find_package( Threads ) target_link_libraries( tz PUBLIC Threads::Threads ) endif( ) - if( NOT USE_SYSTEM_TZ_DB ) + if( NOT USE_SYSTEM_TZ_DB AND NOT MANUAL_TZ_DB ) find_package( CURL REQUIRED ) target_link_libraries( tz PRIVATE CURL::libcurl ) endif( )