CMake Export Error When Including yaml-cpp as a Subdirectory in a Project
I have a project that includes yaml-cpp as a subdirectory in my project and uses it as a public dependency to one of my libraries. After the new CMake changes I get the following error:
CMake Error: install(EXPORT "${PROJECT_NAME}Targets" ...) includes target "${TARGET}" which requires target "yaml-cpp" that is not in the export set.
It worked with the previous version before yaml-cpp-targets was exported by CMake. Now on line 129 of the top level CMakeLists.txt file you only export yaml-cpp-targets if YAML_CPP_INSTALL=ON. The problem is that YAML_CPP_INSTALL is turned off when yaml-cpp is built as a subdirectory.
I tried SET(YAML_CPP_INSTALL ON CACHE INTERNAL "") and it still did not turn YAML_CPP_INSTALL on.
There should be a way to enable generation of the yaml-cpp install targets when it is included as a subdirectory in another project.
I have the same problem.
I am currently having the same issue. YAML_CPP_INSTALL should not be defined with a cmake_dependent_option, because it does not allow for cached values to be used from parent projects, as far as I can tell.
This is holding us back from using the master, we are adding yaml-cpp via external-project-add, what is the correct solution here ?
I just hit this as well with the new version .0.7.0 due to making it a cmake_dependent_option