Skip to content

Commit

Permalink
[ign -> gz] CMake functions (#171)
Browse files Browse the repository at this point in the history
Signed-off-by: Louise Poubel <[email protected]>
  • Loading branch information
chapulina authored Jun 17, 2022
1 parent e8c9dc7 commit 8aafd2f
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 28 deletions.
34 changes: 17 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ set(IGN_CMAKE_VER ${ignition-cmake3_VERSION_MAJOR})
#============================================================================
# Configure the project
#============================================================================
ign_configure_project(
gz_configure_project(
REPLACE_IGNITION_INCLUDE_PATH gz/launch
VERSION_SUFFIX)

Expand All @@ -31,49 +31,49 @@ message(STATUS "\n\n-- ====== Finding Dependencies ======")

#--------------------------------------
# Find Tinyxml2
ign_find_package(TINYXML2 REQUIRED PRIVATE PRETTY tinyxml2)
gz_find_package(TINYXML2 REQUIRED PRIVATE PRETTY tinyxml2)

#--------------------------------------
# Find ignition-common
ign_find_package(ignition-common5 REQUIRED PRIVATE)
gz_find_package(ignition-common5 REQUIRED PRIVATE)
set(IGN_COMMON_MAJOR_VER ${ignition-common5_VERSION_MAJOR})

#--------------------------------------
# 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 ignition-plugin
ign_find_package(ignition-plugin2 REQUIRED_BY launch COMPONENTS loader register)
gz_find_package(ignition-plugin2 REQUIRED_BY launch COMPONENTS loader register)
set(IGN_PLUGIN_MAJOR_VER ${ignition-plugin2_VERSION_MAJOR})

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

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

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

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

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

#--------------------------------------
# Find ignition-gazebo
ign_find_package(ignition-gazebo7 REQUIRED PRIVATE COMPONENTS gui)
gz_find_package(ignition-gazebo7 REQUIRED PRIVATE COMPONENTS gui)
set(IGN_GAZEBO_MAJOR_VER ${ignition-gazebo7_VERSION_MAJOR})

ign_pkg_check_modules(websockets libwebsockets)
gz_pkg_check_modules(websockets libwebsockets)
if (NOT websockets_FOUND)
ign_build_warning("Unable to find libwebsockets. The websocket_server plugin will not be built.")
gz_build_warning("Unable to find libwebsockets. The websocket_server plugin will not be built.")
endif()

#--------------------------------------
Expand All @@ -103,7 +103,7 @@ add_subdirectory(plugins)
#============================================================================
# Configure the build
#============================================================================
ign_configure_build(QUIT_IF_BUILD_ERRORS)
gz_configure_build(QUIT_IF_BUILD_ERRORS)

#============================================================================
# install example .ign files
Expand All @@ -113,15 +113,15 @@ add_subdirectory(examples)
#============================================================================
# Create package information
#============================================================================
ign_create_packages()
gz_create_packages()

#============================================================================
# Configure documentation
#============================================================================
configure_file(${CMAKE_SOURCE_DIR}/api.md.in ${CMAKE_BINARY_DIR}/api.md)
configure_file(${CMAKE_SOURCE_DIR}/tutorials.md.in ${CMAKE_BINARY_DIR}/tutorials.md)

ign_create_docs(
gz_create_docs(
API_MAINPAGE_MD "${CMAKE_BINARY_DIR}/api.md"
TUTORIALS_MAINPAGE_MD "${CMAKE_BINARY_DIR}/tutorials.md"
TAGFILES
Expand Down
2 changes: 1 addition & 1 deletion include/gz/launch/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ign_install_all_headers()
gz_install_all_headers()
4 changes: 2 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ set (gtest_sources
)

# Create the library target.
ign_create_core_library(SOURCES ${sources} CXX_STANDARD 17)
gz_create_core_library(SOURCES ${sources} CXX_STANDARD 17)

# Link the libraries that we always need.
target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME}
Expand All @@ -26,7 +26,7 @@ target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME}
target_compile_definitions(${PROJECT_LIBRARY_TARGET_NAME} PRIVATE ${BACKWARD_DEFINITIONS})

# Build the unit tests.
ign_build_tests(TYPE UNIT SOURCES ${gtest_sources}
gz_build_tests(TYPE UNIT SOURCES ${gtest_sources}
EXCLUDE_PROJECT_LIB
LIB_DEPS
${PROJECT_LIBRARY_TARGET_NAME}
Expand Down
8 changes: 4 additions & 4 deletions src/cmd/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Collect source files into the "sources" variable and unit test files into the
# "gtest_sources" variable.
ign_get_libsources_and_unittests(sources gtest_sources)
gz_get_libsources_and_unittests(sources gtest_sources)

add_library(ign STATIC ign.cc)
target_include_directories(ign PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
Expand All @@ -25,7 +25,7 @@ install(
)

# Build the unit tests.
ign_build_tests(TYPE UNIT SOURCES ${gtest_sources}
gz_build_tests(TYPE UNIT SOURCES ${gtest_sources}
TEST_LIST test_list
LIB_DEPS ${EXTRA_TEST_LIB_DEPS})

Expand Down Expand Up @@ -94,7 +94,7 @@ file(GENERATE
OUTPUT "${cmd_script_generated}"
INPUT "${cmd_script_configured}")

set(ign_library_path "${CMAKE_BINARY_DIR}/test/lib/$<CONFIG>/ruby/ignition/cmd${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}")
set(gz_library_path "${CMAKE_BINARY_DIR}/test/lib/$<CONFIG>/ruby/ignition/cmd${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}")

# Generate a configuration file for internal testing.
# Note that the major version of the library is included in the name.
Expand All @@ -108,7 +108,7 @@ file(GENERATE
INPUT "${CMAKE_CURRENT_BINARY_DIR}/${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}.yaml.configured")

# Used for the installed version.
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 the configuration file that is installed.
# Note that the major version of the library is included in the name.
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/launch.yaml.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
format: 1.0.0
library_name: @PROJECT_NAME_NO_VERSION@
library_version: @PROJECT_VERSION_FULL@
library_path: @ign_library_path@
library_path: @gz_library_path@
commands:
- launch: Run and manage executables and plugins.
---
2 changes: 1 addition & 1 deletion test/integration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if(NOT WIN32)
# Disable test on Windows, it deals with UNIX signals
set(tests faulty_plugins.cc)

ign_build_tests(TYPE INTEGRATION SOURCES ${tests} TEST_LIST test_targets)
gz_build_tests(TYPE INTEGRATION SOURCES ${tests} TEST_LIST test_targets)
foreach(test ${test_targets})
target_compile_definitions(${test} PRIVATE
"bad_plugins_LIB=\"$<TARGET_FILE:bad_plugins>\"")
Expand Down
2 changes: 1 addition & 1 deletion test/performance/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ set(tests)

link_directories(${PROJECT_BINARY_DIR}/test)

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

link_directories(${PROJECT_BINARY_DIR}/test)

ign_build_tests(TYPE REGRESSION SOURCES ${tests})
gz_build_tests(TYPE REGRESSION SOURCES ${tests})

0 comments on commit 8aafd2f

Please sign in to comment.