-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix assumption that CMAKE_INSTALL_*DIR paths are relative.
This solution uses relative paths if possible, allowing the package to be relocatable, but still works correctly if CMAKE_INSTALL_*DIR paths are absolute.
- Loading branch information
1 parent
2981892
commit c9c9931
Showing
4 changed files
with
30 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# This module provides a function for joining paths | ||
# known from most languages | ||
# | ||
# SPDX-License-Identifier: (MIT OR CC0-1.0) | ||
# Copyright 2020 Jan Tojnar | ||
# https://github.com/jtojnar/cmake-snips | ||
# | ||
# Modelled after Python’s os.path.join | ||
# https://docs.python.org/3.7/library/os.path.html#os.path.join | ||
function(join_paths joined_path first_path_segment) | ||
set(temp_path "${first_path_segment}") | ||
foreach(current_segment IN LISTS ARGN) | ||
if(NOT ("${current_segment}" STREQUAL "")) | ||
if(IS_ABSOLUTE "${current_segment}") | ||
set(temp_path "${current_segment}") | ||
else() | ||
set(temp_path "${temp_path}/${current_segment}") | ||
endif() | ||
endif() | ||
endforeach() | ||
set(${joined_path} "${temp_path}" PARENT_SCOPE) | ||
endfunction() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ if (@PACKAGE_NAME@_CONFIG_INCLUDED) | |
endif() | ||
set(@PACKAGE_NAME@_CONFIG_INCLUDED TRUE) | ||
|
||
set(@PACKAGE_NAME@_INCLUDE_DIRS "${@PROJECT_NAME@_DIR}/@RELATIVE_PATH_CMAKE_DIR_TO_PREFIX@/@CMAKE_INSTALL_INCLUDEDIR@") | ||
set(@PACKAGE_NAME@_INCLUDE_DIRS "@cmake_conf_include_dirs@") | ||
|
||
include("${@PACKAGE_NAME@_DIR}/@[email protected]") | ||
|
||
|