Skip to content
This repository has been archived by the owner on Aug 2, 2024. It is now read-only.

Feature/cmake config package #19

Merged
merged 2 commits into from
May 9, 2021

Conversation

JPMMaia
Copy link
Contributor

@JPMMaia JPMMaia commented May 8, 2021

Set CMake project version to 2.3.0 Setting the version of the project will enable creating a CMake package version file.

Add a new option KLEIN_INSTALL. When this option is enabled, then a CMake config-file package will be created during the install step. By default, this option is set to ON for standalone projects. Otherwise, the option is set of OFF.

The header files will be installed into include/klein. Therefore, the include directory of the exported targets should be include (i.e. $<INSTALL_INTERFACE:include>). To distinguish this from the include directories during a build we use the BUILD_INTERFACE generator expression (e.g. $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/public>).

if KLEIN_INSTALL is set to ON, then the targets are installed and the CMake config-file package is created. Other CMake projects can then search for the package using e.g. find_package(Klein 2.3.0).

klein-config.cmake will be executed by other projects when using find_package. Since klein depends on the simde headers, the CMake file will try to find these headers and add them to klein targets include
directories.

@JPMMaia JPMMaia force-pushed the feature/cmake-config-package branch from 0b1fa22 to a8f7c49 Compare May 8, 2021 08:19
Setting the version of the project will enable creating a CMake package
version file.
Add a new option `KLEIN_INSTALL`. When this option is enabled, then a
CMake config-file package will be created during the install step. By
default, this option is set to ON for standalone projects. Otherwise,
the option is set of OFF.

The header files will be installed into `include/klein`. Therefore,
the include directory of the exported targets should be `include`
(i.e. `$<INSTALL_INTERFACE:include>`). To distinguish this from the
include directories during a build we use the `BUILD_INTERFACE`
generator expression (e.g.
`$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/public>`).

if `KLEIN_INSTALL` is set to ON, then the targets are installed and the
CMake config-file package is created. Other CMake projects can then
search for the package using e.g. `find_package(Klein 2.3.0)`.

`klein-config.cmake` will be executed by other projects when using
`find_package`. Since klein depends on the simde headers, the CMake file
will try to find these headers and add them to klein targets include
directories.
@JPMMaia JPMMaia force-pushed the feature/cmake-config-package branch from a8f7c49 to 2be42b0 Compare May 8, 2021 08:39
@sonarcloud
Copy link

sonarcloud bot commented May 8, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@JPMMaia JPMMaia mentioned this pull request May 8, 2021
@jeremyong
Copy link
Owner

Sorry this is taking me a moment to review just to familiarize myself with vcpkg and all that. Thanks for submitting the pr!

@jeremyong jeremyong merged commit 9c18796 into jeremyong:master May 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants