-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved CMake install and CPack behavior (#12)
- tcp_pubsub now properly installs dll/so files when BUILD_SHARED_LIBS is ON - tcp_pubsub can now be packed with CPack - Added CMake option to disable building the sample Projects - Added integration_test project that can be build against an install to perform a very simple automated link and runtime test - Created GH Actions that properly compile and package binaries for windows and Linux
- Loading branch information
1 parent
5b47272
commit c164c9b
Showing
14 changed files
with
316 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,4 +43,4 @@ CMakeLists.txt.user | |
|
||
#Build dir | ||
/_build | ||
|
||
/samples/integration_test/_build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,51 @@ | ||
cmake_minimum_required(VERSION 3.5.1) | ||
|
||
# Project call | ||
include("${CMAKE_CURRENT_LIST_DIR}/tcp_pubsub/version.cmake") | ||
project(tcp_pubsub VERSION ${TCP_PUBSUB_VERSION_MAJOR}.${TCP_PUBSUB_VERSION_MINOR}.${TCP_PUBSUB_VERSION_PATCH}) | ||
|
||
# Normalize backslashes from Windows paths | ||
file(TO_CMAKE_PATH "${CMAKE_MODULE_PATH}" CMAKE_MODULE_PATH) | ||
file(TO_CMAKE_PATH "${CMAKE_PREFIX_PATH}" CMAKE_PREFIX_PATH) | ||
message(STATUS "Module Path: ${CMAKE_MODULE_PATH}") | ||
message(STATUS "Prefix Path: ${CMAKE_PREFIX_PATH}") | ||
|
||
# CMake Options | ||
option(TCP_PUBSUB_BUILD_SAMPLES | ||
"Build project samples" | ||
ON) | ||
|
||
option(TCP_PUBSUB_BUILD_ECAL_SAMPLES | ||
"Build eCAL-based project samples. Requires eCAL to be findable by CMake." | ||
OFF) | ||
|
||
# Module path for finding asio | ||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/modules) | ||
|
||
project(tcp_pubsub) | ||
# Set Debug postfix | ||
set(CMAKE_DEBUG_POSTFIX d) | ||
set(CMAKE_MINSIZEREL_POSTFIX minsize) | ||
set(CMAKE_RELWITHDEBINFO_POSTFIX reldbg) | ||
|
||
# Add main tcp_pubsub library | ||
add_subdirectory(tcp_pubsub) | ||
|
||
# Recycle dependency. It's header only and not in the API, so we add it with EXCLUDE_FOR_ALL, so it won't be installed | ||
add_subdirectory(thirdparty/recycle EXCLUDE_FROM_ALL) | ||
|
||
add_subdirectory(samples/performance_publisher) | ||
add_subdirectory(samples/performance_subscriber) | ||
add_subdirectory(samples/hello_world_publisher) | ||
add_subdirectory(samples/hello_world_subscriber) | ||
# Generic samples | ||
if (TCP_PUBSUB_BUILD_SAMPLES) | ||
add_subdirectory(samples/performance_publisher) | ||
add_subdirectory(samples/performance_subscriber) | ||
add_subdirectory(samples/hello_world_publisher) | ||
add_subdirectory(samples/hello_world_subscriber) | ||
endif() | ||
|
||
# Specific eCAL Samples that tunnel an eCAL Topic through TCP | ||
if(TCP_PUBSUB_BUILD_ECAL_SAMPLES) | ||
add_subdirectory(samples/ecal_to_tcp) | ||
add_subdirectory(samples/tcp_to_ecal) | ||
endif() | ||
|
||
# add_subdirectory(samples/ecal_to_tcp) | ||
# add_subdirectory(samples/tcp_to_ecal) | ||
# Make this package available for packing with CPack | ||
include("${CMAKE_CURRENT_LIST_DIR}/cpack_config.cmake") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
set(CPACK_PACKAGE_NAME ${PROJECT_NAME}) | ||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "A low-level publish-subscribe library operating on TCP/IP") | ||
set(CPACK_PACKAGE_VENDOR "Eclipse eCAL") | ||
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION}) | ||
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) | ||
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) | ||
set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) | ||
set(CPACK_PACKAGE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/_package") | ||
|
||
set(CPACK_PACKAGE_CONTACT "florian.reimold@continental-corporation.com") | ||
|
||
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Florian Reimold <florian.reimold@continental-corporation.com>") | ||
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://github.com/eclipse-ecal/tcp_pubsub") | ||
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) | ||
set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS ON) | ||
|
||
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_LIST_DIR}/LICENSE") | ||
set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_LIST_DIR}/README.md") | ||
|
||
include(CPack) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
cmake_minimum_required(VERSION 3.5.1) | ||
|
||
project(integration_test) | ||
|
||
set(CMAKE_CXX_STANDARD 14) | ||
|
||
set(CMAKE_FIND_PACKAGE_PREFER_CONFIG TRUE) | ||
find_package(tcp_pubsub REQUIRED) | ||
|
||
set(sources | ||
src/main.cpp | ||
) | ||
|
||
add_executable (${PROJECT_NAME} | ||
${sources} | ||
) | ||
|
||
target_link_libraries (${PROJECT_NAME} | ||
tcp_pubsub::tcp_pubsub | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Copyright (c) Continental. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for details. | ||
|
||
#include <iostream> | ||
#include <thread> | ||
|
||
#include <tcp_pubsub/publisher.h> | ||
|
||
int main() | ||
{ | ||
{ | ||
std::shared_ptr<tcp_pubsub::Executor> executor = std::make_shared<tcp_pubsub::Executor>(6); | ||
tcp_pubsub::Publisher hello_world_publisher(executor, 1588); | ||
} | ||
|
||
std::this_thread::sleep_for(std::chrono::milliseconds(10)); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.