Skip to content
This repository has been archived by the owner on Sep 1, 2022. It is now read-only.

Commit

Permalink
Export CMake lib.
Browse files Browse the repository at this point in the history
  • Loading branch information
emgre committed Apr 23, 2020
1 parent 60b6bfd commit aa65f08
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
-DDNP3_TLS=ON
-DDNP3_TESTS=ON
-DDNP3_COVERAGE=ON
-DCMAKE_BUILD_TYPE=DEBUG
-DCMAKE_BUILD_TYPE=Debug
..
- name: Build and run tests with code coverage
if: ${{ matrix.coverage }} == "ON"
Expand Down
18 changes: 9 additions & 9 deletions cpp/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -711,14 +711,11 @@ source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${all_sources})

add_library(opendnp3 ${all_sources})
target_compile_features(opendnp3 PUBLIC cxx_std_14)
target_link_libraries(opendnp3
PRIVATE ser4cpp exe4cpp asio
)
target_include_directories(opendnp3
PUBLIC
$<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
target_link_libraries(opendnp3 PRIVATE
$<BUILD_INTERFACE:ser4cpp>
$<BUILD_INTERFACE:exe4cpp>
$<BUILD_INTERFACE:asio>
$<$<BOOL:${DNP3_TLS}>:OpenSSL::SSL>
)
target_include_directories(opendnp3
PUBLIC
Expand All @@ -729,7 +726,6 @@ target_include_directories(opendnp3
set_target_properties(opendnp3 PROPERTIES FOLDER cpp/lib)

if(DNP3_TLS)
target_link_libraries(opendnp3 PRIVATE OpenSSL::SSL)
target_compile_definitions(opendnp3 PRIVATE OPENDNP3_USE_TLS)
endif()

Expand All @@ -739,6 +735,10 @@ install(TARGETS opendnp3
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
)
install(EXPORT opendnp3-export
NAMESPACE opendnp3::
DESTINATION lib/cmake
)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/
DESTINATION include
)
Expand Down

0 comments on commit aa65f08

Please sign in to comment.