File tree Expand file tree Collapse file tree 4 files changed +32
-3
lines changed
Expand file tree Collapse file tree 4 files changed +32
-3
lines changed Original file line number Diff line number Diff line change 2828
2929# CMake-generated files:
3030CMakeFiles /
31- * .cmake
3231/pkg-config /jsoncpp.pc
3332jsoncpp_lib_static.dir /
3433
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)
4949 "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel Coverage." )
5050endif ()
5151
52+ set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR} /cmake" )
53+
5254# ---------------------------------------------------------------------------
5355# use ccache if found, has to be done before project()
5456# ---------------------------------------------------------------------------
@@ -148,6 +150,11 @@ if(JSONCPP_WITH_WARNING_AS_ERROR)
148150endif ()
149151
150152if (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+
151158 configure_file (
152159 "pkg-config/jsoncpp.pc.in"
153160 "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 11prefix=@CMAKE_INSTALL_PREFIX@
22exec_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 @
55
66Name: jsoncpp
77Description: A C++ library for interacting with JSON
You can’t perform that action at this time.
0 commit comments