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 Migrate Internal CMake Vars : gz-cmake #275

Closed
wants to merge 9 commits into from
Closed
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
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
uses: actions/checkout@v2
- name: Compile and test
id: ci
uses: ignition-tooling/action-ignition-ci@focal
uses: gazebo-tooling/action-gz-ci@focal
with:
cmake-args: '-DBUILDSYSTEM_TESTING=True'
jammy-ci:
Expand All @@ -22,7 +22,6 @@ jobs:
uses: actions/checkout@v2
- name: Compile and test
id: ci
uses: ignition-tooling/action-ignition-ci@jammy
uses: gazebo-tooling/action-gz-ci@jammy
with:
cmake-args: '-DBUILDSYSTEM_TESTING=True'

2 changes: 1 addition & 1 deletion .github/workflows/pr-collection-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ jobs:
steps:
- name: Add collection labels
if: github.event.action == 'opened'
uses: ignition-tooling/pr-collection-labeler@v1
uses: gazebo-tooling/pr-collection-labeler@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
68 changes: 35 additions & 33 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
project(gz-cmake3 VERSION 3.0.0)

#--------------------------------------
# Initialize the IGNITION_CMAKE_DIR variable with the location of the cmake
# Initialize the GZ_CMAKE_DIR variable with the location of the cmake
# directory that sits next to this find-module.
set(IGNITION_CMAKE_DIR "${CMAKE_CURRENT_LIST_DIR}/cmake")
set(GZ_CMAKE_DIR "${CMAKE_CURRENT_LIST_DIR}/cmake")

#--------------------------------------
# Add the location of this package's cmake directory to the CMAKE_MODULE_PATH
list(APPEND CMAKE_MODULE_PATH "${IGNITION_CMAKE_DIR}")
list(APPEND CMAKE_MODULE_PATH "${GZ_CMAKE_DIR}")

#--------------------------------------
# include the master IgnCMake module
# include the master GzCMake module
include(GzCMake)

#--------------------------------------
Expand All @@ -27,26 +27,26 @@ gz_configure_project(VERSION_SUFFIX pre1)
option(BUILDSYSTEM_TESTING "Enable extended buildsystem testing" FALSE)

#--------------------------------------
# Install the ignition documentation files
# Install the Gazebo documentation files
# Note: This is not actually creating a doc target for gz-cmake; this is just
# installing files that are useful for generating the documentation of other
# ignition projects.
# Gazebo projects.
add_subdirectory(doc)

#--------------------------------------
# Install the benchmark files
install(DIRECTORY benchmark/
DESTINATION ${IGN_DATA_INSTALL_DIR}/benchmark)
DESTINATION ${GZ_DATA_INSTALL_DIR}/benchmark)

#--------------------------------------
# Install the codecheck files
install(DIRECTORY codecheck/
DESTINATION ${IGN_DATA_INSTALL_DIR}/codecheck)
DESTINATION ${GZ_DATA_INSTALL_DIR}/codecheck)

#--------------------------------------
# Install the tools files
install(DIRECTORY tools/
DESTINATION ${IGN_DATA_INSTALL_DIR}/tools)
DESTINATION ${GZ_DATA_INSTALL_DIR}/tools)

