File tree 4 files changed +32
-3
lines changed
4 files changed +32
-3
lines changed Original file line number Diff line number Diff line change 28
28
29
29
# CMake-generated files:
30
30
CMakeFiles /
31
- * .cmake
32
31
/pkg-config /jsoncpp.pc
33
32
jsoncpp_lib_static.dir /
34
33
Original file line number Diff line number Diff line change @@ -49,6 +49,8 @@ if(NOT DEFINED CMAKE_BUILD_TYPE AND NOT DEFINED CMAKE_CONFIGURATION_TYPES)
49
49
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel Coverage." )
50
50
endif ()
51
51
52
+ set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR} /cmake" )
53
+
52
54
# ---------------------------------------------------------------------------
53
55
# use ccache if found, has to be done before project()
54
56
# ---------------------------------------------------------------------------
@@ -148,6 +150,11 @@ if(JSONCPP_WITH_WARNING_AS_ERROR)
148
150
endif ()
149
151
150
152
if (JSONCPP_WITH_PKGCONFIG_SUPPORT)
153
+ include (JoinPaths)
154
+
155
+ join_paths(libdir_for_pc_file "\$ {exec_prefix}" "${CMAKE_INSTALL_LIBDIR} " )
156
+ join_paths(includedir_for_pc_file "\$ {prefix}" "${CMAKE_INSTALL_INCLUDEDIR} " )
157
+
151
158
configure_file (
152
159
"pkg-config/jsoncpp.pc.in"
153
160
"pkg-config/jsoncpp.pc"
Original file line number Diff line number Diff line change
1
+ # This module provides a function for joining paths
2
+ # known from most languages
3
+ #
4
+ # SPDX-License-Identifier: (MIT OR CC0-1.0)
5
+ # Copyright 2020 Jan Tojnar
6
+ # https://github.com/jtojnar/cmake-snips
7
+ #
8
+ # Modelled after Python’s os.path.join
9
+ # https://docs.python.org/3.7/library/os.path.html#os.path.join
10
+ # Windows not supported
11
+ function (join_paths joined_path first_path_segment)
12
+ set (temp_path "${first_path_segment} " )
13
+ foreach (current_segment IN LISTS ARGN)
14
+ if (NOT ("${current_segment} " STREQUAL "" ))
15
+ if (IS_ABSOLUTE "${current_segment} " )
16
+ set (temp_path "${current_segment} " )
17
+ else ()
18
+ set (temp_path "${temp_path} /${current_segment} " )
19
+ endif ()
20
+ endif ()
21
+ endforeach ()
22
+ set (${joined_path} "${temp_path} " PARENT_SCOPE)
23
+ endfunction ()
Original file line number Diff line number Diff line change 1
1
prefix=@CMAKE_INSTALL_PREFIX@
2
2
exec_prefix=@CMAKE_INSTALL_PREFIX@
3
- libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR @
4
- includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR @
3
+ libdir=@libdir_for_pc_file @
4
+ includedir=@includedir_for_pc_file @
5
5
6
6
Name: jsoncpp
7
7
Description: A C++ library for interacting with JSON
You can’t perform that action at this time.
0 commit comments