From 01a0753ad31f43815131ca638705ca42fee2c494 Mon Sep 17 00:00:00 2001 From: methylDragon Date: Fri, 6 May 2022 15:16:05 -0700 Subject: [PATCH] Migrate CMake files (#395) Signed-off-by: methylDragon --- CMakeLists.txt | 4 +- doc/CMakeLists.txt | 2 +- include/CMakeLists.txt | 3 +- src/plugins/CMakeLists.txt | 40 +++++++++---------- src/plugins/camera_tracking/CMakeLists.txt | 2 +- src/plugins/grid_config/CMakeLists.txt | 2 +- src/plugins/image_display/CMakeLists.txt | 2 +- .../interactive_view_control/CMakeLists.txt | 2 +- src/plugins/key_publisher/CMakeLists.txt | 2 +- src/plugins/marker_manager/CMakeLists.txt | 2 +- src/plugins/minimal_scene/CMakeLists.txt | 2 +- src/plugins/navsat_map/CMakeLists.txt | 2 +- src/plugins/plotting/CMakeLists.txt | 2 +- src/plugins/point_cloud/CMakeLists.txt | 2 +- src/plugins/publisher/CMakeLists.txt | 2 +- src/plugins/scene3d/CMakeLists.txt | 2 +- src/plugins/screenshot/CMakeLists.txt | 2 +- src/plugins/shutdown_button/CMakeLists.txt | 2 +- src/plugins/tape_measure/CMakeLists.txt | 2 +- src/plugins/teleop/CMakeLists.txt | 2 +- src/plugins/topic_echo/CMakeLists.txt | 2 +- src/plugins/topic_viewer/CMakeLists.txt | 2 +- .../transport_scene_manager/CMakeLists.txt | 2 +- src/plugins/world_control/CMakeLists.txt | 4 +- src/plugins/world_stats/CMakeLists.txt | 2 +- 25 files changed, 47 insertions(+), 46 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fbda7e553..aa5637b1a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,9 @@ find_package(ignition-cmake3 REQUIRED) #============================================================================ # Configure the project #============================================================================ -ign_configure_project(VERSION_SUFFIX pre1) +ign_configure_project( + REPLACE_IGNITION_INCLUDE_PATH gz/gui + VERSION_SUFFIX pre1) #============================================================================ # Set project-specific options diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 4e8d4520b..344dc638a 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -25,5 +25,5 @@ if (DOXYGEN_FOUND) COMMENT "Generating API documentation with Doxygen" VERBATIM) install(FILES ${CMAKE_BINARY_DIR}/doc/${PROJECT_NAME_LOWER}.tag.xml - DESTINATION ${CMAKE_INSTALL_PREFIX}/share/ignition/${PROJECT_NAME_LOWER}_${PROJECT_VERSION_MINOR}) + DESTINATION ${CMAKE_INSTALL_PREFIX}/share/gz/${PROJECT_NAME_LOWER}_${PROJECT_VERSION_MINOR}) endif() diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index 25ec89762..4b2bdd7bb 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -1 +1,2 @@ -add_subdirectory(ignition) +add_subdirectory(gz) +install(DIRECTORY ignition DESTINATION ${IGN_INCLUDE_INSTALL_DIR_FULL}) diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt index c32824ad9..d6a9efb7e 100644 --- a/src/plugins/CMakeLists.txt +++ b/src/plugins/CMakeLists.txt @@ -1,5 +1,5 @@ ################################################# -# ign_gui_add_library ( +# gz_gui_add_library ( # SOURCES # [PUBLIC_LINK_LIBS ] # [PRIVATE_LINK_LIBS ]) @@ -16,18 +16,17 @@ # # [PRIVATE_LINK_LIBS]: Specify a list of libraries to be privately linked. # -function(ign_gui_add_library library_name) +function(gz_gui_add_library library_name) set(options) set(oneValueArgs) set(multiValueArgs SOURCES QT_HEADERS PUBLIC_LINK_LIBS PRIVATE_LINK_LIBS) + cmake_parse_arguments(gz_gui_add_library "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) - cmake_parse_arguments(ign_gui_add_library "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) - - QT5_WRAP_CPP(${library_name}_headers_MOC ${ign_gui_add_library_QT_HEADERS}) + QT5_WRAP_CPP(${library_name}_headers_MOC ${gz_gui_add_library_QT_HEADERS}) QT5_ADD_RESOURCES(${library_name}_RCC ${library_name}.qrc) add_library(${library_name} SHARED - ${ign_gui_add_library_SOURCES} + ${gz_gui_add_library_SOURCES} ${${library_name}_headers_MOC} ${${library_name}_RCC} ) @@ -35,14 +34,14 @@ function(ign_gui_add_library library_name) PUBLIC ${PROJECT_LIBRARY_TARGET_NAME} TINYXML2::TINYXML2 - ${ign_gui_add_library_PUBLIC_LINK_LIBS} + ${gz_gui_add_library_PUBLIC_LINK_LIBS} PRIVATE - ${ign_gui_add_library_PRIVATE_LINK_LIBS} + ${gz_gui_add_library_PRIVATE_LINK_LIBS} ) endfunction() ################################################# -# ign_gui_add_plugin( +# gz_gui_add_plugin( # SOURCES # [PUBLIC_LINK_LIBS ] # [PRIVATE_LINK_LIBS ]) @@ -61,7 +60,7 @@ endfunction() # # [PRIVATE_LINK_LIBS]: Specify a list of libraries to be privately linked. # -function(ign_gui_add_plugin plugin_name) +function(gz_gui_add_plugin plugin_name) set(options) set(oneValueArgs) set(multiValueArgs @@ -71,20 +70,19 @@ function(ign_gui_add_plugin plugin_name) PUBLIC_LINK_LIBS PRIVATE_LINK_LIBS ) + cmake_parse_arguments(gz_gui_add_plugin "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) - cmake_parse_arguments(ign_gui_add_plugin "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) - - ign_gui_add_library(${plugin_name} - SOURCES ${ign_gui_add_plugin_SOURCES} - QT_HEADERS ${ign_gui_add_plugin_QT_HEADERS} - PUBLIC_LINK_LIBS ${ign_gui_add_plugin_PUBLIC_LINK_LIBS} - PRIVATE_LINK_LIBS ${ign_gui_add_plugin_PRIVATE_LINK_LIBS} ignition-plugin${IGN_PLUGIN_VER}::register + gz_gui_add_library(${plugin_name} + SOURCES ${gz_gui_add_plugin_SOURCES} + QT_HEADERS ${gz_gui_add_plugin_QT_HEADERS} + PUBLIC_LINK_LIBS ${gz_gui_add_plugin_PUBLIC_LINK_LIBS} + PRIVATE_LINK_LIBS ${gz_gui_add_plugin_PRIVATE_LINK_LIBS} ignition-plugin${IGN_PLUGIN_VER}::register ) - if(ign_gui_add_plugin_TEST_SOURCES) + if(gz_gui_add_plugin_TEST_SOURCES) ign_build_tests(TYPE UNIT SOURCES - ${ign_gui_add_plugin_TEST_SOURCES} + ${gz_gui_add_plugin_TEST_SOURCES} LIB_DEPS ${IGNITION-GUI_LIBRARIES} TINYXML2::TINYXML2 @@ -105,8 +103,8 @@ function(ign_gui_add_plugin plugin_name) # warning is not important since those members do not need to be interfaced # with. set_source_files_properties( - ${ign_gui_add_plugin_SOURCES} - ${ign_gui_add_plugin_TEST_SOURCES} + ${gz_gui_add_plugin_SOURCES} + ${gz_gui_add_plugin_TEST_SOURCES} COMPILE_FLAGS "/wd4251") endif() diff --git a/src/plugins/camera_tracking/CMakeLists.txt b/src/plugins/camera_tracking/CMakeLists.txt index f235b22f3..9a5239f10 100644 --- a/src/plugins/camera_tracking/CMakeLists.txt +++ b/src/plugins/camera_tracking/CMakeLists.txt @@ -1,4 +1,4 @@ -ign_gui_add_plugin(CameraTracking +gz_gui_add_plugin(CameraTracking SOURCES CameraTracking.cc QT_HEADERS diff --git a/src/plugins/grid_config/CMakeLists.txt b/src/plugins/grid_config/CMakeLists.txt index a17616363..99f52d057 100644 --- a/src/plugins/grid_config/CMakeLists.txt +++ b/src/plugins/grid_config/CMakeLists.txt @@ -1,4 +1,4 @@ -ign_gui_add_plugin(GridConfig +gz_gui_add_plugin(GridConfig SOURCES GridConfig.cc QT_HEADERS diff --git a/src/plugins/image_display/CMakeLists.txt b/src/plugins/image_display/CMakeLists.txt index 85da0c34a..c7cb5df6f 100644 --- a/src/plugins/image_display/CMakeLists.txt +++ b/src/plugins/image_display/CMakeLists.txt @@ -1,4 +1,4 @@ -ign_gui_add_plugin(ImageDisplay +gz_gui_add_plugin(ImageDisplay SOURCES ImageDisplay.cc QT_HEADERS diff --git a/src/plugins/interactive_view_control/CMakeLists.txt b/src/plugins/interactive_view_control/CMakeLists.txt index c1dd0ba76..e9aae7cd9 100644 --- a/src/plugins/interactive_view_control/CMakeLists.txt +++ b/src/plugins/interactive_view_control/CMakeLists.txt @@ -1,4 +1,4 @@ -ign_gui_add_plugin(InteractiveViewControl +gz_gui_add_plugin(InteractiveViewControl SOURCES InteractiveViewControl.cc QT_HEADERS diff --git a/src/plugins/key_publisher/CMakeLists.txt b/src/plugins/key_publisher/CMakeLists.txt index b4b77d4d1..c737d680f 100644 --- a/src/plugins/key_publisher/CMakeLists.txt +++ b/src/plugins/key_publisher/CMakeLists.txt @@ -1,4 +1,4 @@ -ign_gui_add_plugin(KeyPublisher +gz_gui_add_plugin(KeyPublisher SOURCES KeyPublisher.cc QT_HEADERS diff --git a/src/plugins/marker_manager/CMakeLists.txt b/src/plugins/marker_manager/CMakeLists.txt index 42713a762..eddb7a621 100644 --- a/src/plugins/marker_manager/CMakeLists.txt +++ b/src/plugins/marker_manager/CMakeLists.txt @@ -1,4 +1,4 @@ -ign_gui_add_plugin(MarkerManager +gz_gui_add_plugin(MarkerManager SOURCES MarkerManager.cc QT_HEADERS diff --git a/src/plugins/minimal_scene/CMakeLists.txt b/src/plugins/minimal_scene/CMakeLists.txt index a5ac7cd4b..4d938d58e 100644 --- a/src/plugins/minimal_scene/CMakeLists.txt +++ b/src/plugins/minimal_scene/CMakeLists.txt @@ -19,7 +19,7 @@ if (APPLE) ) endif() -ign_gui_add_plugin(MinimalScene +gz_gui_add_plugin(MinimalScene SOURCES ${SOURCES} QT_HEADERS diff --git a/src/plugins/navsat_map/CMakeLists.txt b/src/plugins/navsat_map/CMakeLists.txt index 4738f999d..887601742 100644 --- a/src/plugins/navsat_map/CMakeLists.txt +++ b/src/plugins/navsat_map/CMakeLists.txt @@ -1,4 +1,4 @@ -ign_gui_add_plugin(NavSatMap +gz_gui_add_plugin(NavSatMap SOURCES NavSatMap.cc QT_HEADERS diff --git a/src/plugins/plotting/CMakeLists.txt b/src/plugins/plotting/CMakeLists.txt index 74469b587..91c66ee89 100644 --- a/src/plugins/plotting/CMakeLists.txt +++ b/src/plugins/plotting/CMakeLists.txt @@ -1,4 +1,4 @@ -ign_gui_add_plugin(TransportPlotting +gz_gui_add_plugin(TransportPlotting SOURCES TransportPlotting.cc QT_HEADERS diff --git a/src/plugins/point_cloud/CMakeLists.txt b/src/plugins/point_cloud/CMakeLists.txt index 0f9f2119a..a21f23dc1 100644 --- a/src/plugins/point_cloud/CMakeLists.txt +++ b/src/plugins/point_cloud/CMakeLists.txt @@ -1,4 +1,4 @@ -ign_gui_add_plugin(PointCloud +gz_gui_add_plugin(PointCloud SOURCES PointCloud.cc QT_HEADERS diff --git a/src/plugins/publisher/CMakeLists.txt b/src/plugins/publisher/CMakeLists.txt index be3d01892..b1c9df011 100644 --- a/src/plugins/publisher/CMakeLists.txt +++ b/src/plugins/publisher/CMakeLists.txt @@ -1,4 +1,4 @@ -ign_gui_add_plugin(Publisher +gz_gui_add_plugin(Publisher SOURCES Publisher.cc QT_HEADERS diff --git a/src/plugins/scene3d/CMakeLists.txt b/src/plugins/scene3d/CMakeLists.txt index 5679bfcf7..e15ba04a2 100644 --- a/src/plugins/scene3d/CMakeLists.txt +++ b/src/plugins/scene3d/CMakeLists.txt @@ -1,4 +1,4 @@ -ign_gui_add_plugin(Scene3D +gz_gui_add_plugin(Scene3D SOURCES Scene3D.cc QT_HEADERS diff --git a/src/plugins/screenshot/CMakeLists.txt b/src/plugins/screenshot/CMakeLists.txt index 9c536da26..0e1c731dd 100644 --- a/src/plugins/screenshot/CMakeLists.txt +++ b/src/plugins/screenshot/CMakeLists.txt @@ -1,4 +1,4 @@ -ign_gui_add_plugin(Screenshot +gz_gui_add_plugin(Screenshot SOURCES Screenshot.cc QT_HEADERS diff --git a/src/plugins/shutdown_button/CMakeLists.txt b/src/plugins/shutdown_button/CMakeLists.txt index 5aae18144..e4fc601c8 100644 --- a/src/plugins/shutdown_button/CMakeLists.txt +++ b/src/plugins/shutdown_button/CMakeLists.txt @@ -1,4 +1,4 @@ -ign_gui_add_plugin(ShutdownButton +gz_gui_add_plugin(ShutdownButton SOURCES ShutdownButton.cc QT_HEADERS diff --git a/src/plugins/tape_measure/CMakeLists.txt b/src/plugins/tape_measure/CMakeLists.txt index bffb62b10..fdc875adb 100644 --- a/src/plugins/tape_measure/CMakeLists.txt +++ b/src/plugins/tape_measure/CMakeLists.txt @@ -1,4 +1,4 @@ -ign_gui_add_plugin(TapeMeasure +gz_gui_add_plugin(TapeMeasure SOURCES TapeMeasure.cc QT_HEADERS TapeMeasure.hh PRIVATE_LINK_LIBS diff --git a/src/plugins/teleop/CMakeLists.txt b/src/plugins/teleop/CMakeLists.txt index a8ebc5bcc..775fbbf99 100644 --- a/src/plugins/teleop/CMakeLists.txt +++ b/src/plugins/teleop/CMakeLists.txt @@ -1,4 +1,4 @@ -ign_gui_add_plugin(Teleop +gz_gui_add_plugin(Teleop SOURCES Teleop.cc QT_HEADERS diff --git a/src/plugins/topic_echo/CMakeLists.txt b/src/plugins/topic_echo/CMakeLists.txt index 2073e501a..6e0d2ca69 100644 --- a/src/plugins/topic_echo/CMakeLists.txt +++ b/src/plugins/topic_echo/CMakeLists.txt @@ -1,4 +1,4 @@ -ign_gui_add_plugin(TopicEcho +gz_gui_add_plugin(TopicEcho SOURCES TopicEcho.cc QT_HEADERS diff --git a/src/plugins/topic_viewer/CMakeLists.txt b/src/plugins/topic_viewer/CMakeLists.txt index 60318d9db..bdb5e564a 100644 --- a/src/plugins/topic_viewer/CMakeLists.txt +++ b/src/plugins/topic_viewer/CMakeLists.txt @@ -1,4 +1,4 @@ -ign_gui_add_plugin(TopicViewer +gz_gui_add_plugin(TopicViewer SOURCES TopicViewer.cc QT_HEADERS diff --git a/src/plugins/transport_scene_manager/CMakeLists.txt b/src/plugins/transport_scene_manager/CMakeLists.txt index 46aa1af1e..b16ae4005 100644 --- a/src/plugins/transport_scene_manager/CMakeLists.txt +++ b/src/plugins/transport_scene_manager/CMakeLists.txt @@ -1,4 +1,4 @@ -ign_gui_add_plugin(TransportSceneManager +gz_gui_add_plugin(TransportSceneManager SOURCES TransportSceneManager.cc QT_HEADERS diff --git a/src/plugins/world_control/CMakeLists.txt b/src/plugins/world_control/CMakeLists.txt index 036f2ea61..5d64eae5d 100644 --- a/src/plugins/world_control/CMakeLists.txt +++ b/src/plugins/world_control/CMakeLists.txt @@ -1,5 +1,5 @@ if (NOT MSVC) - ign_gui_add_plugin(WorldControl + gz_gui_add_plugin(WorldControl SOURCES WorldControl.cc WorldControlEventListener.cc @@ -10,7 +10,7 @@ if (NOT MSVC) WorldControl_TEST.cc ) else() - ign_gui_add_plugin(WorldControl + gz_gui_add_plugin(WorldControl SOURCES WorldControl.cc QT_HEADERS diff --git a/src/plugins/world_stats/CMakeLists.txt b/src/plugins/world_stats/CMakeLists.txt index ad5c4e2ff..d4de14064 100644 --- a/src/plugins/world_stats/CMakeLists.txt +++ b/src/plugins/world_stats/CMakeLists.txt @@ -1,4 +1,4 @@ -ign_gui_add_plugin(WorldStats +gz_gui_add_plugin(WorldStats SOURCES WorldStats.cc QT_HEADERS