vcpkg/ports/crashcatch/fix-disable-examples-tests....

38 lines
1.3 KiB
Diff

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7979fae..5d98d0f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,6 +4,9 @@ project(CrashCatchExamples VERSION 1.4.0 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
+option(CRASHCATCH_BUILD_EXAMPLES "Build example programs" OFF)
+option(CRASHCATCH_BUILD_TESTS "Build test programs" OFF)
+
# === Detect Platform & Set Platform Libraries ===
if(WIN32)
message(STATUS "Target platform: Windows")
@@ -55,6 +58,7 @@ install(FILES
DESTINATION lib/cmake/CrashCatch
)
+if(CRASHCATCH_BUILD_EXAMPLES)
# === Examples ===
add_executable(Example_ZeroConfig examples/Example_ZeroConfig.cpp)
target_link_libraries(Example_ZeroConfig PRIVATE CrashCatch)
@@ -79,11 +83,13 @@ target_link_libraries(Example_StackTrace PRIVATE CrashCatch)
add_executable(Example_UploadCrash examples/Example_UploadCrash.cpp)
target_link_libraries(Example_UploadCrash PRIVATE CrashCatch)
+endif()
+if(CRASHCATCH_BUILD_TESTS)
# === Tests ===
add_executable(test_callback_order tests/test_callback_order.cpp)
target_link_libraries(test_callback_order PRIVATE CrashCatch)
add_executable(test_stack_context tests/test_stack_context.cpp)
target_link_libraries(test_stack_context PRIVATE CrashCatch)
-
+endif()