Skip to content

Commit

Permalink
Rename CMake project to gz (#233)
Browse files Browse the repository at this point in the history
Co-authored-by: methylDragon <[email protected]>
  • Loading branch information
chapulina and methylDragon authored Jun 26, 2022
1 parent b28c237 commit 13c80b6
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 64 deletions.
40 changes: 20 additions & 20 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
#============================================================================
# Initialize the project
#============================================================================
project(ignition-sensors7 VERSION 7.0.0)
project(gz-sensors7 VERSION 7.0.0)

#============================================================================
# Find ignition-cmake
# Find gz-cmake
#============================================================================
find_package(ignition-cmake3 REQUIRED)
find_package(gz-cmake3 REQUIRED)

#============================================================================
# Configure the project
Expand Down Expand Up @@ -44,47 +44,47 @@ gz_find_package(IgnProtobuf
PRETTY Protobuf)

#--------------------------------------
# Find ignition-math
gz_find_package(ignition-math7 REQUIRED)
set(IGN_MATH_VER ${ignition-math7_VERSION_MAJOR})
# Find gz-math
gz_find_package(gz-math7 REQUIRED)
set(GZ_MATH_VER ${gz-math7_VERSION_MAJOR})

#--------------------------------------
# Find ignition-common
gz_find_package(ignition-common5
# Find gz-common
gz_find_package(gz-common5
COMPONENTS profiler
REQUIRED)
set(IGN_COMMON_VER ${ignition-common5_VERSION_MAJOR})
set(GZ_COMMON_VER ${gz-common5_VERSION_MAJOR})

#--------------------------------------
# Find ignition-transport
gz_find_package(ignition-transport12 REQUIRED)
set(IGN_TRANSPORT_VER ${ignition-transport12_VERSION_MAJOR})
# Find gz-transport
gz_find_package(gz-transport12 REQUIRED)
set(GZ_TRANSPORT_VER ${gz-transport12_VERSION_MAJOR})

#--------------------------------------
# Find ignition-rendering
# Find gz-rendering

# See CMP0072 for more details (cmake --help-policy CMP0072)
if ((NOT ${CMAKE_VERSION} VERSION_LESS 3.11) AND (NOT OpenGL_GL_PREFERENCE))
set(OpenGL_GL_PREFERENCE "GLVND")
endif()

gz_find_package(ignition-rendering7 REQUIRED OPTIONAL_COMPONENTS ogre ogre2)
set(IGN_RENDERING_VER ${ignition-rendering7_VERSION_MAJOR})
gz_find_package(gz-rendering7 REQUIRED OPTIONAL_COMPONENTS ogre ogre2)
set(GZ_RENDERING_VER ${gz-rendering7_VERSION_MAJOR})

if (TARGET ignition-rendering${IGN_RENDERING_VER}::ogre)
if (TARGET gz-rendering${GZ_RENDERING_VER}::ogre)
set(HAVE_OGRE TRUE)
add_definitions(-DWITH_OGRE)
endif()

if (TARGET ignition-rendering${IGN_RENDERING_VER}::ogre2)
if (TARGET gz-rendering${GZ_RENDERING_VER}::ogre2)
set(HAVE_OGRE2 TRUE)
add_definitions(-DWITH_OGRE2)
endif()

#--------------------------------------
# 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 SDFormat
Expand Down
8 changes: 4 additions & 4 deletions doc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
find_package(Doxygen)

set(IGNITION_DOXYGEN_TAGFILES
"\"${IGNITION-MATH_DOXYGEN_TAGFILE} = ${IGNITION-MATH_API_URL}\" \
\"${IGNITION-MSGS_DOXYGEN_TAGFILE} = ${IGNITION-MSGS_API_URL}\" \
\"${IGNITION-TRANSPORT_DOXYGEN_TAGFILE} = ${IGNITION-TRANSPORT_API_URL}\" \
\"${IGNITION-COMMON_DOXYGEN_TAGFILE} = ${IGNITION-COMMON_API_URL}\""
"\"${GZ-MATH_DOXYGEN_TAGFILE} = ${GZ-MATH_API_URL}\" \
\"${GZ-MSGS_DOXYGEN_TAGFILE} = ${GZ-MSGS_API_URL}\" \
\"${GZ-TRANSPORT_DOXYGEN_TAGFILE} = ${GZ-TRANSPORT_API_URL}\" \
\"${GZ-COMMON_DOXYGEN_TAGFILE} = ${GZ-COMMON_API_URL}\""
)

if (DOXYGEN_FOUND)
Expand Down
6 changes: 3 additions & 3 deletions examples/custom_sensor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)

project(odometer)

find_package(ignition-cmake3 REQUIRED)
find_package(ignition-sensors7 REQUIRED)
find_package(gz-cmake3 REQUIRED)
find_package(gz-sensors7 REQUIRED)

add_library(${PROJECT_NAME} SHARED Odometer.cc)
target_link_libraries(${PROJECT_NAME}
PUBLIC ignition-sensors7::ignition-sensors7)
PUBLIC gz-sensors7::gz-sensors7)
6 changes: 3 additions & 3 deletions examples/imu_noise/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
project(ignition-sensors-noise-demo)
project(gz-sensors-noise-demo)

# Find the Gazebo Libraries used directly by the example
find_package(ignition-sensors7 REQUIRED)
find_package(gz-sensors7 REQUIRED)

add_executable(sensor_noise main.cc)
target_link_libraries(sensor_noise PUBLIC ignition-sensors7)
target_link_libraries(sensor_noise PUBLIC gz-sensors7)
6 changes: 3 additions & 3 deletions examples/loop_sensor/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
project(loop_sensor)

find_package(ignition-sensors7 REQUIRED
find_package(gz-sensors7 REQUIRED
# Find built-in sensors
COMPONENTS
altimeter
Expand All @@ -12,10 +12,10 @@ add_subdirectory(../custom_sensor odometer)

add_executable(${PROJECT_NAME} main.cc)
target_link_libraries(${PROJECT_NAME} PUBLIC
ignition-sensors7::ignition-sensors7
gz-sensors7::gz-sensors7

# Link to custom sensors
odometer

# Link to built-in sensors
ignition-sensors7::altimeter)
gz-sensors7::altimeter)
12 changes: 6 additions & 6 deletions examples/save_image/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
project(ignition-sensors-camera-demo)
project(gz-sensors-camera-demo)

# Find the Gazebo Libraries used directly by the example
find_package(ignition-rendering7 REQUIRED OPTIONAL_COMPONENTS ogre ogre2)
find_package(ignition-sensors7 REQUIRED COMPONENTS rendering camera)
find_package(gz-rendering7 REQUIRED OPTIONAL_COMPONENTS ogre ogre2)
find_package(gz-sensors7 REQUIRED COMPONENTS rendering camera)

if (TARGET ignition-rendering7::ogre)
if (TARGET gz-rendering7::ogre)
add_definitions(-DWITH_OGRE)
endif()
if (TARGET ignition-rendering7::ogre2)
if (TARGET gz-rendering7::ogre2)
add_definitions(-DWITH_OGRE2)
endif()

add_executable(save_image main.cc)
target_link_libraries(save_image PUBLIC
ignition-sensors7::camera)
gz-sensors7::camera)
48 changes: 24 additions & 24 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,20 @@ gz_create_core_library(SOURCES ${sources} CXX_STANDARD 14)

target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME}
PUBLIC
ignition-math${IGN_MATH_VER}::ignition-math${IGN_MATH_VER}
ignition-common${IGN_COMMON_VER}::ignition-common${IGN_COMMON_VER}
ignition-transport${IGN_TRANSPORT_VER}::ignition-transport${IGN_TRANSPORT_VER}
gz-math${GZ_MATH_VER}::gz-math${GZ_MATH_VER}
gz-common${GZ_COMMON_VER}::gz-common${GZ_COMMON_VER}
gz-transport${GZ_TRANSPORT_VER}::gz-transport${GZ_TRANSPORT_VER}
sdformat${SDF_VER}::sdformat${SDF_VER}
PRIVATE
ignition-common${IGN_COMMON_VER}::profiler
ignition-msgs${IGN_MSGS_VER}::ignition-msgs${IGN_MSGS_VER}
gz-common${GZ_COMMON_VER}::profiler
gz-msgs${GZ_MSGS_VER}::gz-msgs${GZ_MSGS_VER}
)
target_compile_definitions(${PROJECT_LIBRARY_TARGET_NAME} PUBLIC DepthPoints_EXPORTS)

gz_add_component(rendering SOURCES ${rendering_sources} GET_TARGET_NAME rendering_target)
target_link_libraries(${rendering_target}
PUBLIC
ignition-rendering${IGN_RENDERING_VER}::ignition-rendering${IGN_RENDERING_VER}
gz-rendering${GZ_RENDERING_VER}::gz-rendering${GZ_RENDERING_VER}
)

set(camera_sources CameraSensor.cc)
Expand All @@ -66,8 +66,8 @@ target_link_libraries(${camera_target}
PUBLIC
${rendering_target}
PRIVATE
ignition-msgs${IGN_MSGS_VER}::ignition-msgs${IGN_MSGS_VER}
ignition-transport${IGN_TRANSPORT_VER}::ignition-transport${IGN_TRANSPORT_VER}
gz-msgs${GZ_MSGS_VER}::gz-msgs${GZ_MSGS_VER}
gz-transport${GZ_TRANSPORT_VER}::gz-transport${GZ_TRANSPORT_VER}
)

set(depth_camera_sources DepthCameraSensor.cc)
Expand All @@ -76,8 +76,8 @@ target_compile_definitions(${depth_camera_target} PUBLIC DepthCameraSensor_EXPOR
target_link_libraries(${depth_camera_target}
PRIVATE
${camera_target}
ignition-msgs${IGN_MSGS_VER}::ignition-msgs${IGN_MSGS_VER}
ignition-transport${IGN_TRANSPORT_VER}::ignition-transport${IGN_TRANSPORT_VER}
gz-msgs${GZ_MSGS_VER}::gz-msgs${GZ_MSGS_VER}
gz-transport${GZ_TRANSPORT_VER}::gz-transport${GZ_TRANSPORT_VER}
)

set(lidar_sources Lidar.cc)
Expand All @@ -87,17 +87,17 @@ target_link_libraries(${lidar_target}
PUBLIC
${rendering_target}
PRIVATE
ignition-msgs${IGN_MSGS_VER}::ignition-msgs${IGN_MSGS_VER}
ignition-transport${IGN_TRANSPORT_VER}::ignition-transport${IGN_TRANSPORT_VER}
gz-msgs${GZ_MSGS_VER}::gz-msgs${GZ_MSGS_VER}
gz-transport${GZ_TRANSPORT_VER}::gz-transport${GZ_TRANSPORT_VER}
)

set(gpu_lidar_sources GpuLidarSensor.cc)
gz_add_component(gpu_lidar SOURCES ${gpu_lidar_sources} GET_TARGET_NAME gpu_lidar_target)
target_compile_definitions(${gpu_lidar_target} PUBLIC GpuLidarSensor_EXPORTS)
target_link_libraries(${gpu_lidar_target}
PRIVATE
ignition-msgs${IGN_MSGS_VER}::ignition-msgs${IGN_MSGS_VER}
ignition-transport${IGN_TRANSPORT_VER}::ignition-transport${IGN_TRANSPORT_VER}
gz-msgs${GZ_MSGS_VER}::gz-msgs${GZ_MSGS_VER}
gz-transport${GZ_TRANSPORT_VER}::gz-transport${GZ_TRANSPORT_VER}
${lidar_target}
)

Expand All @@ -106,8 +106,8 @@ gz_add_component(logical_camera SOURCES ${logical_camera_sources} GET_TARGET_NAM
target_compile_definitions(${logical_camera_target} PUBLIC LogicalCameraSensor_EXPORTS)
target_link_libraries(${logical_camera_target}
PRIVATE
ignition-msgs${IGN_MSGS_VER}::ignition-msgs${IGN_MSGS_VER}
ignition-transport${IGN_TRANSPORT_VER}::ignition-transport${IGN_TRANSPORT_VER}
gz-msgs${GZ_MSGS_VER}::gz-msgs${GZ_MSGS_VER}
gz-transport${GZ_TRANSPORT_VER}::gz-transport${GZ_TRANSPORT_VER}
)

set(magnetometer_sources MagnetometerSensor.cc)
Expand All @@ -134,17 +134,17 @@ target_compile_definitions(${rgbd_camera_target} PUBLIC RgbdCameraSensor_EXPORTS
target_link_libraries(${rgbd_camera_target}
PRIVATE
${camera_target}
ignition-msgs${IGN_MSGS_VER}::ignition-msgs${IGN_MSGS_VER}
ignition-transport${IGN_TRANSPORT_VER}::ignition-transport${IGN_TRANSPORT_VER}
gz-msgs${GZ_MSGS_VER}::gz-msgs${GZ_MSGS_VER}
gz-transport${GZ_TRANSPORT_VER}::gz-transport${GZ_TRANSPORT_VER}
)

set(thermal_camera_sources ThermalCameraSensor.cc)
gz_add_component(thermal_camera SOURCES ${thermal_camera_sources} GET_TARGET_NAME thermal_camera_target)
target_link_libraries(${thermal_camera_target}
PRIVATE
${camera_target}
ignition-msgs${IGN_MSGS_VER}::ignition-msgs${IGN_MSGS_VER}
ignition-transport${IGN_TRANSPORT_VER}::ignition-transport${IGN_TRANSPORT_VER}
gz-msgs${GZ_MSGS_VER}::gz-msgs${GZ_MSGS_VER}
gz-transport${GZ_TRANSPORT_VER}::gz-transport${GZ_TRANSPORT_VER}
)

set(segmentation_camera_sources SegmentationCameraSensor.cc)
Expand All @@ -153,17 +153,17 @@ target_compile_definitions(${segmentation_camera_target} PUBLIC SegmentationCame
target_link_libraries(${segmentation_camera_target}
PRIVATE
${camera_target}
ignition-msgs${IGN_MSGS_VER}::ignition-msgs${IGN_MSGS_VER}
ignition-transport${IGN_TRANSPORT_VER}::ignition-transport${IGN_TRANSPORT_VER}
gz-msgs${GZ_MSGS_VER}::gz-msgs${GZ_MSGS_VER}
gz-transport${GZ_TRANSPORT_VER}::gz-transport${GZ_TRANSPORT_VER}
)

set(wide_angle_camera_sources WideAngleCameraSensor.cc)
gz_add_component(wide_angle_camera SOURCES ${wide_angle_camera_sources} GET_TARGET_NAME wide_angle_camera_target)
target_link_libraries(${wide_angle_camera_target}
PRIVATE
${camera_target}
ignition-msgs${IGN_MSGS_VER}::ignition-msgs${IGN_MSGS_VER}
ignition-transport${IGN_TRANSPORT_VER}::ignition-transport${IGN_TRANSPORT_VER}
gz-msgs${GZ_MSGS_VER}::gz-msgs${GZ_MSGS_VER}
gz-transport${GZ_TRANSPORT_VER}::gz-transport${GZ_TRANSPORT_VER}
)

# Build the unit tests.
Expand Down
2 changes: 1 addition & 1 deletion test/integration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ if (DRI_TESTS)
SOURCES
${dri_tests}
LIB_DEPS
${IGNITION-TRANSPORT_LIBRARIES}
${GZ-TRANSPORT_LIBRARIES}
${PROJECT_LIBRARY_TARGET_NAME}-depth_camera
${PROJECT_LIBRARY_TARGET_NAME}-camera
${PROJECT_LIBRARY_TARGET_NAME}-lidar
Expand Down

0 comments on commit 13c80b6

Please sign in to comment.