diff --git a/Changelog.md b/Changelog.md index 2c2a5562..3e407e71 100644 --- a/Changelog.md +++ b/Changelog.md @@ -58,10 +58,10 @@ 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_GZ_INCLUDE_PATH` +1. Project option: `REPLACE_INCLUDE_PATH` * [Pull request #190](https://github.com/gazebosim/gz-cmake/pull/190) -1. Project option: `NO_GZ_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) diff --git a/cmake/GzConfigureProject.cmake b/cmake/GzConfigureProject.cmake index 479510e5..13c06ed0 100644 --- a/cmake/GzConfigureProject.cmake +++ b/cmake/GzConfigureProject.cmake @@ -6,9 +6,9 @@ # # Sets up a Gazebo library project. # -# NO_GZ_PREFIX: Optional. Don't use Gazebo as prefix in +# NO_PROJECT_PREFIX: Optional. Don't use gz- as prefix in # cmake project name. -# REPLACE_GZ_INCLUDE_PATH: Optional. Specify include folder +# REPLACE_INCLUDE_PATH: Optional. Specify include folder # names to replace the default value of # gz/${GZ_DESIGNATION} # VERSION_SUFFIX: Optional. Specify a prerelease version suffix. @@ -34,8 +34,8 @@ macro(ign_configure_project) # TODO(chapulina) Enable warnings after all libraries have migrated. # message(WARNING "ign_configure_project is deprecated, use gz_configure_project instead.") - set(options NO_GZ_PREFIX NO_IGNITION_PREFIX) # TODO(CH3): NO_IGNITION_PREFIX IS DEPRECATED. - set(oneValueArgs REPLACE_GZ_INCLUDE_PATH REPLACE_IGNITION_INCLUDE_PATH VERSION_SUFFIX) # TODO(CH3): REPLACE_IGNITION_INCLUDE_PATH IS DEPRECATED. + set(options NO_PROJECT_PREFIX NO_IGNITION_PREFIX) # TODO(CH3): NO_IGNITION_PREFIX IS DEPRECATED. + set(oneValueArgs REPLACE_INCLUDE_PATH REPLACE_IGNITION_INCLUDE_PATH VERSION_SUFFIX) # TODO(CH3): REPLACE_IGNITION_INCLUDE_PATH IS DEPRECATED. set(multiValueArgs) # We are not using multiValueArgs yet _gz_cmake_parse_arguments(gz_configure_project "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) @@ -48,8 +48,8 @@ macro(gz_configure_project) if (NOT gz_configure_project_skip_parsing) #------------------------------------ # Define the expected arguments - set(options NO_GZ_PREFIX NO_IGNITION_PREFIX) # TODO(CH3): NO_IGNITION_PREFIX IS DEPRECATED. - set(oneValueArgs REPLACE_GZ_INCLUDE_PATH REPLACE_IGNITION_INCLUDE_PATH VERSION_SUFFIX) # TODO(CH3): REPLACE_IGNITION_INCLUDE_PATH IS DEPRECATED. + set(options NO_PROJECT_PREFIX NO_IGNITION_PREFIX) # TODO(CH3): NO_IGNITION_PREFIX IS DEPRECATED. + set(oneValueArgs REPLACE_INCLUDE_PATH REPLACE_IGNITION_INCLUDE_PATH VERSION_SUFFIX) # TODO(CH3): REPLACE_IGNITION_INCLUDE_PATH IS DEPRECATED. set(multiValueArgs) # We are not using multiValueArgs yet #------------------------------------ @@ -87,10 +87,10 @@ macro(gz_configure_project) # Set project variables #============================================================================ - if(gz_configure_project_NO_GZ_PREFIX) + if(gz_configure_project_NO_PROJECT_PREFIX) set(PROJECT_NAME_NO_VERSION ${GZ_DESIGNATION}) elseif(gz_configure_project_NO_IGNITION_PREFIX) # TODO(CH3): NO_IGNITION_PREFIX IS DEPRECATED. - message(DEPRECATION "[NO_IGNITION_PREFIX] is deprecated. Please use [NO_GZ_PREFIX] instead!") + message(DEPRECATION "[NO_IGNITION_PREFIX] is deprecated. Please use [NO_PROJECT_PREFIX] instead!") set(PROJECT_NAME_NO_VERSION ${GZ_DESIGNATION}) else() set(PROJECT_NAME_NO_VERSION "${PROJECT_PREFIX}-${GZ_DESIGNATION}") @@ -116,10 +116,10 @@ macro(gz_configure_project) set(PROJECT_EXPORT_NAME ${PROJECT_NAME_LOWER}) set(PROJECT_LIBRARY_TARGET_NAME ${PROJECT_NAME_LOWER}) - if(gz_configure_project_REPLACE_GZ_INCLUDE_PATH) - set(PROJECT_INCLUDE_DIR ${gz_configure_project_REPLACE_GZ_INCLUDE_PATH}) + if(gz_configure_project_REPLACE_INCLUDE_PATH) + set(PROJECT_INCLUDE_DIR ${gz_configure_project_REPLACE_INCLUDE_PATH}) elseif(gz_configure_project_REPLACE_IGNITION_INCLUDE_PATH) # TODO(CH3): REPLACE_IGNITION_INCLUDE_PATH IS DEPRECATED. - message(DEPRECATION "[REPLACE_IGNITION_INCLUDE_PATH] is deprecated. Please use [REPLACE_GZ_INCLUDE_PATH] instead!") + message(DEPRECATION "[REPLACE_IGNITION_INCLUDE_PATH] is deprecated. Please use [REPLACE_INCLUDE_PATH] instead!") set(PROJECT_INCLUDE_DIR ${gz_configure_project_REPLACE_IGNITION_INCLUDE_PATH}) else() set(PROJECT_INCLUDE_DIR gz/${GZ_DESIGNATION}) diff --git a/examples/comp_deps/CMakeLists.txt b/examples/comp_deps/CMakeLists.txt index a421b8bf..16a74806 100644 --- a/examples/comp_deps/CMakeLists.txt +++ b/examples/comp_deps/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR) project(gz-component_deps VERSION 0.1.0) find_package(gz-cmake3 REQUIRED) gz_configure_project( - REPLACE_GZ_INCLUDE_PATH gz/component_deps + REPLACE_INCLUDE_PATH gz/component_deps ) gz_configure_build(QUIT_IF_BUILD_ERRORS COMPONENTS child parent) diff --git a/examples/core_nodep/CMakeLists.txt b/examples/core_nodep/CMakeLists.txt index 0b8c2f0e..2bce192a 100644 --- a/examples/core_nodep/CMakeLists.txt +++ b/examples/core_nodep/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR) project(gz-core_no_deps VERSION 0.1.0) find_package(gz-cmake3 REQUIRED) gz_configure_project( - REPLACE_GZ_INCLUDE_PATH gz/core_no_deps + REPLACE_INCLUDE_PATH gz/core_no_deps ) gz_configure_build(QUIT_IF_BUILD_ERRORS) gz_create_packages() diff --git a/examples/core_nodep_static/CMakeLists.txt b/examples/core_nodep_static/CMakeLists.txt index fac9ebfb..bb25b1a4 100644 --- a/examples/core_nodep_static/CMakeLists.txt +++ b/examples/core_nodep_static/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR) project(gz-core_no_deps_static VERSION 0.1.0) find_package(gz-cmake3 REQUIRED) gz_configure_project( - REPLACE_GZ_INCLUDE_PATH gz/core_no_deps_static + REPLACE_INCLUDE_PATH gz/core_no_deps_static ) OPTION(BUILD_SHARED_LIBS OFF) gz_configure_build(QUIT_IF_BUILD_ERRORS) diff --git a/examples/no_gz_prefix/CMakeLists.txt b/examples/no_gz_prefix/CMakeLists.txt index 5f34531a..fe5c4907 100644 --- a/examples/no_gz_prefix/CMakeLists.txt +++ b/examples/no_gz_prefix/CMakeLists.txt @@ -2,8 +2,8 @@ cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR) project(no_gz_prefix VERSION 0.1.0) find_package(gz-cmake3 REQUIRED) gz_configure_project( - NO_GZ_PREFIX - REPLACE_GZ_INCLUDE_PATH no_gz) + NO_PROJECT_PREFIX + REPLACE_INCLUDE_PATH no_gz) gz_configure_build(QUIT_IF_BUILD_ERRORS) gz_create_packages() gz_create_docs() diff --git a/examples/no_gz_prefix/README.md b/examples/no_gz_prefix/README.md index 59b2c348..5c7d1a07 100644 --- a/examples/no_gz_prefix/README.md +++ b/examples/no_gz_prefix/README.md @@ -2,7 +2,7 @@ ## Configuring project name -This package uses the `NO_GZ_PREFIX` option in `gz_configure_project` +This package uses the `NO_PROJECT_PREFIX` option in `gz_configure_project` to allow a cmake package name without the `gz-` prefix. To confirm, configure this package and `package_source` and then observe that the tarball, @@ -21,7 +21,7 @@ make package_source ## Configuring include directory names -This package uses the `REPLACE_GZ_INCLUDE_PATH` option in `gz_configure_project` +This package uses the `REPLACE_INCLUDE_PATH` option in `gz_configure_project` to allow a custom include path of `no_gz`, which doesn't start with `ignition/`. To confirm, build the package and observe that `AlmostEmpty.cc` compiles successfully while including `no_gz/Export.hh`: