Skip to content

Commit 1799a51

Browse files
authored
Merge pull request #183 from OpenSimulationInterface/feature/cmake-install
Feature/cmake install
2 parents 89f3a93 + 725f182 commit 1799a51

24 files changed

+34
-28
lines changed

.travis.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ cache:
1515

1616
# Handle dependencies in separate directory.
1717
before_install:
18+
- TESTINST_DIR="${HOME}/dummy"
19+
- mkdir -p "${TESTINST_DIR}"
1820
- DEPS_DIR="${HOME}/deps"
1921
- mkdir -p "${DEPS_DIR}"
2022
- cd "${DEPS_DIR}"
@@ -40,9 +42,11 @@ before_script:
4042
script:
4143
- mkdir -p build
4244
- cd build
43-
- cmake -D CMAKE_PREFIX_PATH:PATH=${DEPS_DIR}/protobuf/install ..
45+
- cmake -D CMAKE_PREFIX_PATH:PATH=${DEPS_DIR}/protobuf/install -D CMAKE_INSTALL_PREFIX:PATH=${TESTINST_DIR} ..
4446
- cmake --build .
4547
- cd ..
4648
- python test_cases.py
4749
- python setup.py build
4850
- python setup.py sdist
51+
- cd build
52+
- cmake --build . --target install

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

osi_common.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ syntax = "proto2";
22

33
option optimize_for = SPEED;
44

5-
package osi;
5+
package osi3;
66

77

88
//

osi_datarecording.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ option optimize_for = SPEED;
44

55
import "osi_sensordata.proto";
66

7-
package osi;
7+
package osi3;
88

99
//
1010
// \brief (Time) Series of \c SensorData messages that may be used for data

osi_detectedlandmark.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import "osi_common.proto";
66
import "osi_landmark.proto";
77
import "osi_detectedobject.proto";
88

9-
package osi;
9+
package osi3;
1010

1111
//
1212
// \brief A traffic sign in the environment as detected by the sensor.

osi_detectedlane.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import "osi_common.proto";
66
import "osi_lane.proto";
77
import "osi_detectedobject.proto";
88

9-
package osi;
9+
package osi3;
1010

1111
//
1212
// \brief A lane segment as detected by the sensor.

osi_detectedobject.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import "osi_modelinternal.proto";
77
import "osi_object.proto";
88
import "osi_sensorspecific.proto";
99

10-
package osi;
10+
package osi3;
1111

1212
//
1313
// \brief Object in the environment as detected and perceived by the sensor.

osi_detectedoccupant.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import "osi_common.proto";
66
import "osi_occupant.proto";
77
import "osi_detectedobject.proto";
88

9-
package osi;
9+
package osi3;
1010

1111
//
1212
// \brief A vehicle occupant as detected and perceived by an interior sensor.

osi_environment.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ syntax = "proto2";
22

33
option optimize_for = SPEED;
44

5-
package osi;
5+
package osi3;
66

77
//
88
// \brief The conditions of the environment.

0 commit comments

Comments
 (0)