Skip to content

Install pkgconfig and cmake files into arch-dependent locations#1055

Merged
jbeder merged 1 commit intojbeder:masterfrom
tgurr:arch
Sep 20, 2022
Merged

Install pkgconfig and cmake files into arch-dependent locations#1055
jbeder merged 1 commit intojbeder:masterfrom
tgurr:arch

Conversation

@tgurr
Copy link
Copy Markdown
Contributor

@tgurr tgurr commented Oct 29, 2021

This restores the CMake / installed files behaviour of version 0.6.3 which changed in 0.7.0, resulting in arch-dependent files ending up in /usr/share instead of $prefix/libdir. This is required on multiarch/cross layouts setting the prefix to e.g. /usr/x86_64-pc-linux-gnu or /usr/i686-pc-linux-gnu so a pkg-config file in /usr/share like

prefix=/usr/x86_64-pc-linux-gnu
exec_prefix=${prefix}
includedir=${prefix}/include
libdir=${exec_prefix}/lib

Name: Yaml-cpp
Description: A YAML parser and emitter for C++
Version: 0.7.0
Requires:
Libs: -L${libdir} -lyaml-cpp
Cflags: -I${includedir}

would be wrong as it contains arch-specific code.

@jbeder
Copy link
Copy Markdown
Owner

jbeder commented Nov 23, 2021

This sounds reasonable to me, but I've been bitten quite a bit lately by approving CMake changes I don't understand. Could you add a clause to the github action here that tests the behavior you'd like to see? That way it'll guarantee that the behavior you want is preserved even if people later update the CMake file.

@tgurr
Copy link
Copy Markdown
Contributor Author

tgurr commented Nov 23, 2021

Thanks for the suggestion, however I'm not familiar with GitHub Actions and/or writing any tests so I'll most likely not being able to help with or contribute anything in this regard.

felix2010 added a commit to felix2010/yaml-cpp that referenced this pull request Dec 30, 2021
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 same 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.
felix2010 added a commit to felix2010/yaml-cpp that referenced this pull request Dec 30, 2021
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 same 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.
felix2010 added a commit to felix2010/yaml-cpp that referenced this pull request Dec 30, 2021
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.
jbeder pushed a commit that referenced this pull request Apr 1, 2022
After configuring the file `yaml-cpp-config.cmake.in`, the result ends up with
empty variables.  (see also the discussion in #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. #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.
@tgurr
Copy link
Copy Markdown
Contributor Author

tgurr commented Aug 30, 2022

See also #1020.

@jbeder
Copy link
Copy Markdown
Owner

jbeder commented Sep 20, 2022

You know what, this is fine; if it breaks someone's build then I guess I can ask them to write a test.

@jbeder jbeder merged commit 255bf1f into jbeder:master Sep 20, 2022
@tgurr tgurr deleted the arch branch September 20, 2022 07:30
davemccann pushed a commit to davemccann/yaml-cpp that referenced this pull request Jul 30, 2023
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.
davemccann pushed a commit to davemccann/yaml-cpp that referenced this pull request Jul 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants