Skip to content

Commit e9e2fa3

Browse files
authored
Merge pull request #16 from OpenSimulationInterface/feature/initial-build-system
Add basic CMake build script (resolves #4).
2 parents db6dd3f + 2e04c0f commit e9e2fa3

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

CMakeLists.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
cmake_minimum_required(VERSION 3.7)
2+
project(open-simulation-interface)
3+
find_package(Protobuf 2.6.1 REQUIRED)
4+
file(GLOB OSI_PROTO_FILES osi_*.proto)
5+
PROTOBUF_GENERATE_CPP(PROTO_SRC PROTO_HEADER ${OSI_PROTO_FILES})
6+
add_library(open_simulation_interface STATIC ${PROTO_SRC} ${PROTO_HEADER})
7+
target_include_directories(open_simulation_interface PUBLIC ${PROTOBUF_INCLUDE_DIR})
8+
target_link_libraries(open_simulation_interface PUBLIC ${PROTOBUF_LIBRARY})
9+
add_library(open_simulation_interface_pic STATIC ${PROTO_SRC} ${PROTO_HEADER})
10+
set_property(TARGET open_simulation_interface_pic PROPERTY POSITION_INDEPENDENT_CODE ON)
11+
target_include_directories(open_simulation_interface_pic PUBLIC ${PROTOBUF_INCLUDE_DIR})
12+
target_link_libraries(open_simulation_interface_pic PUBLIC ${PROTOBUF_LIBRARY})
13+
set (OSI_PROTOBUF_INCLUDE_PATH ${CMAKE_CURRENT_BINARY_DIR} CACHE INTERNAL "[OSI] Path to generated protobuf files for the open simulation interface.")

0 commit comments

Comments
 (0)