cpptrace/test/fetchcontent-integration/CMakeLists.txt
2023-09-18 20:33:46 -04:00

27 lines
627 B
CMake

cmake_minimum_required(VERSION 3.8)
project(demo_project VERSION 0.0.1 LANGUAGES CXX)
add_executable(main main.cpp)
set(CPPTRACE_TAG "" CACHE STRING "cpptrace git tag")
include(FetchContent)
FetchContent_Declare(
cpptrace
GIT_REPOSITORY https://github.com/jeremy-rifkin/cpptrace.git
GIT_TAG ${CPPTRACE_TAG}
)
FetchContent_MakeAvailable(cpptrace)
target_link_libraries(main cpptrace)
target_compile_features(main PRIVATE cxx_std_11)
if(WIN32)
add_custom_command(
TARGET main POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
$<TARGET_FILE:cpptrace>
$<TARGET_FILE_DIR:main>
)
endif()