Skip to content

Commit f346c79

Browse files
watologo1Thomas Renninger
authored and
Thomas Renninger
committedFeb 24, 2023
Make use of standard variables for installation
otherwise %cmake rpm macros will not be able to install things to the right places.
1 parent d394c5b commit f346c79

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed
 

‎CMakeLists.txt

+14-4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
1414
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
1515
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
1616

17+
if(NOT DEFINED INCLUDE_INSTALL_DIR)
18+
set(INCLUDE_INSTALL_DIR include)
19+
endif()
20+
if(NOT DEFINED CMAKE_INSTALL_BINDIR)
21+
set(CMAKE_INSTALL_BINDIR bin)
22+
endif()
23+
if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
24+
set(CMAKE_INSTALL_LIBDIR lib)
25+
endif()
26+
1727
set(CMAKE_C_FLAGS_DEBUG "-D_DEBUG")
1828

1929
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
@@ -97,10 +107,10 @@ if(CZMQ_FOUND)
97107
endif()
98108

99109
install(TARGETS redfishtest redfish
100-
RUNTIME DESTINATION bin
101-
LIBRARY DESTINATION lib)
102-
install(FILES ${REDFISH_HDR_PUBLIC_RED} DESTINATION include)
103-
install(FILES ${REDFISH_HDR_PUBLIC_ENTITIES} DESTINATION include/entities)
110+
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
111+
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}")
112+
install(FILES ${REDFISH_HDR_PUBLIC_RED} DESTINATION "${INCLUDE_INSTALL_DIR}")
113+
install(FILES ${REDFISH_HDR_PUBLIC_ENTITIES} DESTINATION "${INCLUDE_INSTALL_DIR}/entities")
104114

105115
ENABLE_TESTING()
106116

0 commit comments

Comments
 (0)