mirror of
https://github.com/Xahau/xahaud.git
synced 2025-11-28 06:25:49 +00:00
50 lines
1.7 KiB
CMake
50 lines
1.7 KiB
CMake
#[===================================================================[
|
|
NIH dep: date
|
|
|
|
the main library is header-only, thus is an INTERFACE lib in CMake.
|
|
|
|
NOTE: this has been accepted into c++20 so can likely be replaced
|
|
when we update to that standard
|
|
#]===================================================================]
|
|
|
|
find_package (date QUIET)
|
|
if (NOT TARGET date::date)
|
|
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.14)
|
|
FetchContent_Declare(
|
|
hh_date_src
|
|
GIT_REPOSITORY https://github.com/HowardHinnant/date.git
|
|
GIT_TAG 48f1455cd255df2fe73b5f293b47203ad0988199
|
|
)
|
|
FetchContent_MakeAvailable(hh_date_src)
|
|
else ()
|
|
ExternalProject_Add (hh_date_src
|
|
PREFIX ${nih_cache_path}
|
|
GIT_REPOSITORY https://github.com/HowardHinnant/date.git
|
|
GIT_TAG 48f1455cd255df2fe73b5f293b47203ad0988199
|
|
CONFIGURE_COMMAND ""
|
|
BUILD_COMMAND ""
|
|
TEST_COMMAND ""
|
|
INSTALL_COMMAND ""
|
|
)
|
|
ExternalProject_Get_Property (hh_date_src SOURCE_DIR)
|
|
set (hh_date_src_SOURCE_DIR "${SOURCE_DIR}")
|
|
file (MAKE_DIRECTORY ${hh_date_src_SOURCE_DIR}/include)
|
|
add_library (date_interface INTERFACE)
|
|
add_library (date::date ALIAS date_interface)
|
|
add_dependencies (date_interface hh_date_src)
|
|
file (TO_CMAKE_PATH "${hh_date_src_SOURCE_DIR}" hh_date_src_SOURCE_DIR)
|
|
target_include_directories (date_interface
|
|
SYSTEM INTERFACE
|
|
$<BUILD_INTERFACE:${hh_date_src_SOURCE_DIR}/include>
|
|
$<INSTALL_INTERFACE:include>)
|
|
install (
|
|
FILES
|
|
${hh_date_src_SOURCE_DIR}/include/date/date.h
|
|
DESTINATION include/date)
|
|
install (TARGETS date_interface
|
|
EXPORT RippleExports
|
|
INCLUDES DESTINATION include)
|
|
endif ()
|
|
endif ()
|
|
|