Skip to content

Commit

Permalink
- expose include directory
Browse files Browse the repository at this point in the history
 - disable build of example by default
  • Loading branch information
fbergmann committed Apr 14, 2022
1 parent 99f5695 commit 0b327bc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/core/SBWBroker/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ INSTALL(TARGETS ${BROKER_NAME}

endif(WITH_BUILD_BROKER)


option(BUILD_TRIG_EXAMPLE "Builds an example Trig service" OFF)
if(BUILD_TRIG_EXAMPLE)
add_executable (trig_server example/TrigPlusServerModule.cpp)
target_link_libraries(trig_server SBW-static)
endif()

7 changes: 6 additions & 1 deletion src/core/SBWCore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ if (WITH_BUILD_SHARED)
@ONLY)

add_library (SBW SHARED ${SBW_SOURCES} ${SBW_HEADERS} ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
set_target_properties(SBW PROPERTIES COMPILE_DEFINITIONS "SBW_FORCE_EXPORT=1;SBW_EXPORTS=1;SBW_STATIC=0")
set_target_properties(SBW PROPERTIES
COMPILE_DEFINITIONS "SBW_FORCE_EXPORT=1;SBW_EXPORTS=1;SBW_STATIC=0")

else()

Expand Down Expand Up @@ -102,6 +103,10 @@ if (WITH_BUILD_STATIC)
endif(WIN32 AND NOT CYGWIN)

target_link_libraries(SBW-static ${SBW_LIBS})
target_include_directories(SBW-static PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>
$<INSTALL_INTERFACE:include>
)

INSTALL(TARGETS SBW-static EXPORT SBW-static-config
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
Expand Down

0 comments on commit 0b327bc

Please sign in to comment.