File tree 3 files changed +32
-2
lines changed
3 files changed +32
-2
lines changed Original file line number Diff line number Diff line change @@ -124,6 +124,8 @@ endif()
124
124
# Installation
125
125
# ============
126
126
127
+ set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR} /cmake" )
128
+ include (JoinPaths)
127
129
include (GNUInstallDirs)
128
130
include (CMakePackageConfigHelpers)
129
131
@@ -159,6 +161,8 @@ install(EXPORT ${PROJECT_NAME}-targets
159
161
FILE ${PROJECT_NAME} Targets.cmake
160
162
DESTINATION ${XSIMD_CMAKECONFIG_INSTALL_DIR} )
161
163
164
+ join_paths(libdir_for_pc_file "\$ {exec_prefix}" "${CMAKE_INSTALL_LIBDIR} " )
165
+ join_paths(includedir_for_pc_file "\$ {prefix}" "${CMAKE_INSTALL_INCLUDEDIR} " )
162
166
configure_file (${PROJECT_NAME} .pc.in
163
167
"${CMAKE_CURRENT_BINARY_DIR} /${PROJECT_NAME} .pc"
164
168
@ONLY)
Original file line number Diff line number Diff line change
1
+ # This module provides function for joining paths
2
+ # known from from most languages
3
+ #
4
+ # Original license:
5
+ # SPDX-License-Identifier: (MIT OR CC0-1.0)
6
+ # Explicit permission given to distribute this module under
7
+ # the terms of the project as described in /LICENSE.rst.
8
+ # Copyright 2020 Jan Tojnar
9
+ # https://github.com/jtojnar/cmake-snips
10
+ #
11
+ # Modelled after Python’s os.path.join
12
+ # https://docs.python.org/3.7/library/os.path.html#os.path.join
13
+ # Windows not supported
14
+ function (join_paths joined_path first_path_segment)
15
+ set (temp_path "${first_path_segment} " )
16
+ foreach (current_segment IN LISTS ARGN)
17
+ if (NOT ("${current_segment} " STREQUAL "" ))
18
+ if (IS_ABSOLUTE "${current_segment} " )
19
+ set (temp_path "${current_segment} " )
20
+ else ()
21
+ set (temp_path "${temp_path} /${current_segment} " )
22
+ endif ()
23
+ endif ()
24
+ endforeach ()
25
+ set (${joined_path} "${temp_path} " PARENT_SCOPE)
26
+ endfunction ()
Original file line number Diff line number Diff line change 1
1
prefix=@CMAKE_INSTALL_PREFIX@
2
- libdir=${prefix}/@CMAKE_INSTALL_LIBDIR @
3
- includedir=${prefix}/include
2
+ ibdir=@libdir_for_pc_file @
3
+ includedir=@includedir_for_pc_file@
4
4
5
5
Name: xsimd
6
6
Description: xsimd provides a unified means for using SIMD features for library authors..
You can’t perform that action at this time.
0 commit comments