Skip to content

Commit fc9ff05

Browse files
FabeleAltranpmai
authored andcommitted
Port per-major-release cmake install from v2.2.1
The cmake file from current master branch is reused and adjusted to allow several OSI versions on the same computer. The main idea is to install into a directory that takes the version into account. This draft uses the major version described inside the version file to configure the installation path.
1 parent 89f3a93 commit fc9ff05

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ foreach(LINE ${VERSION_CONTENTS})
3939
endforeach()
4040
set(OPEN_SIMULATION_INTERFACE_VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
4141

42+
set(INSTALL_LIB_DIR ${INSTALL_LIB_DIR}/osi${VERSION_MAJOR})
43+
set(INSTALL_INCLUDE_DIR ${INSTALL_INCLUDE_DIR}/osi${VERSION_MAJOR})
44+
4245
configure_file(osi_version.proto.in ${CMAKE_CURRENT_SOURCE_DIR}/osi_version.proto)
4346

4447
find_package(Protobuf 2.6.1 REQUIRED)
@@ -105,7 +108,6 @@ install(TARGETS ${PROJECT_NAME}_pic
105108
EXPORT ${PROJECT_NAME}_targets
106109
ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" COMPONENT lib)
107110

108-
109111
add_library(${PROJECT_NAME} SHARED $<TARGET_OBJECTS:${PROJECT_NAME}_obj>)
110112
target_include_directories(${PROJECT_NAME}
111113
PUBLIC
@@ -141,7 +143,7 @@ install(FILES
141143

142144
# Header files
143145
install(FILES ${PROTO_HEADERS}
144-
DESTINATION "${CMAKE_INSTALL_PREFIX}/${INSTALL_INCLUDE_DIR}")
146+
DESTINATION "${INSTALL_INCLUDE_DIR}")
145147

146148
# Install the export set for use with the install-tree
147149
install(EXPORT ${PROJECT_NAME}_targets

VERSION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
VERSION_MAJOR = 2
2-
VERSION_MINOR = 2
3-
VERSION_PATCH = 0
1+
VERSION_MAJOR = 3
2+
VERSION_MINOR = 0
3+
VERSION_PATCH = 0

0 commit comments

Comments
 (0)