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

CMake option to disable tests compilation #25

Open
01e9 opened this issue May 4, 2018 · 0 comments
Open

CMake option to disable tests compilation #25

01e9 opened this issue May 4, 2018 · 0 comments

Comments

@01e9
Copy link

01e9 commented May 4, 2018

First of all thank you for making this library installable. I use External_Project_Add() for all libraries, it compiles the library in an isolated environment and installs it in the specified directory (if you are interested in more details I can explain).

What I want is a way to disable tests when building the library.

Wrap this block in an if

# gtest
enable_testing()
add_subdirectory(googletest)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/googletest/googletest/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
# Tests
add_subdirectory(tests)
# Benchmark
add_subdirectory(benchmark)

like this

https://github.com/Microsoft/GSL/blob/5cbde3008aa43a9c5f6c219ee15b8388336d4433/CMakeLists.txt#L71-L75

then I will be able to control that block with -DENABLE_TESTS=ON/OFF

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant