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 #1052

Merged
merged 1 commit into from
Jun 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
24 changes: 12 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ option(USE_DIST_PACKAGES_FOR_PYTHON
OFF)

if (BUILD_SDF)
ign_configure_project(
gz_configure_project(
NO_IGNITION_PREFIX
REPLACE_IGNITION_INCLUDE_PATH sdf
VERSION_SUFFIX pre1)

#################################################
# Find tinyxml2.
ign_find_package(TINYXML2 REQUIRED)
gz_find_package(TINYXML2 REQUIRED)

################################################
# Find urdfdom parser. Logic:
Expand All @@ -48,13 +48,13 @@ if (BUILD_SDF)
# 2. if USE_INTERNAL_URDF is set to True, use the internal copy
# 3. if USE_INTERNAL_URDF is set to False, force to search system installation, fail on error
if (NOT DEFINED USE_INTERNAL_URDF OR NOT USE_INTERNAL_URDF)
ign_find_package(IgnURDFDOM VERSION 1.0 QUIET)
gz_find_package(IgnURDFDOM VERSION 1.0 QUIET)
if (NOT IgnURDFDOM_FOUND)
if (NOT DEFINED USE_INTERNAL_URDF)
# fallback to internal urdf
set(USE_INTERNAL_URDF ON)
else()
ign_build_error("Couldn't find the urdfdom >= 1.0 system installation")
gz_build_error("Couldn't find the urdfdom >= 1.0 system installation")
endif()
endif()
endif()
Expand Down Expand Up @@ -96,32 +96,32 @@ if (BUILD_SDF)
# Find psutil python package for memory tests
find_python_module(psutil)
if (NOT PY_PSUTIL)
ign_build_warning("Python psutil package not found. Memory leak tests will be skipped")
gz_build_warning("Python psutil package not found. Memory leak tests will be skipped")
endif()

################################################
# Find ruby executable to produce xml schemas
find_program(RUBY ruby)
if (NOT RUBY)
ign_build_error ("Ruby version 1.9 is needed to build xml schemas")
gz_build_error ("Ruby version 1.9 is needed to build xml schemas")
else()
message(STATUS "Found ruby executable: ${RUBY}")
endif()

########################################
# Find ignition math
# Set a variable for generating ProjectConfig.cmake
ign_find_package(ignition-math7 VERSION REQUIRED)
gz_find_package(ignition-math7 VERSION REQUIRED)
set(IGN_MATH_VER ${ignition-math7_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 common
ign_find_package(ignition-common5 COMPONENTS graphics REQUIRED_BY usd)
gz_find_package(ignition-common5 COMPONENTS graphics REQUIRED_BY usd)
set(IGN_COMMON_VER ${ignition-common5_VERSION_MAJOR})

########################################
Expand All @@ -146,12 +146,12 @@ if (BUILD_SDF)

########################################
# Find PXR
ign_find_package(pxr QUIET REQUIRED_BY usd PKGCONFIG pxr)
gz_find_package(pxr QUIET REQUIRED_BY usd PKGCONFIG pxr)

ign_configure_build(HIDE_SYMBOLS_BY_DEFAULT QUIT_IF_BUILD_ERRORS
gz_configure_build(HIDE_SYMBOLS_BY_DEFAULT QUIT_IF_BUILD_ERRORS
COMPONENTS usd)

ign_create_packages()
gz_create_packages()

add_subdirectory(sdf)
add_subdirectory(conf)
Expand Down
4 changes: 2 additions & 2 deletions conf/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Used only for internal testing.
set(ign_library_path "${CMAKE_BINARY_DIR}/test/lib/ruby/ignition/cmd${PROJECT_NAME}")
set(gz_library_path "${CMAKE_BINARY_DIR}/test/lib/ruby/ignition/cmd${PROJECT_NAME}")

# Generate a configuration file for internal testing.
# Note that the major version of the library is included in the name.
Expand All @@ -9,7 +9,7 @@ configure_file(
"${CMAKE_BINARY_DIR}/test/conf/${PROJECT_NAME}.yaml" @ONLY)

# Used for the installed version.
set(ign_library_path "${CMAKE_INSTALL_PREFIX}/lib/ruby/ignition/cmd${PROJECT_NAME}")
set(gz_library_path "${CMAKE_INSTALL_PREFIX}/lib/ruby/ignition/cmd${PROJECT_NAME}")

# 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 conf/sdformat.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:
- sdf : Utilities for SDF files.
---
2 changes: 1 addition & 1 deletion include/sdf/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Exlcude some files so that they are not added to the master header.
ign_install_all_headers(EXCLUDE_FILES sdf.hh sdf_config.h)
gz_install_all_headers(EXCLUDE_FILES sdf.hh sdf_config.h)
install(
FILES
sdf.hh
Expand Down
6 changes: 3 additions & 3 deletions src/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 the source file auto-generated into the build folder from sdf/CMakeLists.txt
list(APPEND sources EmbeddedSdf.cc)
Expand Down Expand Up @@ -43,7 +43,7 @@ if (BUILD_TESTING)
list(REMOVE_ITEM gtest_sources parser_urdf_TEST.cc)
endif()

ign_build_tests(
gz_build_tests(
TYPE UNIT
SOURCES ${gtest_sources}
INCLUDE_DIRS
Expand Down Expand Up @@ -103,7 +103,7 @@ if (BUILD_TESTING)
endif()
endif()

ign_create_core_library(SOURCES ${sources}
gz_create_core_library(SOURCES ${sources}
CXX_STANDARD 17
LEGACY_PROJECT_PREFIX SDFormat
)
Expand Down
4 changes: 2 additions & 2 deletions test/integration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ find_program(XMLLINT_EXE xmllint)
if (EXISTS ${XMLLINT_EXE})
set (tests ${tests} schema_test.cc)
else()
ign_build_warning("xmllint not found. schema_test won't be run")
gz_build_warning("xmllint not found. schema_test won't be run")
endif()

ign_build_tests(TYPE ${TEST_TYPE} SOURCES ${tests} INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/test)
gz_build_tests(TYPE ${TEST_TYPE} SOURCES ${tests} INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/test)

if (EXISTS ${XMLLINT_EXE})
# Need to run schema target (build .xsd files) before running schema_test
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
parser_urdf.cc
)

ign_build_tests(TYPE ${TEST_TYPE} SOURCES ${tests} INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/test)
gz_build_tests(TYPE ${TEST_TYPE} SOURCES ${tests} INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/test)
2 changes: 1 addition & 1 deletion usd/include/sdf/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ign_install_all_headers(COMPONENT usd)
gz_install_all_headers(COMPONENT usd)
4 changes: 2 additions & 2 deletions usd/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ set(sources
usd_parser/USDWorld.cc
)

ign_add_component(usd SOURCES ${sources} GET_TARGET_NAME usd_target)
gz_add_component(usd SOURCES ${sources} GET_TARGET_NAME usd_target)

target_include_directories(${usd_target}
PUBLIC
Expand Down Expand Up @@ -65,7 +65,7 @@ set(gtest_sources
)

# Build the unit tests
ign_build_tests(
gz_build_tests(
TYPE UNIT
SOURCES ${gtest_sources}
LIB_DEPS ${usd_target}
Expand Down