#============================================================================
# Configure the package to be installed
Expand All @@ -58,12 +58,12 @@ set(gz_config_input "${CMAKE_CURRENT_SOURCE_DIR}/config/gz-cmake-config.cmake.i
set(gz_config_output "${PROJECT_NAME_LOWER}-config.cmake")
set(gz_version_output "${PROJECT_NAME_LOWER}-config-version.cmake")
set(gz_config_install_dir "${CMAKE_INSTALL_DATAROOTDIR}/cmake/${PROJECT_NAME_LOWER}")
set(ign_pkgconfig_input "${CMAKE_CURRENT_SOURCE_DIR}/config/gz-cmake.pc.in")
set(ign_pkgconfig_output "${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc")
set(ign_pkgconfig_install_dir "${IGN_LIB_INSTALL_DIR}/pkgconfig")
set(ign_utilities_target ${PROJECT_EXPORT_NAME}-utilities)
set(ign_utilities_import_target_name ${PROJECT_EXPORT_NAME}::${ign_utilities_target})
set(ign_utilities_target_output_filename "${ign_utilities_target}-targets.cmake")
set(gz_pkgconfig_input "${CMAKE_CURRENT_SOURCE_DIR}/config/gz-cmake.pc.in")
set(gz_pkgconfig_output "${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc")
set(gz_pkgconfig_install_dir "${GZ_LIB_INSTALL_DIR}/pkgconfig")
set(gz_utilities_target ${PROJECT_EXPORT_NAME}-utilities)
set(gz_utilities_import_target_name ${PROJECT_EXPORT_NAME}::${gz_utilities_target})
set(gz_utilities_target_output_filename "${gz_utilities_target}-targets.cmake")
set(simple_utilities_import_name ${PROJECT_EXPORT_NAME}::utilities)

#--------------------------------------
Expand All @@ -72,7 +72,7 @@ configure_package_config_file(
${gz_config_input}
${gz_config_output}
INSTALL_DESTINATION ${gz_config_install_dir}
PATH_VARS IGN_DATA_INSTALL_DIR
PATH_VARS GZ_DATA_INSTALL_DIR
NO_CHECK_REQUIRED_COMPONENTS_MACRO)

#--------------------------------------
Expand All @@ -92,50 +92,50 @@ install(
#--------------------------------------
# Configure and install the pkgconfig file (needed for utilities headers)
file(RELATIVE_PATH
IGN_PC_CONFIG_RELATIVE_PATH_TO_PREFIX
"${CMAKE_INSTALL_PREFIX}/${ign_pkgconfig_install_dir}"
GZ_PC_CONFIG_RELATIVE_PATH_TO_PREFIX
"${CMAKE_INSTALL_PREFIX}/${gz_pkgconfig_install_dir}"
"${CMAKE_INSTALL_PREFIX}"
)
configure_file(${ign_pkgconfig_input} ${ign_pkgconfig_output} @ONLY)
configure_file(${gz_pkgconfig_input} ${gz_pkgconfig_output} @ONLY)

install(
FILES ${ign_pkgconfig_output}
DESTINATION ${ign_pkgconfig_install_dir}
FILES ${gz_pkgconfig_output}
DESTINATION ${gz_pkgconfig_install_dir}
COMPONENT pkgconfig)

#============================================================================
# Create and install the utilities component
#============================================================================
# Deprecated: Remove the utilities component in gz-cmake4
add_library(${ign_utilities_target} INTERFACE)
target_include_directories(${ign_utilities_target}
add_library(${gz_utilities_target} INTERFACE)
target_include_directories(${gz_utilities_target}
INTERFACE
$<INSTALL_INTERFACE:${IGN_INCLUDE_INSTALL_DIR_FULL}>
$<INSTALL_INTERFACE:${GZ_INCLUDE_INSTALL_DIR_FULL}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>)

# Export and install the interface target
install(
TARGETS ${ign_utilities_target}
EXPORT ${ign_utilities_target}
TARGETS ${gz_utilities_target}
EXPORT ${gz_utilities_target}
COMPONENT interface)

export(
EXPORT ${ign_utilities_target}
FILE ${ign_utilities_target_output_filename}
EXPORT ${gz_utilities_target}
FILE ${gz_utilities_target_output_filename}
NAMESPACE ${PROJECT_EXPORT_NAME}::)

install(
EXPORT ${ign_utilities_target}
EXPORT ${gz_utilities_target}
DESTINATION ${gz_config_install_dir}
FILE ${ign_utilities_target_output_filename}
FILE ${gz_utilities_target_output_filename}
NAMESPACE ${PROJECT_EXPORT_NAME}::)

# Install the header directory
# Note: The trailing slash after "include" is necessary
install(
DIRECTORY include/
DESTINATION ${IGN_INCLUDE_INSTALL_DIR_FULL}
DESTINATION ${GZ_INCLUDE_INSTALL_DIR_FULL}
COMPONENT headers)

#============================================================================
Expand Down Expand Up @@ -230,12 +230,14 @@ set(CPPCHECK_INCLUDE_DIRS
${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/examples
)
set(IGNITION_CMAKE_CODECHECK_DIR "${CMAKE_CURRENT_SOURCE_DIR}/codecheck")
set(GZ_CMAKE_CODECHECK_DIR "${CMAKE_CURRENT_SOURCE_DIR}/codecheck")
include(GzCodeCheck)
_gz_setup_target_for_codecheck()

# Docs
set(IGNITION_CMAKE_DOXYGEN_DIR "${CMAKE_CURRENT_SOURCE_DIR}/doc/doxygen")
set(GZ_CMAKE_DOXYGEN_DIR "${CMAKE_CURRENT_SOURCE_DIR}/doc/doxygen")
set(IGNITION_CMAKE_DOXYGEN_DIR ${GZ_CMAKE_DOXYGEN_DIR}) # TODO(CH3): Deprecated. Remove on tock.

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)
gz_create_docs(
Expand Down
24 changes: 12 additions & 12 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

### Gazebo CMake 2.12.1 (2022-04-12)

1. Allow to recreate targets created by IgnPkgConfig
1. Allow to recreate targets created by GzPkgConfig
* [Pull request #231](https://github.com/gazebosim/gz-cmake/pull/231)

1. Adding tests for CONFIG argument
Expand All @@ -13,7 +13,7 @@
1. Adding CONFIG option
* [Pull request #211](https://github.com/gazebosim/gz-cmake/pull/211)

1. IgnFindOGRE2: support for the ogre-next package on Ubuntu Jammy
1. GzFindOGRE2: support for the ogre-next package on Ubuntu Jammy
* [Pull request #224](https://github.com/gazebosim/gz-cmake/pull/224)

1. Fix check for missing components in OGRE2. Be more verbose with components
Expand All @@ -23,7 +23,7 @@
* [Pull request #219](https://github.com/gazebosim/gz-cmake/pull/219)
* [Pull request #221](https://github.com/gazebosim/gz-cmake/pull/221)

1. Specify sanitizers using IGN_SANITIZERS cmake variable
1. Specify sanitizers using GZ_SANITIZERS cmake variable
* [Pull request #210](https://github.com/gazebosim/gz-cmake/pull/210)

1. Replace deprecated PythonInterp with Python3 (#213)
Expand Down Expand Up @@ -58,24 +58,24 @@
1. Do not modify `CMAKE_FIND_LIBRARY_PREFIXES` and `CMAKE_FIND_LIBRARY_SUFFIXES` on Windows
* [Pull request #189](https://github.com/gazebosim/gz-cmake/pull/189)

1. Project option: `REPLACE_IGNITION_INCLUDE_PATH`
1. Project option: `REPLACE_INCLUDE_PATH`
* [Pull request #190](https://github.com/gazebosim/gz-cmake/pull/190)

1. Project option: `NO_IGNITION_PREFIX`
1. Project option: `NO_PROJECT_PREFIX`
* [Pull request #191](https://github.com/gazebosim/gz-cmake/pull/191)

### Gazebo CMake 2.9.0 (2021-09-02)

1. Fix include directory flags for codecheck
* [Pull request #186](https://github.com/gazebosim/gz-cmake/pull/186)

1. Fix problems on IgnOGRE when version is not found
1. Fix problems on GzOGRE when version is not found
* [Pull request #175](https://github.com/gazebosim/gz-cmake/pull/175)

1. Remove bitbucket-pipelines.yml
* [Pull request #181](https://github.com/gazebosim/gz-cmake/pull/181)

1. Include IMAGE_PATH directories in ign_create_docs
1. Include IMAGE_PATH directories in gz_create_docs
* [Pull request #183](https://github.com/gazebosim/gz-cmake/pull/183)

1. Special case for ogre2.2 on Windows
Expand Down Expand Up @@ -195,7 +195,7 @@

### Gazebo CMake 2.4.0 (2020-08-20)

1. Added an option to include generated code in the ign_create_docs function
1. Added an option to include generated code in the gz_create_docs function
* [Pull request 108](https://github.com/gazebosim/gz-cmake/pull/108)

### Gazebo CMake 2.3.0 (2020-08-07)
Expand Down Expand Up @@ -258,7 +258,7 @@
* [BitBucket pull request 161](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-cmake/pull-requests/161)
* [BitBucket pull request 155](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-cmake/pull-requests/155)

1. IgnConfigureBuild: only `add_subdirectory(test)` if `BUILD_TESTING` is ON
1. GzConfigureBuild: only `add_subdirectory(test)` if `BUILD_TESTING` is ON
* [BitBucket pull request 169](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-cmake/pull-requests/169)

1. Add FindGzBullet cmake module.
Expand Down Expand Up @@ -315,7 +315,7 @@
* [BitBucket pull request 171](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-cmake/pull-requests/171)
* [BitBucket pull request 168](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-cmake/pull-requests/168)

1. IgnConfigureBuild: only `add_subdirectory(test)` if `BUILD_TESTING` is ON
1. GzConfigureBuild: only `add_subdirectory(test)` if `BUILD_TESTING` is ON
* [BitBucket pull request 165](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-cmake/pull-requests/165)

1. Fix race condition in test for issue 48
Expand Down Expand Up @@ -345,10 +345,10 @@
1. Avoid hardcoding /machine:x64 flag on 64-bit on MSVC.
* [BitBucket pull request 168](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-cmake/pull-requests/168)

1. IgnConfigureBuild: only `add_subdirectory(test)` if `BUILD_TESTING` is ON
1. GzConfigureBuild: only `add_subdirectory(test)` if `BUILD_TESTING` is ON
* [BitBucket pull request 163](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-cmake/pull-requests/163)

1. IgnConfigureProject.cmake: fix small typo PKCONFIG -> PKGCONFIG
1. GzConfigureProject.cmake: fix small typo PKCONFIG -> PKGCONFIG
* [BitBucket pull request 118](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-cmake/pull-requests/118)

### Gazebo CMake 0.6.1
Expand Down
5 changes: 4 additions & 1 deletion Migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ release will remove the deprecated code.
**Replacement**: CMake functions and macros starting with `gz_`
1. **Deprecated**: `ignition` namespaces
**Replacement**: `gz` namespaces

1. **Deprecated**: `Ign` prefixed CMake files
**Replacement**: `Gz` prefixed CMake files
1. **Deprecated**: `IGN/IGNITION` prefixed CMake variables and options
**Replacement**: `GZ` prefixed CMake variables and options
1. **Breaking**: The project name has been changed to use the `gz-` prefix, you **must** use the `gz` prefix!
* This also means that any generated code that use the project name (e.g. CMake variables, in-source macros) would have to be migrated.
* Some non-exhaustive examples of this include:
Expand Down
8 changes: 4 additions & 4 deletions MigrationFromClassic.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ A variety of arguments are available to guide the behavior of
`gz_find_package(~)`. Most of them will not be needed in most situations, but
you should consider reading them over once just in case they might be relevant
for you. The macro's documentation is available in
`gz-cmake/cmake/IgnUtils.cmake` just above definition of `gz_find_package(~)`.
`gz-cmake/cmake/GzUtils.cmake` just above definition of `gz_find_package(~)`.
Feel free to ask questions about any of its arguments that are unclear.

Any operations that might need to be performed while searching for a package
Expand Down Expand Up @@ -88,7 +88,7 @@ and adopting their convention will reduce the friction that we experience when
interfacing with a wide variety of native CMake utilities. It's also beneficial
to embrace the "single source of truth" pattern.

### Change instances of `IGN_PROJECT_NAME` to `IGN_DESIGNATION`
### Change instances of `IGN_PROJECT_NAME` to `GZ_DESIGNATION`

We've had a variable called `IGN_PROJECT_NAME` which refers to the `<suffix>`
in the `gz-<suffix>` name of each project. I felt that the name of the
Expand All @@ -97,7 +97,7 @@ defined by CMake, as well as the `PROJECT_NAME[_NO_VERSION][_UPPER/_LOWER]` that
we define for convenience. Instead of referring to both as `[IGN_]PROJECT_NAME`,
I thought it would be better to use clear and distinct words to distinguish
them. Therefore the `<suffix>` part of the project name is now referred to as
`IGN_DESIGNATION`, and we provide `IGN_DESIGNATION[_LOWER/_UPPER]` for
`GZ_DESIGNATION`, and we provide `GZ_DESIGNATION[_LOWER/_UPPER]` for
convenience.

### Do not use `append_to_cached_string` or `append_to_cached_list` anymore.
Expand All @@ -122,7 +122,7 @@ requires a certain standard, it MUST be specified directly to this function in
order to ensure that the requirement gets correctly propagated into the
project's package information so that dependent libraries will also be aware of
the requirement. See the documentation of `gz_create_core_library(~)` in
`gz-cmake/cmake/IgnUtils.cmake` for more details on how to specify your
`gz-cmake/cmake/GzUtils.cmake` for more details on how to specify your
library's C++ standard requirement.

### Specify `TYPE` and `SOURCES` arguments in `gz_build_tests(~)`
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ The [Source Install](#source-install) instructions should be used if you need th
On Ubuntu systems, `apt-get` can be used to install `gz-cmake`:

```
$ sudo apt install libignition-cmake<#>-dev
$ sudo apt install libgz-cmake<#>-dev
```

Be sure to replace `<#>` with a number value, such as `1` or `2`, depending on which version you need.
Expand Down
4 changes: 2 additions & 2 deletions api.md.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Gazebo @IGN_DESIGNATION_CAP@
## Gazebo @GZ_DESIGNATION_CAP@

Gazebo @IGN_DESIGNATION_CAP@ is a component in Gazebo, a set of libraries
Gazebo @GZ_DESIGNATION_CAP@ is a component in Gazebo, a set of libraries
designed to rapidly develop robot and simulation applications.

## License
Expand Down
2 changes: 1 addition & 1 deletion benchmark/run_benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def collect_results(project_name, results_dir):

if __name__ == '__main__':
parser = argparse.ArgumentParser('Run and aggregate available benchmarks')
parser.add_argument('--project-name', help='Name of the Ignition project')
parser.add_argument('--project-name', help='Name of the Gazebo project')
parser.add_argument('--version-file',
help='Generated file containing version information')
parser.add_argument('--benchmark-targets', help='Targets to be executed')
Expand Down
2 changes: 1 addition & 1 deletion cmake/FindGzProtobuf.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
########################################
# Find Protobuf

# This is an ignition wrapper for finding Protobuf. The purpose of this find
# This is a Gazebo wrapper for finding Protobuf. The purpose of this find
# module is to search for a config-file for Protobuf before resorting to using
# the native CMake find-module for Protobuf. This ensures that if a specially
# configured version of Protobuf is installed, then its exported targets will be
Expand Down
6 changes: 3 additions & 3 deletions cmake/GzBenchmark.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function(_gz_add_version_info_target)
# that forces the file to be regenerated at build time.
add_custom_target(version_info_target
COMMAND ${CMAKE_COMMAND}
-Dinput_file=${IGNITION_CMAKE_DIR}/version_info.json.in
-Dinput_file=${GZ_CMAKE_DIR}/version_info.json.in
-Doutput_file=${CMAKE_CURRENT_BINARY_DIR}/version_info.json
-Drepository_root=${CMAKE_CURRENT_SOURCE_DIR}
# Yes, these variables need to be passed in, because they won't
Expand All @@ -55,7 +55,7 @@ function(_gz_add_version_info_target)
-DPROJECT_VERSION_MINOR=${PROJECT_VERSION_MINOR}
-DPROJECT_VERSION_PATCH=${PROJECT_VERSION_PATCH}
-DPROJECT_NAME=${PROJECT_NAME}
-P ${IGNITION_CMAKE_DIR}/IgnGenerateVersionInfo.cmake
-P ${GZ_CMAKE_DIR}/GzGenerateVersionInfo.cmake
)
endfunction()

Expand Down Expand Up @@ -107,7 +107,7 @@ function(gz_add_benchmarks)

add_custom_target(
run_benchmarks
COMMAND python3 ${IGNITION_CMAKE_BENCHMARK_DIR}/run_benchmarks.py
COMMAND python3 ${GZ_CMAKE_BENCHMARK_DIR}/run_benchmarks.py
--project-name ${PROJECT_NAME}
--version-file ${CMAKE_CURRENT_BINARY_DIR}/version_info.json
--benchmark-targets ${CMAKE_CURRENT_BINARY_DIR}/benchmark_targets
Expand Down
Loading