Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add CMake options for variables #52

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ set(INCLUDE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include")
set(SOURCE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/src")
set(TEST_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/test")

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

# add shared library macro
option(BUILD_SHARED_LIBS "build shared libraries" OFF)
if(BUILD_SHARED_LIBS)
target_compile_definitions(cwalk PUBLIC CWK_SHARED)
endif()

# enable tests
option(ENABLE_TESTS "enable unit tests" OFF)
if(ENABLE_TESTS)
message("-- Tests enabled")
enable_testing()
Expand Down
2 changes: 2 additions & 0 deletions cmake/EnableWarnings.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# enable warnings
option(IGNORE_WARNINGS "Disable -Werror" OFF)

function(enable_warnings target)
if(MSVC)
target_compile_definitions(${target} PRIVATE _CRT_SECURE_NO_WARNINGS)
Expand Down
Loading