Skip to content

Commit

Permalink
Merge pull request #86 from alexkutsan/feat/support_static_linking
Browse files Browse the repository at this point in the history
Support static linking
  • Loading branch information
pageldev authored Nov 24, 2023
2 parents 713098a + cca2854 commit 9f272c8
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ else()
set(CMAKE_CXX_FLAGS_DEBUG "-g")
endif()

add_library(OpenDrive SHARED
SET (SOURCES
src/Geometries/Arc.cpp
src/Geometries/CubicSpline.cpp
src/Geometries/Line.cpp
Expand All @@ -41,13 +41,18 @@ add_library(OpenDrive SHARED
thirdparty/pugixml/pugixml.cpp
)



add_library(OpenDrive SHARED ${SOURCES})
target_include_directories(OpenDrive
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/thirdparty>)

add_library(OpenDriveStatic STATIC ${SOURCES})
target_include_directories(OpenDriveStatic
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/thirdparty>)
set_target_properties(OpenDriveStatic PROPERTIES POSITION_INDEPENDENT_CODE ON)

add_executable(test-xodr test.cpp)
target_link_libraries(test-xodr OpenDrive)
Expand Down

0 comments on commit 9f272c8

Please sign in to comment.