Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add standalone executables #216

Merged
merged 23 commits into from
May 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
0921c74
Add standalone executables
mjcarroll Jan 25, 2021
0dab304
Add CLI11 branch of utils
mjcarroll Jan 25, 2021
172605b
Attempt at minimally invaisive ruby edits
mjcarroll Jan 26, 2021
fc18bac
Re-enable ign tests, fix test cmd file
scpeters Feb 1, 2021
7bccb17
Remove ign directory
mjcarroll Feb 1, 2021
381e740
Split topic and service into their own executables
mjcarroll Feb 1, 2021
210859d
Lint
mjcarroll Feb 2, 2021
37f3546
Export path to both executables in ruby script
scpeters Feb 2, 2021
14afd74
Use libignition-utils1-dev for CI
scpeters Feb 26, 2021
c94fc59
Fix seg-faults in ign executables
scpeters Mar 3, 2021
8936e12
Use Open3.capture2e instead of `` to fix args
scpeters Mar 3, 2021
0ecc161
ign_TEST: update expected error message
scpeters Mar 3, 2021
befe59f
configure.bat: install ign-utils
scpeters Mar 3, 2021
c6f85c8
Fix generation of cmd*.rb file on Windows
scpeters Mar 12, 2021
0d8b134
rm configure.bat
scpeters Mar 12, 2021
35ce8fe
Remove visibility macros from ign.cc
scpeters Mar 15, 2021
0058edd
Do not set VISIBILITY for extern C functions
j-rivero Mar 15, 2021
4dcbd43
Disable UNIT_ign_TEST on windows
scpeters Mar 19, 2021
6614414
Use popen2e to print input as it arrives
scpeters Mar 31, 2021
42472b2
Install to IGN_LIB_INSTALL_DIR
scpeters Apr 27, 2021
040faa7
Wait longer in TopicPublish test
scpeters May 1, 2021
9584a1e
Merge branch 'ign-transport10' into add_standalone
scpeters May 8, 2021
f39b7d7
ign_TEST: improve reliability of TopicPublish test
scpeters May 11, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions conf/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# Used only for internal testing.
set(ign_library_path "${CMAKE_BINARY_DIR}/test/lib/ruby/ignition/cmd${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}")
set(ign_library_path "${CMAKE_BINARY_DIR}/test/lib/$<CONFIG>/ruby/ignition/cmd${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}")

# Generate a configuration file for internal testing.
# Note that the major version of the library is included in the name.
# Ex: transport0.yaml
configure_file(
"${IGN_DESIGNATION}.yaml.in"
"${CMAKE_BINARY_DIR}/test/conf/${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}.yaml" @ONLY)
"${CMAKE_CURRENT_BINARY_DIR}/${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}.yaml.configured" @ONLY)

file(GENERATE
OUTPUT "${CMAKE_BINARY_DIR}/test/conf/$<CONFIG>/${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}.yaml"
INPUT "${CMAKE_CURRENT_BINARY_DIR}/${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}.yaml.configured")

# Used for the installed version.
set(ign_library_path "${CMAKE_INSTALL_PREFIX}/lib/ruby/ignition/cmd${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}")
Expand Down
32 changes: 0 additions & 32 deletions configure.bat

This file was deleted.

10 changes: 1 addition & 9 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@
# "gtest_sources" variable.
ign_get_libsources_and_unittests(sources gtest_sources)

# Skip command line tests for Windows, see
# https://github.com/ignitionrobotics/ign-transport/issues/104
if (MSVC)
list(REMOVE_ITEM gtest_sources ign_TEST.cc)
endif()

if (MSVC)
# Warning #4251 is the "dll-interface" warning that tells you when types used
# by a class are not being exported. These generated source files have private
Expand Down Expand Up @@ -66,6 +60,4 @@ if(MSVC)
endif()

# Command line support.
if(NOT WIN32)
add_subdirectory(cmd)
endif()
add_subdirectory(cmd)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this whole folder was skipped previously for windows, so I think that's why we're seeing these errors. I have my windows VM running, and I've made a little progress on the configuration errors, so I'll investigate this a little further before giving up and disabling portions on windows

