Skip to content

Commit 1c3a20d

Browse files
committed
Allow customization of component install dirs
1 parent 533dbe0 commit 1c3a20d

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@ IF(NOT WIN32)
1616
ENDIF(NOT CMAKE_BUILD_TYPE)
1717
ENDIF(NOT WIN32)
1818

19+
SET(RUNTIME_INSTALL_DIR lib
20+
CACHE PATH "Install dir for executables and dlls")
21+
SET(ARCHIVE_INSTALL_DIR lib
22+
CACHE PATH "Install dir for static libraries")
23+
SET(LIBRARY_INSTALL_DIR lib
24+
CACHE PATH "Install dir for shared libraries")
25+
SET(INCLUDE_INSTALL_DIR include
26+
CACHE PATH "Install dir for headers")
27+
MARK_AS_ADVANCED( RUNTIME_INSTALL_DIR ARCHIVE_INSTALL_DIR INCLUDE_INSTALL_DIR )
28+
1929
# This ensures shared DLL are in the same dir as executable on Windows.
2030
# Put all executables / libraries are in a project global directory.
2131
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib

include/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
FILE(GLOB INCLUDE_FILES "json/*.h")
2-
INSTALL(FILES ${INCLUDE_FILES} DESTINATION include/json)
2+
INSTALL(FILES ${INCLUDE_FILES} DESTINATION ${INCLUDE_INSTALL_DIR}/json)

src/lib_json/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ SET_TARGET_PROPERTIES( jsoncpp_lib PROPERTIES VERSION ${JSONCPP_VERSION} SOVERSI
4141

4242
# Install instructions for this target
4343
INSTALL( TARGETS jsoncpp_lib
44-
RUNTIME DESTINATION bin
45-
LIBRARY DESTINATION lib
46-
ARCHIVE DESTINATION lib
44+
RUNTIME DESTINATION ${RUNTIME_INSTALL_DIR}
45+
LIBRARY DESTINATION ${LIBRARY_INSTALL_DIR}
46+
ARCHIVE DESTINATION ${ARCHIVE_INSTALL_DIR}
4747
)

0 commit comments

Comments
 (0)