Skip to content

Commit

Permalink
Migrate CMake files (#395)
Browse files Browse the repository at this point in the history
Signed-off-by: methylDragon <methylDragon@gmail.com>
  • Loading branch information
methylDragon committed May 13, 2022
1 parent d9f235f commit 589074b
Show file tree
Hide file tree
Showing 25 changed files with 47 additions and 46 deletions.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
3 changes: 2 additions & 1 deletion include/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
add_subdirectory(ignition)
add_subdirectory(gz)
install(DIRECTORY ignition DESTINATION ${IGN_INCLUDE_INSTALL_DIR_FULL})
40 changes: 19 additions & 21 deletions src/plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#################################################
# ign_gui_add_library (<library_name>
# gz_gui_add_library (<library_name>
# SOURCES <sources>
# [PUBLIC_LINK_LIBS <libraries...>]
# [PRIVATE_LINK_LIBS <libraries...>])
Expand All @@ -16,33 +16,32 @@
#
# [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}
)
target_link_libraries(${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(<plugin_name>
# gz_gui_add_plugin(<plugin_name>
# SOURCES <sources>
# [PUBLIC_LINK_LIBS <libraries...>]
# [PRIVATE_LINK_LIBS <libraries...>])
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/camera_tracking/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ign_gui_add_plugin(CameraTracking
gz_gui_add_plugin(CameraTracking
SOURCES
CameraTracking.cc
QT_HEADERS
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/grid_config/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ign_gui_add_plugin(GridConfig
gz_gui_add_plugin(GridConfig
SOURCES
GridConfig.cc
QT_HEADERS
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/image_display/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ign_gui_add_plugin(ImageDisplay
gz_gui_add_plugin(ImageDisplay
SOURCES
ImageDisplay.cc
QT_HEADERS
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/interactive_view_control/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ign_gui_add_plugin(InteractiveViewControl
gz_gui_add_plugin(InteractiveViewControl
SOURCES
InteractiveViewControl.cc
QT_HEADERS
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/key_publisher/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ign_gui_add_plugin(KeyPublisher
gz_gui_add_plugin(KeyPublisher
SOURCES
KeyPublisher.cc
QT_HEADERS
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/marker_manager/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ign_gui_add_plugin(MarkerManager
gz_gui_add_plugin(MarkerManager
SOURCES
MarkerManager.cc
QT_HEADERS
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/minimal_scene/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if (APPLE)
)
endif()

ign_gui_add_plugin(MinimalScene
gz_gui_add_plugin(MinimalScene
SOURCES
${SOURCES}
QT_HEADERS
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/navsat_map/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ign_gui_add_plugin(NavSatMap
gz_gui_add_plugin(NavSatMap
SOURCES
NavSatMap.cc
QT_HEADERS
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/plotting/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ign_gui_add_plugin(TransportPlotting
gz_gui_add_plugin(TransportPlotting
SOURCES
TransportPlotting.cc
QT_HEADERS
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/point_cloud/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ign_gui_add_plugin(PointCloud
gz_gui_add_plugin(PointCloud
SOURCES
PointCloud.cc
QT_HEADERS
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/publisher/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ign_gui_add_plugin(Publisher
gz_gui_add_plugin(Publisher
SOURCES
Publisher.cc
QT_HEADERS
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/scene3d/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ign_gui_add_plugin(Scene3D
gz_gui_add_plugin(Scene3D
SOURCES
Scene3D.cc
QT_HEADERS
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/screenshot/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ign_gui_add_plugin(Screenshot
gz_gui_add_plugin(Screenshot
SOURCES
Screenshot.cc
QT_HEADERS
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/shutdown_button/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ign_gui_add_plugin(ShutdownButton
gz_gui_add_plugin(ShutdownButton
SOURCES
ShutdownButton.cc
QT_HEADERS
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/tape_measure/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ign_gui_add_plugin(TapeMeasure
gz_gui_add_plugin(TapeMeasure
SOURCES TapeMeasure.cc
QT_HEADERS TapeMeasure.hh
PRIVATE_LINK_LIBS
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/teleop/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ign_gui_add_plugin(Teleop
gz_gui_add_plugin(Teleop
SOURCES
Teleop.cc
QT_HEADERS
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/topic_echo/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ign_gui_add_plugin(TopicEcho
gz_gui_add_plugin(TopicEcho
SOURCES
TopicEcho.cc
QT_HEADERS
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/topic_viewer/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ign_gui_add_plugin(TopicViewer
gz_gui_add_plugin(TopicViewer
SOURCES
TopicViewer.cc
QT_HEADERS
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/transport_scene_manager/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ign_gui_add_plugin(TransportSceneManager
gz_gui_add_plugin(TransportSceneManager
SOURCES
TransportSceneManager.cc
QT_HEADERS
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/world_control/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
if (NOT MSVC)
ign_gui_add_plugin(WorldControl
gz_gui_add_plugin(WorldControl
SOURCES
WorldControl.cc
WorldControlEventListener.cc
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/world_stats/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ign_gui_add_plugin(WorldStats
gz_gui_add_plugin(WorldStats
SOURCES
WorldStats.cc
QT_HEADERS
Expand Down

0 comments on commit 589074b

Please sign in to comment.