72 changes: 68 additions & 4 deletions src/cmd/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,76 @@
# Collect source files into the "sources" variable and unit test files into the
# "gtest_sources" variable.
ign_get_libsources_and_unittests(sources gtest_sources)

# Skip command line tests for Windows, see
# https://github.com/ignitionrobotics/ign-transport/issues/104
if (MSVC)
list(REMOVE_ITEM gtest_sources ign_TEST.cc)
endif()

# Make a small static lib of command line functions
add_library(ign STATIC ign.cc)
target_link_libraries(ign
${PROJECT_LIBRARY_TARGET_NAME}
)

# Build topic CLI executable
set(topic_executable ign-transport-topic)
add_executable(${topic_executable} topic_main.cc)
target_link_libraries(${topic_executable}
ign
ignition-utils${IGN_UTILS_VER}::cli
${PROJECT_LIBRARY_TARGET_NAME}
)
install(TARGETS ${topic_executable} DESTINATION ${IGN_LIB_INSTALL_DIR}/ignition/${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}/)

# Build service CLI executable
set(service_executable ign-transport-service)
add_executable(${service_executable} service_main.cc)
target_link_libraries(${service_executable}
ign
ignition-utils${IGN_UTILS_VER}::cli
${PROJECT_LIBRARY_TARGET_NAME}
)
install(TARGETS ${service_executable} DESTINATION ${IGN_LIB_INSTALL_DIR}/ignition/${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}/)

# Build the unit tests.
ign_build_tests(TYPE UNIT SOURCES ${gtest_sources}
TEST_LIST test_list
LIB_DEPS ${EXTRA_TEST_LIB_DEPS})

foreach(test ${test_list})
target_link_libraries(${test} ign)

# Inform each test of its output directory so it knows where to call the
# auxiliary files from. Using a generator expression here is useful for
# multi-configuration generators, like Visual Studio.
target_compile_definitions(${test} PRIVATE
"DETAIL_IGN_TRANSPORT_TEST_DIR=\"$<TARGET_FILE_DIR:${test}>\""
"IGN_TEST_LIBRARY_PATH=\"$<TARGET_FILE_DIR:${PROJECT_LIBRARY_TARGET_NAME}>\"")

endforeach()

if (TARGET UNIT_ign_TEST)
set_tests_properties(
UNIT_ign_TEST
PROPERTIES
ENVIRONMENT
"IGN_CONFIG_PATH=${CMAKE_BINARY_DIR}/test/conf/$<CONFIG>"
)
endif()

#===============================================================================
# Generate the ruby script for internal testing.
# Note that the major version of the library is included in the name.
# Ex: cmdtransport0.rb
set(cmd_script_generated_test "${CMAKE_BINARY_DIR}/test/lib/ruby/ignition/cmd${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}.rb")
set(cmd_script_configured_test "${cmd_script_generated_test}.configured")
set(cmd_script_generated_test "${CMAKE_BINARY_DIR}/test/lib/$<CONFIG>/ruby/ignition/cmd${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}.rb")
set(cmd_script_configured_test "${CMAKE_CURRENT_BINARY_DIR}/test_cmd${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}.rb.configured")

# Set the library_location variable to the full path of the library file within
# the build directory.
set(library_location "$<TARGET_FILE:${PROJECT_LIBRARY_TARGET_NAME}>")
set(service_exe_location "$<TARGET_FILE:${service_executable}>")
set(topic_exe_location "$<TARGET_FILE:${topic_executable}>")

configure_file(
"cmd${IGN_DESIGNATION}.rb.in"
Expand All @@ -29,7 +92,8 @@ set(cmd_script_configured "${cmd_script_generated}.configured")

# Set the library_location variable to the relative path to the library file
# within the install directory structure.
set(library_location "../../../${CMAKE_INSTALL_LIBDIR}/$<TARGET_FILE_NAME:${PROJECT_LIBRARY_TARGET_NAME}>")
set(service_exe_location "../../../${CMAKE_INSTALL_LIBDIR}/ignition/${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}/$<TARGET_FILE_NAME:${service_executable}>")
set(topic_exe_location "../../../${CMAKE_INSTALL_LIBDIR}/ignition/${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}/$<TARGET_FILE_NAME:${topic_executable}>")

configure_file(
"cmd${IGN_DESIGNATION}.rb.in"
Expand Down
Loading