Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
R
rapidjson
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
rapidjson
Commits
b91c515a
Commit
b91c515a
authored
Mar 14, 2017
by
Clemens Arth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update to create config file which is independent from actual install location
parent
266870df
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
12 deletions
+44
-12
CMakeLists.txt
CMakeLists.txt
+29
-9
RapidJSONConfig.cmake.in
RapidJSONConfig.cmake.in
+15
-3
No files found.
CMakeLists.txt
View file @
b91c515a
...
@@ -173,15 +173,35 @@ install(DIRECTORY example/
...
@@ -173,15 +173,35 @@ install(DIRECTORY example/
# Provide config and version files to be used by other applications
# Provide config and version files to be used by other applications
# ===============================
# ===============================
export
(
PACKAGE
${
PROJECT_NAME
}
)
################################################################################
# Export package for use from the build tree
# cmake-modules
EXPORT
(
PACKAGE
${
PROJECT_NAME
}
)
CONFIGURE_FILE
(
${
PROJECT_NAME
}
Config.cmake.in
${
PROJECT_NAME
}
Config.cmake
# Create the RapidJSONConfig.cmake file for other cmake projects.
@ONLY
)
# ... for the build tree
CONFIGURE_FILE
(
${
PROJECT_NAME
}
ConfigVersion.cmake.in
SET
(
CONFIG_SOURCE_DIR
${
CMAKE_CURRENT_SOURCE_DIR
}
)
${
PROJECT_NAME
}
ConfigVersion.cmake
SET
(
CONFIG_DIR
${
CMAKE_CURRENT_BINARY_DIR
}
)
@ONLY
)
CONFIGURE_FILE
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
PROJECT_NAME
}
Config.cmake.in
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
PROJECT_NAME
}
Config.cmake @ONLY
)
CONFIGURE_FILE
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
PROJECT_NAME
}
ConfigVersion.cmake.in
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
PROJECT_NAME
}
ConfigVersion.cmake @ONLY
)
# ... for the install tree
SET
(
CMAKECONFIG_INSTALL_DIR lib/cmake/
${
PROJECT_NAME
}
)
FILE
(
RELATIVE_PATH REL_INCLUDE_DIR
"
${
CMAKE_INSTALL_PREFIX
}
/
${
CMAKECONFIG_INSTALL_DIR
}
"
"
${
CMAKE_INSTALL_PREFIX
}
/include"
)
SET
(
${
PROJECT_NAME
}
_INCLUDE_DIR
"
\$
{
${
PROJECT_NAME
}
_CMAKE_DIR}/
${
REL_INCLUDE_DIR
}
"
)
SET
(
CONFIG_SOURCE_DIR
)
SET
(
CONFIG_DIR
)
CONFIGURE_FILE
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
PROJECT_NAME
}
Config.cmake.in
${
CMAKE_CURRENT_BINARY_DIR
}${
CMAKE_FILES_DIRECTORY
}
/
${
PROJECT_NAME
}
Config.cmake @ONLY
)
INSTALL
(
FILES
"
${
CMAKE_CURRENT_BINARY_DIR
}${
CMAKE_FILES_DIRECTORY
}
/
${
PROJECT_NAME
}
Config.cmake"
DESTINATION
${
CMAKECONFIG_INSTALL_DIR
}
)
# Install files
INSTALL
(
FILES
INSTALL
(
FILES
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
PROJECT_NAME
}
Config.cmake
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
PROJECT_NAME
}
Config.cmake
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
PROJECT_NAME
}
ConfigVersion.cmake
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
PROJECT_NAME
}
ConfigVersion.cmake
...
...
RapidJSONConfig.cmake.in
View file @
b91c515a
get_filename_component(RAPIDJSON_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
################################################################################
set(RAPIDJSON_INCLUDE_DIRS "@INCLUDE_INSTALL_DIR@")
# RapidJSON source dir
message(STATUS "RapidJSON found. Headers: ${RAPIDJSON_INCLUDE_DIRS}")
set( RapidJSON_SOURCE_DIR "@CONFIG_SOURCE_DIR@")
################################################################################
# RapidJSON build dir
set( RapidJSON_DIR "@CONFIG_DIR@")
################################################################################
# Compute paths
get_filename_component(RapidJSON_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
set( RapidJSON_INCLUDE_DIR "@RapidJSON_INCLUDE_DIR@" )
set( RapidJSON_INCLUDE_DIRS "@RapidJSON_INCLUDE_DIR@" )
message(STATUS "RapidJSON found. Headers: ${RapidJSON_INCLUDE_DIRS}")
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment