Skip to content

Commit 952ba2d

Browse files
committed
add CMake options for variables
they are just easier to discover this way (see ccmake and IDE integrations)
1 parent e98d23f commit 952ba2d

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

CMakeLists.txt

+3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ set(INCLUDE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include")
2323
set(SOURCE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/src")
2424
set(TEST_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/test")
2525

26+
option(ENABLE_COVERAGE "Enable -ftest-converage" OFF)
2627
# enable coverage if requested
2728
if(ENABLE_COVERAGE)
2829
message("-- Coverage enabled")
@@ -50,11 +51,13 @@ set_target_properties(cwalk PROPERTIES PUBLIC_HEADER "${INCLUDE_DIRECTORY}/cwalk
5051
set_target_properties(cwalk PROPERTIES DEFINE_SYMBOL CWK_EXPORTS)
5152

5253
# add shared library macro
54+
option(BUILD_SHARED_LIBS "build shared libraries" OFF)
5355
if(BUILD_SHARED_LIBS)
5456
target_compile_definitions(cwalk PUBLIC CWK_SHARED)
5557
endif()
5658

5759
# enable tests
60+
option(ENABLE_TESTS "enable unit tests" OFF)
5861
if(ENABLE_TESTS)
5962
message("-- Tests enabled")
6063
enable_testing()

cmake/EnableWarnings.cmake

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# enable warnings
2+
option(IGNORE_WARNINGS "Disable -Werror" OFF)
3+
24
function(enable_warnings target)
35
if(MSVC)
46
target_compile_definitions(${target} PRIVATE _CRT_SECURE_NO_WARNINGS)

0 commit comments

Comments
 (0)