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

Added command line options, to avoid having to build tests, examples … #123

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
22 changes: 16 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,17 @@ project(fff)

set(CMAKE_CXX_STANDARD 11)

# Add the gtest library which will be used below
add_subdirectory(gtest)
# Enable easier enabling/disabling of example and test builds
option(FFF_BUILD_TEST "If set to ON, unit tests will be compiled" ON)
option(BuildExample "If set to ON, examples will be compiled" ON)

# Enable ctest
enable_testing()
if(FFF_BUILD_TEST)
# Add the gtest library which will be used below
add_subdirectory(gtest)

# Enable ctest
enable_testing()
endif()

# Generate fff.h if fakegen.rb changed
add_custom_command(
Expand All @@ -30,5 +36,9 @@ add_dependencies(fff fff_h)
target_include_directories(fff INTERFACE ${CMAKE_CURRENT_LIST_DIR})

# Add tests and samples
add_subdirectory(test)
add_subdirectory(examples)
if(FFF_BUILD_TEST)
add_subdirectory(test)
endif()
if(BuildExample)
add_subdirectory(examples)
endif()