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

Rename CMake project to gz #320

Merged
merged 3 commits into from
Jun 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
29 changes: 15 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
#============================================================================
# Initialize the project
#============================================================================
project(ignition-transport12 VERSION 12.0.0)
project(gz-transport12 VERSION 12.0.0)

#============================================================================
# Find ignition-cmake
# Find gz-cmake
#============================================================================
# If you get an error at this line, you need to install ignition-cmake
find_package(ignition-cmake3 REQUIRED)
set(IGN_CMAKE_VER ${ignition-cmake3_VERSION_MAJOR})
# If you get an error at this line, you need to install gz-cmake
find_package(gz-cmake3 REQUIRED)
set(GZ_CMAKE_VER ${gz-cmake3_VERSION_MAJOR})

#============================================================================
# Configure the project
Expand All @@ -23,7 +23,7 @@ gz_configure_project(
# Set project-specific options
#============================================================================

# ignition-transport currently has no options that are unique to it
# gz-transport currently has no options that are unique to it

if (UNIX AND NOT APPLE)
set (EXTRA_TEST_LIB_DEPS stdc++fs)
Expand Down Expand Up @@ -77,14 +77,14 @@ else()
endif()

#--------------------------------------
# Find ignition-utils
gz_find_package(ignition-utils2 REQUIRED COMPONENTS cli)
set(IGN_UTILS_VER ${ignition-utils2_VERSION_MAJOR})
# Find gz-utils
gz_find_package(gz-utils2 REQUIRED COMPONENTS cli)
set(GZ_UTILS_VER ${gz-utils2_VERSION_MAJOR})

#--------------------------------------
# Find ignition-msgs
gz_find_package(ignition-msgs9 REQUIRED)
set(IGN_MSGS_VER ${ignition-msgs9_VERSION_MAJOR})
# Find gz-msgs
gz_find_package(gz-msgs9 REQUIRED)
set(GZ_MSGS_VER ${gz-msgs9_VERSION_MAJOR})

#--------------------------------------
# Find ifaddrs
Expand All @@ -96,8 +96,9 @@ else ()
endif()

#--------------------------------------
# Find ignition-tools
gz_find_package(ignition-tools2 QUIET)
# Find gz-tools
gz_find_package(gz-tools2 QUIET)
find_program(HAVE_GZ_TOOLS gz)

#--------------------------------------
# Find SQLite3
Expand Down
56 changes: 28 additions & 28 deletions example/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)

project(ignition-transport-examples)
project(gz-transport-examples)

# Find the Ignition_Transport library
find_package(ignition-transport12 QUIET REQUIRED OPTIONAL_COMPONENTS log)
set(IGN_TRANSPORT_VER ${ignition-transport12_VERSION_MAJOR})
find_package(gz-transport12 QUIET REQUIRED OPTIONAL_COMPONENTS log)
set(GZ_TRANSPORT_VER ${gz-transport12_VERSION_MAJOR})

if (EXISTS "${CMAKE_SOURCE_DIR}/msgs/")
# Message generation. Only required when using custom Protobuf messages.
Expand All @@ -27,96 +27,96 @@ if (EXISTS "${CMAKE_SOURCE_DIR}/bench.cc")
include_directories(SYSTEM ${gflags_INCLUDE_DIRS})
add_executable(bench bench.cc)
target_link_libraries(bench
ignition-transport${IGN_TRANSPORT_VER}::core
gz-transport${GZ_TRANSPORT_VER}::core
${gflags_LIBRARIES}
pthread)
endif()
endif()

if (NOT MSVC AND EXISTS "${CMAKE_SOURCE_DIR}/publisher_c.cc")
add_executable(publisher_c publisher_c.cc)
target_link_libraries(publisher_c ignition-transport${IGN_TRANSPORT_VER}::core)
target_link_libraries(publisher_c gz-transport${GZ_TRANSPORT_VER}::core)
endif()
if (NOT MSVC AND EXISTS "${CMAKE_SOURCE_DIR}/publisher_c_fast.cc")
add_executable(publisher_c_fast publisher_c_fast.cc)
target_link_libraries(publisher_c_fast ignition-transport${IGN_TRANSPORT_VER}::core)
target_link_libraries(publisher_c_fast gz-transport${GZ_TRANSPORT_VER}::core)
endif()

if (EXISTS "${CMAKE_SOURCE_DIR}/subscriber_c.cc")
add_executable(subscriber_c subscriber_c.cc)
target_link_libraries(subscriber_c ignition-transport${IGN_TRANSPORT_VER}::core)
target_link_libraries(subscriber_c gz-transport${GZ_TRANSPORT_VER}::core)
endif()

if (NOT MSVC AND EXISTS "${CMAKE_SOURCE_DIR}/subscriber_c_slow.cc")
add_executable(subscriber_c_slow subscriber_c_slow.cc)
target_link_libraries(subscriber_c_slow ignition-transport${IGN_TRANSPORT_VER}::core)
target_link_libraries(subscriber_c_slow gz-transport${GZ_TRANSPORT_VER}::core)
endif()

if (EXISTS "${CMAKE_SOURCE_DIR}/subscriber_stats.cc")
add_executable(subscriber_stats subscriber_stats.cc)
target_link_libraries(subscriber_stats ignition-transport${IGN_TRANSPORT_VER}::core)
target_link_libraries(subscriber_stats gz-transport${GZ_TRANSPORT_VER}::core)
endif()

if (EXISTS "${CMAKE_SOURCE_DIR}/publisher.cc")
add_executable(publisher publisher.cc)
target_link_libraries(publisher ignition-transport${IGN_TRANSPORT_VER}::core)
target_link_libraries(publisher gz-transport${GZ_TRANSPORT_VER}::core)
endif()

if (EXISTS "${CMAKE_SOURCE_DIR}/subscriber.cc")
add_executable(subscriber subscriber.cc)
target_link_libraries(subscriber ignition-transport${IGN_TRANSPORT_VER}::core)
target_link_libraries(subscriber gz-transport${GZ_TRANSPORT_VER}::core)
endif()

if (EXISTS "${CMAKE_SOURCE_DIR}/subscriber_generic.cc")
add_executable(subscriber_generic subscriber_generic.cc)
target_link_libraries(subscriber_generic
ignition-transport${IGN_TRANSPORT_VER}::core)
gz-transport${GZ_TRANSPORT_VER}::core)
endif()

if (EXISTS "${CMAKE_SOURCE_DIR}/responser.cc")
add_executable(responser responser.cc)
target_link_libraries(responser ignition-transport${IGN_TRANSPORT_VER}::core)
target_link_libraries(responser gz-transport${GZ_TRANSPORT_VER}::core)
endif()

if (EXISTS "${CMAKE_SOURCE_DIR}/requester.cc")
add_executable(requester requester.cc)
target_link_libraries(requester ignition-transport${IGN_TRANSPORT_VER}::core)
target_link_libraries(requester gz-transport${GZ_TRANSPORT_VER}::core)
endif()

if (EXISTS "${CMAKE_SOURCE_DIR}/requester_async.cc")
add_executable(requester_async requester_async.cc)
target_link_libraries(requester_async
ignition-transport${IGN_TRANSPORT_VER}::core)
gz-transport${GZ_TRANSPORT_VER}::core)
endif()

if (EXISTS "${CMAKE_SOURCE_DIR}/responser_oneway.cc")
add_executable(responser_oneway responser_oneway.cc)
target_link_libraries(responser_oneway
ignition-transport${IGN_TRANSPORT_VER}::core)
gz-transport${GZ_TRANSPORT_VER}::core)
endif()

if (EXISTS "${CMAKE_SOURCE_DIR}/requester_oneway.cc")
add_executable(requester_oneway requester_oneway.cc)
target_link_libraries(requester_oneway
ignition-transport${IGN_TRANSPORT_VER}::core)
gz-transport${GZ_TRANSPORT_VER}::core)
endif()

if (EXISTS "${CMAKE_SOURCE_DIR}/responser_no_input.cc")
add_executable(responser_no_input responser_no_input.cc)
target_link_libraries(responser_no_input
ignition-transport${IGN_TRANSPORT_VER}::core)
gz-transport${GZ_TRANSPORT_VER}::core)
endif()

if (EXISTS "${CMAKE_SOURCE_DIR}/requester_no_input.cc")
add_executable(requester_no_input requester_no_input.cc)
target_link_libraries(requester_no_input
ignition-transport${IGN_TRANSPORT_VER}::core)
gz-transport${GZ_TRANSPORT_VER}::core)
endif()

if (EXISTS "${CMAKE_SOURCE_DIR}/requester_async_no_input.cc")
add_executable(requester_async_no_input requester_async_no_input.cc)
target_link_libraries(requester_async_no_input
ignition-transport${IGN_TRANSPORT_VER}::core)
gz-transport${GZ_TRANSPORT_VER}::core)
endif()

# FIXME(chapulina) Linking failure on Windows:
Expand All @@ -125,7 +125,7 @@ if (NOT MSVC AND TARGET protobuf_compilation AND
EXISTS "${CMAKE_SOURCE_DIR}/publisher_custom_msg.cc")
add_executable(publisher_custom_msg publisher_custom_msg.cc)
target_link_libraries(publisher_custom_msg
ignition-transport${IGN_TRANSPORT_VER}::core
gz-transport${GZ_TRANSPORT_VER}::core
${PROTO_SRC}
)
add_dependencies(publisher_custom_msg protobuf_compilation)
Expand All @@ -137,7 +137,7 @@ if (NOT MSVC AND TARGET protobuf_compilation AND
EXISTS "${CMAKE_SOURCE_DIR}/subscriber_custom_msg.cc")
add_executable(subscriber_custom_msg subscriber_custom_msg.cc)
target_link_libraries(subscriber_custom_msg
ignition-transport${IGN_TRANSPORT_VER}::core
gz-transport${GZ_TRANSPORT_VER}::core
${PROTO_SRC}
)
add_dependencies(subscriber_custom_msg protobuf_compilation)
Expand All @@ -146,38 +146,38 @@ endif()
if (EXISTS "${CMAKE_SOURCE_DIR}/publisher_raw.cc")
add_executable(publisher_raw publisher_raw.cc)
target_link_libraries(publisher_raw
ignition-transport${IGN_TRANSPORT_VER}::core
gz-transport${GZ_TRANSPORT_VER}::core
)
endif()

if (EXISTS "${CMAKE_SOURCE_DIR}/subscriber_raw.cc")
add_executable(subscriber_raw subscriber_raw.cc)
target_link_libraries(subscriber_raw
ignition-transport${IGN_TRANSPORT_VER}::core
gz-transport${GZ_TRANSPORT_VER}::core
)
endif()

# Logging examples.
if (TARGET ignition-transport${IGN_TRANSPORT_VER}::log)
if (TARGET gz-transport${GZ_TRANSPORT_VER}::log)

if (EXISTS "${CMAKE_SOURCE_DIR}/record.cc")
add_executable(log_record record.cc)
target_link_libraries(log_record
ignition-transport${IGN_TRANSPORT_VER}::log
gz-transport${GZ_TRANSPORT_VER}::log
)
endif()

if (EXISTS "${CMAKE_SOURCE_DIR}/playback.cc")
add_executable(log_playback playback.cc)
target_link_libraries(log_playback
ignition-transport${IGN_TRANSPORT_VER}::log
gz-transport${GZ_TRANSPORT_VER}::log
)
endif()

if (EXISTS "${CMAKE_SOURCE_DIR}/custom_query.cc")
add_executable(log_custom_query custom_query.cc)
target_link_libraries(log_custom_query
ignition-transport${IGN_TRANSPORT_VER}::log
gz-transport${GZ_TRANSPORT_VER}::log
)
endif()

Expand Down
12 changes: 6 additions & 6 deletions example/configure.bat
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@

