Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/miloyip/rapidjson.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Le Lann <ivan.lelann@gmail.com>2021-10-02 16:26:17 +0300
committerGitHub <noreply@github.com>2021-10-02 16:26:17 +0300
commite6736d1baa5836fa4e39bc06e4569df8c1562635 (patch)
tree0a9510e728fd58cb6248d68bf6a9207a9bac4458
parent2e8f5d897d9d461a7273b4b812b0127f321b1dcf (diff)
Support CMake none targets
When trying to import rapidjson with for exemple : fetchcontent_declare(rapidjson GIT_REPOSITORY https://github.com/Tencent/rapidjson.git) if your CMake/Clang is "bare metal", exemple given : set(CMAKE_SYSTEM_NAME none) set(CMAKE_SYSTEM_PROCESSOR x86_64) set(CMAKE_C_COMPILER_TARGET x86_64-elf-none) set(CMAKE_CXX_COMPILER_TARGET x86_64-elf-none) CMake fails to process CMakeLists.txt because of the switch on UNIX/CYGWIN/WIN32 for install directory. Error is: CMake Error at cmake-build-debug-clang/_deps/rapidjson-src/CMakeLists.txt:244 (INSTALL): INSTALL FILES given no DESTINATION!
-rw-r--r--CMakeLists.txt12
1 files changed, 7 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index dc2072a9..bdfdd677 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -241,8 +241,10 @@ INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PROJECT_NAM
DESTINATION ${CMAKECONFIG_INSTALL_DIR} )
# Install files
-INSTALL(FILES
- ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
- ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
- DESTINATION "${CMAKE_INSTALL_DIR}"
- COMPONENT dev)
+IF(CMAKE_INSTALL_DIR)
+ INSTALL(FILES
+ ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
+ ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
+ DESTINATION "${CMAKE_INSTALL_DIR}"
+ COMPONENT dev)
+ENDIF()