23 lines
682 B
CMake
23 lines
682 B
CMake
include(FetchContent)
|
|
|
|
FetchContent_Declare(
|
|
zlog
|
|
GIT_REPOSITORY https://github.com/HardySimpson/zlog
|
|
GIT_TAG 1.2.18
|
|
GIT_SHALLOW TRUE
|
|
)
|
|
FetchContent_MakeAvailable(zlog)
|
|
|
|
# Install zlog automatically after build
|
|
set(zlog_INSTALL_DIR ${FETCHCONTENT_BASE_DIR}/zlog-install/)
|
|
add_custom_target(
|
|
zlog_copy_header ALL
|
|
COMMAND ${CMAKE_COMMAND} -E copy ${zlog_SOURCE_DIR}/src/zlog.h ${zlog_BINARY_DIR}/include/zlog.h
|
|
DEPENDS zlog
|
|
COMMENT "Installing zlog into ${zlog_INSTALL_DIR}"
|
|
)
|
|
|
|
# Add the install directory to include and link paths
|
|
target_include_directories(zlog_s PUBLIC ${zlog_BINARY_DIR}/include)
|
|
target_include_directories(zlog PUBLIC ${zlog_BINARY_DIR}/include)
|