-
Notifications
You must be signed in to change notification settings - Fork 470
Closed
Description
I'm about to integrate libjsonnet++ in a C++ project that should support processing of jsonnet files. The project is CMake based, so the projects CMakeLists.txt looks somewhat like that:
option (BUILD_JSONNET "Build jsonnet command-line tool." OFF)
option (BUILD_JSONNETFMT "Build jsonnetfmt command-line tool." OFF)
option (BUILD_TESTS "Build and run jsonnet tests." OFF)
add_subdirectory (ext/jsonnet)
add_executable (my_project src/main.cpp)
target_link_libraries (my_project PRIVATE libjsonnet++_static)This generates a project that successfully compiles but generates the following warning at CMake configuration time:
CMake Warning (dev) at pdc/ext/jsonnet/cpp/CMakeLists.txt:31 (add_dependencies):
Policy CMP0046 is not set: Error on non-existent dependency in
add_dependencies. Run "cmake --help-policy CMP0046" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.
The dependency target "jsonnet" of target "libjsonnet++_static" does not
exist.
This warning is for project developers. Use -Wno-dev to suppress it.
I deliberately don't want the jsonnet command line tool target to be created in order to keep the CMake targets of my project clean and tidy, so disabling it and only linking my project against libjsonnet++_static seems like the right thing to do. Generally, I'm a bit surprised by these dependencies. Is it just an oversight for the configuration that I'm using or am using it in an unsupported configuration?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels