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

Better integration with CMake 3.13 #214

Closed
ghost opened this issue Dec 27, 2018 · 0 comments · Fixed by #215
Closed

Better integration with CMake 3.13 #214

ghost opened this issue Dec 27, 2018 · 0 comments · Fixed by #215
Labels

Comments

@ghost
Copy link

ghost commented Dec 27, 2018

Use case

FetchContent_Declare (cucumber_cpp
    GIT_REPOSITORY https://github.com/cucumber/cucumber-cpp.git
)

FetchContent_GetProperties (cucumber_cpp)
if (NOT cucumber_cpp_POPULATED)

    FetchContent_Populate (cucumber_cpp)

    set (CUKE_DISABLE_GTEST ON)
    add_subdirectory (
        ${cucumber_cpp_SOURCE_DIR}
        ${cucumber_cpp_BINARY_DIR}
    )

endif ()

Prints the following warning:

CMake Warning (dev) at build/_deps/cucumber_cpp-src/CMakeLists.txt:14 (option):
  Policy CMP0077 is not set: option() honors normal variables.  Run "cmake
  --help-policy CMP0077" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

  For compatibility with older versions of CMake, option is clearing the
  normal variable 'CUKE_DISABLE_GTEST'.
This warning is for project developers.  Use -Wno-dev to suppress it.

Possible solutions

  • Use set(... CACHE ...) or option(). Requires docstring duplication (in practice removal).
  • If CMAKE_VERSION is 3.13 or above then set policy CMP0077: option() honors normal variables. This must be done in cucumber-cpp/CMakeLists.txt.
@ghost ghost added the build label Dec 27, 2018
@ghost ghost closed this as completed in #215 May 5, 2019
ghost pushed a commit that referenced this issue May 5, 2019
Fix #214: Better integration with CMake 3.13 (CMP0077)
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

0 participants