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

Improve CMake options handling #200

Closed
rdumusc opened this issue Sep 1, 2017 · 0 comments
Closed

Improve CMake options handling #200

rdumusc opened this issue Sep 1, 2017 · 0 comments
Assignees

Comments

@rdumusc
Copy link

rdumusc commented Sep 1, 2017

  • Move all the common_find_package() calls to the top-level CMakeLists. This is needed so that the return() from the common_find_package macro works correctly if a REQUIRED dependency is not found when Brayns is a subproject.
  • Replace all
option(BRAYNS_ENABLE_FOO "Enable Foo support" OFF)
if(BRAYNS_ENABLE_FOO)
  common_find_package(foo)
endif()

with:

common_find_package(foo)
if(FOO_FOUND)
  option(BRAYNS_ENABLE_FOO "Enable Foo support" ON)
endif()

This logic has the advantage of enabling all the options that are found by default and still lets users disable them if need be.

rdumusc pushed a commit to rdumusc/Brayns that referenced this issue Oct 2, 2017
rdumusc pushed a commit to rdumusc/Brayns that referenced this issue Oct 2, 2017
rdumusc pushed a commit to rdumusc/Brayns that referenced this issue Oct 2, 2017
rdumusc pushed a commit to rdumusc/Brayns that referenced this issue Oct 2, 2017
rdumusc pushed a commit that referenced this issue Oct 2, 2017
@rdumusc rdumusc closed this as completed Oct 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants