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

[ign -> gz] CMake functions #1542

Merged
merged 2 commits into from
Jun 18, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
38 changes: 19 additions & 19 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ find_package(ignition-cmake3 REQUIRED)
#============================================================================
# Configure the project
#============================================================================
ign_configure_project(
gz_configure_project(
REPLACE_IGNITION_INCLUDE_PATH gz/sim
VERSION_SUFFIX pre1)
set (CMAKE_CXX_STANDARD 17)
Expand Down Expand Up @@ -61,28 +61,28 @@ set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
# as protobuf could be find transitively by any dependency
set(protobuf_MODULE_COMPATIBLE TRUE)

ign_find_package(sdformat13 REQUIRED)
gz_find_package(sdformat13 REQUIRED)
set(SDF_VER ${sdformat13_VERSION_MAJOR})

#--------------------------------------
# Find ignition-plugin
ign_find_package(ignition-plugin2 REQUIRED COMPONENTS loader register)
gz_find_package(ignition-plugin2 REQUIRED COMPONENTS loader register)
set(IGN_PLUGIN_VER ${ignition-plugin2_VERSION_MAJOR})

#--------------------------------------
# Find ignition-transport
ign_find_package(ignition-transport12 REQUIRED COMPONENTS log)
gz_find_package(ignition-transport12 REQUIRED COMPONENTS log)
set(IGN_TRANSPORT_VER ${ignition-transport12_VERSION_MAJOR})

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

#--------------------------------------
# Find ignition-common
# Always use the profiler component to get the headers, regardless of status.
ign_find_package(ignition-common5
gz_find_package(ignition-common5
COMPONENTS
profiler
events
Expand All @@ -93,14 +93,14 @@ set(IGN_COMMON_VER ${ignition-common5_VERSION_MAJOR})

#--------------------------------------
# Find ignition-fuel_tools
ign_find_package(ignition-fuel_tools8 REQUIRED)
gz_find_package(ignition-fuel_tools8 REQUIRED)
set(IGN_FUEL_TOOLS_VER ${ignition-fuel_tools8_VERSION_MAJOR})

#--------------------------------------
# Find ignition-gui
ign_find_package(ignition-gui7 REQUIRED)
gz_find_package(ignition-gui7 REQUIRED)
set(IGN_GUI_VER ${ignition-gui7_VERSION_MAJOR})
ign_find_package (Qt5
gz_find_package (Qt5
COMPONENTS
Core
Quick
Expand All @@ -110,7 +110,7 @@ ign_find_package (Qt5

#--------------------------------------
# Find ignition-physics
ign_find_package(ignition-physics6
gz_find_package(ignition-physics6
COMPONENTS
heightmap
mesh
Expand All @@ -121,7 +121,7 @@ set(IGN_PHYSICS_VER ${ignition-physics6_VERSION_MAJOR})

#--------------------------------------
# Find ignition-sensors
ign_find_package(ignition-sensors7 REQUIRED
gz_find_package(ignition-sensors7 REQUIRED
# component order is important
COMPONENTS
# non-rendering
Expand Down Expand Up @@ -150,29 +150,29 @@ set(IGN_SENSORS_VER ${ignition-sensors7_VERSION_MAJOR})

#--------------------------------------
# Find ignition-rendering
ign_find_package(ignition-rendering7 REQUIRED)
gz_find_package(ignition-rendering7 REQUIRED)
set(IGN_RENDERING_VER ${ignition-rendering7_VERSION_MAJOR})

#--------------------------------------
# Find ignition-math
ign_find_package(ignition-math7 REQUIRED COMPONENTS eigen3)
gz_find_package(ignition-math7 REQUIRED COMPONENTS eigen3)
set(IGN_MATH_VER ${ignition-math7_VERSION_MAJOR})

#--------------------------------------
# Find ignition-tools
ign_find_package(ignition-tools2
gz_find_package(ignition-tools2
REQUIRED
PKGCONFIG "ignition-tools2")

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

#--------------------------------------
# Find protobuf
set(REQ_PROTOBUF_VER 3)
ign_find_package(IgnProtobuf
gz_find_package(IgnProtobuf
VERSION ${REQ_PROTOBUF_VER}
REQUIRED
COMPONENTS all
Expand Down Expand Up @@ -211,14 +211,14 @@ set(GZ_SIM_GUI_PLUGIN_INSTALL_DIR
#============================================================================
# Configure the build
#============================================================================
ign_configure_build(QUIT_IF_BUILD_ERRORS)
gz_configure_build(QUIT_IF_BUILD_ERRORS)

add_subdirectory(examples)

#============================================================================
# Create package information
#============================================================================
ign_create_packages()
gz_create_packages()

if (${pybind11_FOUND})
add_subdirectory(python)
Expand All @@ -235,7 +235,7 @@ configure_file(${CMAKE_SOURCE_DIR}/tools/desktop/gz-logo.svg.in ${CMAKE_BINARY_D
# there is an unreleased fix; revert this when 1.9.1 is released
# https://github.com/gazebosim/gz-sim/issues/520
if (NOT APPLE)
ign_create_docs(
gz_create_docs(
API_MAINPAGE_MD "${CMAKE_BINARY_DIR}/api.md"
TUTORIALS_MAINPAGE_MD "${CMAKE_BINARY_DIR}/tutorials.md"
ADDITIONAL_INPUT_DIRS "${CMAKE_SOURCE_DIR}/src/systems ${CMAKE_SOURCE_DIR}/src/gui/plugins"
Expand Down
4 changes: 2 additions & 2 deletions examples/plugin/custom_sensor_system/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ find_package(ignition-cmake3 REQUIRED)

project(OdometerSystem)

ign_find_package(ignition-plugin2 REQUIRED COMPONENTS register)
gz_find_package(ignition-plugin2 REQUIRED COMPONENTS register)
set(IGN_PLUGIN_VER ${ignition-plugin2_VERSION_MAJOR})

ign_find_package(ignition-gazebo7 REQUIRED)
gz_find_package(ignition-gazebo7 REQUIRED)
set(IGN_GAZEBO_VER ${ignition-gazebo7_VERSION_MAJOR})

find_package(ignition-sensors7 REQUIRED)
Expand Down
4 changes: 2 additions & 2 deletions examples/plugin/hello_world/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ find_package(ignition-cmake3 REQUIRED)

project(Hello_world)

ign_find_package(ignition-plugin2 REQUIRED COMPONENTS register)
gz_find_package(ignition-plugin2 REQUIRED COMPONENTS register)
set(IGN_PLUGIN_VER ${ignition-plugin2_VERSION_MAJOR})

ign_find_package(ignition-gazebo7 REQUIRED)
gz_find_package(ignition-gazebo7 REQUIRED)
set(IGN_GAZEBO_VER ${ignition-gazebo7_VERSION_MAJOR})

add_library(HelloWorld SHARED HelloWorld)
Expand Down
2 changes: 1 addition & 1 deletion include/gz/sim/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ign_install_all_headers()
gz_install_all_headers()

add_subdirectory(components)

Expand Down
6 changes: 3 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ set(gui_sources
PARENT_SCOPE
)

ign_add_component(gz
gz_add_component(gz
SOURCES
ign.cc
cmd/ModelCommandAPI.cc
Expand Down Expand Up @@ -137,7 +137,7 @@ if (MSVC)
endif()

# Create the library target
ign_create_core_library(SOURCES ${sources} CXX_STANDARD 17)
gz_create_core_library(SOURCES ${sources} CXX_STANDARD 17)
target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME}
PUBLIC
ignition-math${IGN_MATH_VER}
Expand Down Expand Up @@ -173,7 +173,7 @@ set(GZ_SIM_PLUGIN_INSTALL_DIR
include_directories(${PROJECT_SOURCE_DIR}/test)

# Build the unit tests
ign_build_tests(TYPE UNIT
gz_build_tests(TYPE UNIT
SOURCES
${gtest_sources}
LIB_DEPS
Expand Down
8 changes: 4 additions & 4 deletions src/cmd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ file(GENERATE
# Install the ruby command line library in an unversioned location.
install(FILES ${cmd_script_generated} DESTINATION lib/ruby/ignition)

set(ign_library_path "${CMAKE_INSTALL_PREFIX}/lib/ruby/ignition/cmd${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}")
set(gz_library_path "${CMAKE_INSTALL_PREFIX}/lib/ruby/ignition/cmd${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}")

# Generate a configuration file.
# Note that the major version of the library is included in the name.
Expand Down Expand Up @@ -54,7 +54,7 @@ file(GENERATE
install(FILES ${cmd_model_script_generated} DESTINATION lib/ruby/ignition)

# Used for the installed version.
set(ign_model_ruby_path "${CMAKE_INSTALL_PREFIX}/lib/ruby/ignition/cmdmodel${PROJECT_VERSION_MAJOR}")
set(gz_model_ruby_path "${CMAKE_INSTALL_PREFIX}/lib/ruby/ignition/cmdmodel${PROJECT_VERSION_MAJOR}")

set(model_configured "${CMAKE_CURRENT_BINARY_DIR}/model${PROJECT_VERSION_MAJOR}.yaml")
configure_file(
Expand Down Expand Up @@ -85,7 +85,7 @@ file(GENERATE
INPUT "${cmd_script_configured_test}")

# Used only for internal testing.
set(ign_library_path
set(gz_library_path
"${CMAKE_BINARY_DIR}/test/lib/ruby/ignition/cmd${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}")

# Generate a configuration file for internal testing.
Expand All @@ -112,7 +112,7 @@ file(GENERATE
INPUT "${cmd_model_script_configured_test}")

# Used for internal testing.
set(ign_model_ruby_path "${cmd_model_script_generated_test}")
set(gz_model_ruby_path "${cmd_model_script_generated_test}")

configure_file(
"model.yaml.in"
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/gazebo.yaml.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
format: 1.0.0
library_name: ignition-gazebo-ign
library_version: @PROJECT_VERSION_FULL@
library_path: @ign_library_path@
library_path: @gz_library_path@
commands:
- gazebo : Run and manage Gazebo.
---
2 changes: 1 addition & 1 deletion src/cmd/model.yaml.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
format: 1.0.0
library_name: ignition-gazebo-ign
library_version: @PROJECT_VERSION_FULL@
library_path: @ign_model_ruby_path@
library_path: @gz_model_ruby_path@
commands:
- model : Print information about models.
---
4 changes: 2 additions & 2 deletions src/gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ if (MSVC)
COMPILE_FLAGS "/wd4251 /wd4146")
endif()

ign_add_component(gui
gz_add_component(gui
SOURCES ${gui_sources} resources/gazebo.qrc
GET_TARGET_NAME gui_target
CXX_STANDARD 17)
Expand All @@ -65,7 +65,7 @@ install (FILES playback_gui.config DESTINATION ${IGN_DATA_INSTALL_DIR}/gui)
# Tests
include_directories(${PROJECT_SOURCE_DIR}/test)

ign_build_tests(TYPE UNIT
gz_build_tests(TYPE UNIT
SOURCES
${gtest_sources}
LIB_DEPS
Expand Down
2 changes: 1 addition & 1 deletion src/gui/plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function(gz_add_gui_plugin plugin_name)
# Plugin symbols failing to resolve on Windows:
# error LNK2001: unresolved external symbol
if(NOT WIN32)
ign_build_tests(TYPE UNIT
gz_build_tests(TYPE UNIT
SOURCES
${gz_add_gui_plugin_TEST_SOURCES}
LIB_DEPS
Expand Down
2 changes: 1 addition & 1 deletion src/rendering/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if (MSVC)
COMPILE_FLAGS "/wd4251 /wd4146")
endif()

ign_add_component(rendering
gz_add_component(rendering
SOURCES ${rendering_comp_sources}
GET_TARGET_NAME rendering_target
CXX_STANDARD 17)
Expand Down
4 changes: 2 additions & 2 deletions src/systems/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function(gz_add_system system_name)
endif()


ign_add_component(${system_name}
gz_add_component(${system_name}
SOURCES ${sources}
GET_TARGET_NAME system_target
CXX_STANDARD 17)
Expand Down Expand Up @@ -75,7 +75,7 @@ function(gz_add_system system_name)
# Note that plugins are currently being installed in 2 places. /lib and the plugin dir
install(TARGETS ${system_target} DESTINATION ${GZ_SIM_PLUGIN_INSTALL_DIR})

# The library created by `ign_add_component` includes the ign-gazebo version
# The library created by `gz_add_component` includes the ign-gazebo version
# (i.e. libignition-gazebo1-name-system.so), but for portability of SDF
# files, we also install an unversioned symlink into the same versioned folder.
set(versioned ${CMAKE_SHARED_LIBRARY_PREFIX}${system_target}${CMAKE_SHARED_LIBRARY_SUFFIX})
Expand Down
2 changes: 1 addition & 1 deletion src/systems/logical_audio_sensor_plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ set (gtest_sources
LogicalAudio_TEST.cc
)

ign_build_tests(TYPE UNIT
gz_build_tests(TYPE UNIT
SOURCES
${gtest_sources}
LIB_DEPS
Expand Down
2 changes: 1 addition & 1 deletion src/systems/physics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ set (gtest_sources
EntityFeatureMap_TEST.cc
)

ign_build_tests(TYPE UNIT
gz_build_tests(TYPE UNIT
SOURCES
${gtest_sources}
LIB_DEPS
Expand Down
2 changes: 1 addition & 1 deletion test/benchmark/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ if (GzBenchmark_FOUND OR IgnBenchmark_FOUND)
ecm_serialize.cc
)

ign_add_benchmarks(SOURCES ${tests})
gz_add_benchmarks(SOURCES ${tests})
endif()
4 changes: 2 additions & 2 deletions test/integration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ endif()
link_directories(${PROJECT_BINARY_DIR}/test)
include_directories(${PROJECT_SOURCE_DIR}/test)

ign_build_tests(TYPE INTEGRATION
gz_build_tests(TYPE INTEGRATION
SOURCES
${tests}
LIB_DEPS
Expand All @@ -134,7 +134,7 @@ cmake_policy(PUSH)
if (POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
endif()
ign_find_package(DART CONFIG)
gz_find_package(DART CONFIG)
cmake_policy(POP)
if (DART_FOUND)
# Only adding include directories, no need to link against DART to check version
Expand Down
2 changes: 1 addition & 1 deletion test/performance/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set(tests

link_directories(${PROJECT_BINARY_DIR}/test)

ign_build_tests(TYPE PERFORMANCE
gz_build_tests(TYPE PERFORMANCE
SOURCES
${tests}
LIB_DEPS
Expand Down
2 changes: 1 addition & 1 deletion test/regression/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set(tests

link_directories(${PROJECT_BINARY_DIR}/test)

ign_build_tests(TYPE REGRESSION
gz_build_tests(TYPE REGRESSION
SOURCES
${tests}
LIB_DEPS
Expand Down