| 1 |
cmake_minimum_required(VERSION 3.8) |
| 2 |
|
| 3 |
project(demo_project VERSION 0.0.1 LANGUAGES CXX) |
| 4 |
|
| 5 |
add_executable(main main.cpp) |
| 6 |
|
| 7 |
set(CPPTRACE_TAG "" CACHE STRING "cpptrace git tag") |
| 8 |
|
| 9 |
include(FetchContent) |
| 10 |
FetchContent_Declare( |
| 11 |
cpptrace |
| 12 |
GIT_REPOSITORY https://github.com/jeremy-rifkin/cpptrace.git |
| 13 |
GIT_TAG ${CPPTRACE_TAG} |
| 14 |
) |
| 15 |
FetchContent_MakeAvailable(cpptrace) |
| 16 |
target_link_libraries(main cpptrace::cpptrace) |
| 17 |
target_compile_features(main PRIVATE cxx_std_11) |
| 18 |
|
| 19 |
if(WIN32) |
| 20 |
add_custom_command( |
| 21 |
TARGET main POST_BUILD |
| 22 |
COMMAND ${CMAKE_COMMAND} -E copy_if_different |
| 23 |
$<TARGET_FILE:cpptrace::cpptrace> |
| 24 |
$<TARGET_FILE_DIR:main> |
| 25 |
) |
| 26 |
endif() |