@set PROTOBUF_PATH=%cd%\..\..\..\protobuf-2.6.0-win%build_bitness%-vc12
@set IGN_TRANSPORT_PATH=%cd%\..\..\build\install\%build_type%
@set IGNITION-MSGS_PATH=%cd%\..\..\..\ign-msgs\build\install\%build_type%
@set IGNITION-MSGS_CMAKE_PREFIX_PATH=%IGNITION-MSGS_PATH%\CMake
@set IGNITION-MATH_PATH=%cd%\..\..\..\ign-math\build\install\%build_type%
@set IGNITION-MATH_CMAKE_PREFIX_PATH=%IGNITION-MATH_PATH%\CMake
@set GZ-MSGS_PATH=%cd%\..\..\..\ign-msgs\build\install\%build_type%
@set GZ-MSGS_CMAKE_PREFIX_PATH=%GZ-MSGS_PATH%\CMake
@set GZ-MATH_PATH=%cd%\..\..\..\ign-math\build\install\%build_type%
@set GZ-MATH_CMAKE_PREFIX_PATH=%GZ-MATH_PATH%\CMake

cmake -G "NMake Makefiles"^
-DCMAKE_PREFIX_PATH="%IGN_TRANSPORT_PATH%\lib\cmake\ignition-transport12;%IGNITION-MSGS_CMAKE_PREFIX_PATH%;%IGNITION-MATH_CMAKE_PREFIX_PATH%;"^
-DCMAKE_PREFIX_PATH="%IGN_TRANSPORT_PATH%\lib\cmake\ignition-transport12;%GZ-MSGS_CMAKE_PREFIX_PATH%;%GZ-MATH_CMAKE_PREFIX_PATH%;"^
-DPROTOBUF_SRC_ROOT_FOLDER="%PROTOBUF_PATH%"^
-DIGNITION-MSGS_FOLDER="%IGNITION-MSGS_PATH%"^
-DGZ-MSGS_FOLDER="%GZ-MSGS_PATH%"^
-DCMAKE_INSTALL_PREFIX="install"^
-DCMAKE_BUILD_TYPE=%build_type%^
..
Expand Down
2 changes: 1 addition & 1 deletion log/test/integration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ foreach(source_file ${aux})
endforeach()

# gz log CLI test
if (IGNITION-TOOLS_BINARY_DIRS)
if (HAVE_GZ_TOOLS)
set(GZ_CONFIG_PATH "${CMAKE_BINARY_DIR}/log/test/lib/ruby/gz")

add_test(gz_log_record_no_overwrite
Expand Down
4 changes: 2 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ gz_create_core_library(SOURCES ${sources} CXX_STANDARD 17)
# Link the libraries that we always need.
target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME}
PUBLIC
ignition-utils${IGN_UTILS_VER}::ignition-utils${IGN_UTILS_VER}
ignition-msgs${IGN_MSGS_VER}::ignition-msgs${IGN_MSGS_VER}
gz-utils${GZ_UTILS_VER}::gz-utils${GZ_UTILS_VER}
gz-msgs${GZ_MSGS_VER}::gz-msgs${GZ_MSGS_VER}
CPPZMQ::CPPZMQ
PRIVATE
${ZeroMQ_TARGET}
Expand Down
4 changes: 2 additions & 2 deletions src/cmd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ set(topic_executable ign-transport-topic)
add_executable(${topic_executable} topic_main.cc)
target_link_libraries(${topic_executable}
gz
ignition-utils${IGN_UTILS_VER}::cli
gz-utils${GZ_UTILS_VER}::cli
${PROJECT_LIBRARY_TARGET_NAME}
)
install(TARGETS ${topic_executable} DESTINATION ${IGN_LIB_INSTALL_DIR}/ignition/${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}/)
Expand All @@ -29,7 +29,7 @@ set(service_executable ign-transport-service)
add_executable(${service_executable} service_main.cc)
target_link_libraries(${service_executable}
gz
ignition-utils${IGN_UTILS_VER}::cli
gz-utils${GZ_UTILS_VER}::cli
${PROJECT_LIBRARY_TARGET_NAME}
)
install(TARGETS ${service_executable} DESTINATION ${IGN_LIB_INSTALL_DIR}/ignition/${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}/)
Expand Down
Loading