-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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 export fix #1077
Cmake export fix #1077
Conversation
This is to align with the other code parts in this file.
After configure the file `yaml-cpp-config.cmake.in` the result ends up with empty variables. (see also the discussion in jbeder#774). Rework this file and the call to `configure_package_config_file` according the cmake documentation (https://cmake.org/cmake/help/v3.22/module/CMakePackageConfigHelpers.html?highlight=configure_package_config#command:configure_package_config_file) to overcome this issue and allow a simple `find_package` after install. As there was some discussion about the place where to install the `yaml-cpp-config.cmake` file, e.g. jbeder#1055, factor out the install location into an extra variable to make it easier changing this location in the future.
What behavior will this fix? (That is, how do you reproduce the problem you're seeing, to verify that this fixes it?) Once you specify that (e.g. sequence of command lines), let's put them in the automated github tests so we can keep these passing. |
Configure the project and check the generated
Actual output is
but expected are non empty variables, i.e.
I'm not familiar with github workflow/test, thus I need your advice how to bring this into the automated tests. |
Thanks! And what's the goal of having those variables set? That is, what subsequent command with use them and expect them to be nonempty? |
The variables are documented entities in
|
I'm going to merge this because I'm too lazy to try to figure out how to test it properly, and it very likely is the right solution. At some point, it would be nice to have a way to know if this is broken, so I'm open to PRs that just have a new test case in the Github actions file. |
Fixes #774 |
After configuring the file `yaml-cpp-config.cmake.in`, the result ends up with empty variables. (see also the discussion in jbeder#774). Rework this file and the call to `configure_package_config_file` according the cmake documentation (https://cmake.org/cmake/help/v3.22/module/CMakePackageConfigHelpers.html?highlight=configure_package_config#command:configure_package_config_file) to overcome this issue and allow a simple `find_package` after install. As there was some discussion about the place where to install the `yaml-cpp-config.cmake` file, e.g. jbeder#1055, factor out the install location into an extra variable to make it easier changing this location in the future. Also untabify CMakeLists.txt in some places to align with the other code parts in this file.
I tried to fix the generation of the file
yaml-cpp-config.cmake
. Former the variablesYAML_CPP_CMAKE_DIR
andYAML_CPP_LIBRARIES
where empty within this file,now they are set appropriately.
I reworked the file accordingly to cmake documentation as described in the commit message.