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

Deprecate ign_find_package, ign_string_append, ign_build_error, ign_build_warning #258

Merged
merged 13 commits into from
May 24, 2022
10 changes: 5 additions & 5 deletions MigrationFromClassic.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ This is a wrapper for cmake's native `project(~)` command which additionally
sets a bunch of variables that will be needed by the `ignition-cmake` macros and
functions.

### Then search for each dependency using `ign_find_package(~)`
### Then search for each dependency using `gz_find_package(~)`

We now have a cmake macro `ign_find_package(~)` which is a wrapper for the
We now have a cmake macro `gz_find_package(~)` which is a wrapper for the
native cmake `find_package(~)` function, which additionally:

1. Collects build errors and build warnings so that they can all be printed out
Expand All @@ -53,10 +53,10 @@ error.
and cmake config file.

A variety of arguments are available to guide the behavior of
`ign_find_package(~)`. Most of them will not be needed in most situations, but
`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
`ign-cmake/cmake/IgnUtils.cmake` just above definition of `ign_find_package(~)`.
`ign-cmake/cmake/IgnUtils.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 @@ -345,7 +345,7 @@ after being invoked by the command `find_package(SomePackage)`. Notice that the
`.cmake` in the filename `FindSomePackage.cmake`. Case matters. This is not just
a convention; it is a cmake requirement.

Note that while using `ignition-cmake`, you should be using `ign_find_package(~)`
Note that while using `ignition-cmake`, you should be using `gz_find_package(~)`
instead of the native `find_package(~)` command. It does the same thing, except
that it adds some additional functionality which is important for ensuring
correctness in the package configuration files that we generate for our projects.
Expand Down
4 changes: 2 additions & 2 deletions cmake/FindIgnOGRE.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#
# Usage of this module as follows:
#
# ign_find_package(IgnOGRE)
# gz_find_package(IgnOGRE)
#
# Variables defined by this module:
#
Expand All @@ -41,7 +41,7 @@
#
# Example usage:
#
# ign_find_package(IgnOGRE
# gz_find_package(IgnOGRE
# VERSION 1.8.0
# COMPONENTS RTShaderSystem Terrain Overlay)

Expand Down
4 changes: 2 additions & 2 deletions cmake/FindIgnOGRE2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#
# Usage of this module as follows:
#
# ign_find_package(IgnOGRE2)
# gz_find_package(IgnOGRE2)
#
# Variables used by this module, they can change the default behaviour and need
# to be set before calling find_package:
Expand Down Expand Up @@ -51,7 +51,7 @@
#
# Example usage:
#
# ign_find_package(IgnOGRE2
# gz_find_package(IgnOGRE2
# VERSION 2.2.0
# COMPONENTS HlmsPbs HlmsUnlit Overlay)

Expand Down
8 changes: 4 additions & 4 deletions cmake/FindIgnProtobuf.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,21 @@ foreach(component ${IgnProtobuf_FIND_COMPONENTS})
if((${component} STREQUAL "libprotobuf") OR (${component} STREQUAL "all"))
if((NOT PROTOBUF_LIBRARY) AND (NOT TARGET protobuf::libprotobuf))
set(Protobuf_FOUND false)
ign_string_append(IgnProtobuf_missing_components "libprotobuf" DELIM " ")
gz_string_append(IgnProtobuf_missing_components "libprotobuf" DELIM " ")
endif()
endif()

if((${component} STREQUAL "libprotoc") OR (${component} STREQUAL "all"))
if((NOT PROTOBUF_PROTOC_LIBRARY) AND (NOT TARGET protobuf::libprotoc))
set(Protobuf_FOUND false)
ign_string_append(IgnProtobuf_missing_components "libprotoc" DELIM " ")
gz_string_append(IgnProtobuf_missing_components "libprotoc" DELIM " ")
endif()
endif()

if((${component} STREQUAL "protoc") OR (${component} STREQUAL "all"))
if((NOT PROTOBUF_PROTOC_EXECUTABLE) AND (NOT TARGET protobuf::protoc))
set(Protobuf_FOUND false)
ign_string_append(IgnProtobuf_missing_components "protoc" DELIM " ")
gz_string_append(IgnProtobuf_missing_components "protoc" DELIM " ")
endif()
endif()

Expand All @@ -76,7 +76,7 @@ endif()

if(${Protobuf_FOUND})
# If we have found Protobuf, then set the IgnProtobuf_FOUND flag to true so
# that ign_find_package(~) knows that we were successful.
# that gz_find_package(~) knows that we were successful.
set(IgnProtobuf_FOUND true)

# Older versions of protobuf don't create imported targets, so we will create
Expand Down
2 changes: 1 addition & 1 deletion cmake/FindIgnURDFDOM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ if(NOT IgnURDFDOM_FOUND)
endif()

# NOTE: urdfdom cmake does not support version checking
ign_find_package(urdfdom ${find_version} QUIET)
gz_find_package(urdfdom ${find_version} QUIET)
if (urdfdom_FOUND)
add_library(IgnURDFDOM::IgnURDFDOM INTERFACE IMPORTED)
target_link_libraries(IgnURDFDOM::IgnURDFDOM
Expand Down
2 changes: 1 addition & 1 deletion cmake/FindOptiX.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# Modified from NVIDIA's FindOptiX.cmake distributed in its OptiX SDK
# Usage of this module as follows:
#
# ign_find_package(OptiX)
# gz_find_package(OptiX)
#
# Variable used by this module, which needs to be set before calling
# find_package:
Expand Down
14 changes: 7 additions & 7 deletions cmake/IgnConfigureBuild.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ macro(gz_configure_build)
if(build_warnings)
set(all_warnings " CONFIGURATION WARNINGS:")
foreach (msg ${build_warnings})
ign_string_append(all_warnings " -- ${msg}" DELIM "\n")
gz_string_append(all_warnings " -- ${msg}" DELIM "\n")
endforeach ()
message(WARNING "${all_warnings}")
endif (build_warnings)
Expand Down Expand Up @@ -220,9 +220,9 @@ macro(gz_configure_build)
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/${component}/include")
# Note: It seems we need to give the delimiter exactly this many
# backslashes in order to get a \ plus a newline. This might be
# dependent on the implementation of ign_string_append, so be careful
# dependent on the implementation of gz_string_append, so be careful
# when changing the implementation of that function.
ign_string_append(ign_doxygen_component_input_dirs
gz_string_append(ign_doxygen_component_input_dirs
"${CMAKE_CURRENT_LIST_DIR}/${component}/include"
DELIM " \\\\\\\\\n ")
endif()
Expand Down Expand Up @@ -272,9 +272,9 @@ macro(gz_configure_build)

set(skip_msg "Skipping the component [${component}]")
if(SKIP_${component})
ign_string_append(skip_msg "by user request")
gz_string_append(skip_msg "by user request")
elseif(${component}_MISSING_DEPS)
ign_string_append(skip_msg "because the following packages are missing: ${${component}_MISSING_DEPS}")
gz_string_append(skip_msg "because the following packages are missing: ${${component}_MISSING_DEPS}")
endif()

message(STATUS "${skip_msg}")
Expand Down Expand Up @@ -327,7 +327,7 @@ function(_gz_find_include_script)
set(include_start "${CMAKE_CURRENT_LIST_DIR}")

if(_gz_find_include_script_COMPONENT)
ign_string_append(include_start ${_gz_find_include_script_COMPONENT} DELIM "/")
gz_string_append(include_start ${_gz_find_include_script_COMPONENT} DELIM "/")
endif()

# Check each level of depth to find the first CMakeLists.txt. This allows us
Expand Down Expand Up @@ -400,7 +400,7 @@ macro(_gz_parse_build_type)
elseif("${CMAKE_BUILD_TYPE_UPPERCASE}" STREQUAL "PROFILE")
set(BUILD_TYPE_PROFILE TRUE)
else()
ign_build_error("CMAKE_BUILD_TYPE [${CMAKE_BUILD_TYPE}] unknown. Valid options are: Debug Release RelWithDebInfo MinSizeRel Profile Check")
gz_build_error("CMAKE_BUILD_TYPE [${CMAKE_BUILD_TYPE}] unknown. Valid options are: Debug Release RelWithDebInfo MinSizeRel Profile Check")
endif()

endmacro()
6 changes: 3 additions & 3 deletions cmake/IgnCreateDocs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -140,19 +140,19 @@ function(gz_create_docs)
set(IGNITION_DOXYGEN_TAGFILES " ")

foreach(tagfile ${gz_create_docs_TAGFILES})
ign_string_append(IGNITION_DOXYGEN_TAGFILES "\"${tagfile}\"" DELIM " \\\\\\\\\n ")
gz_string_append(IGNITION_DOXYGEN_TAGFILES "\"${tagfile}\"" DELIM " \\\\\\\\\n ")
endforeach()

set(IGNITION_DOXYGEN_ADDITIONAL_INPUT_DIRS " ")

foreach(dir ${gz_create_docs_ADDITIONAL_INPUT_DIRS})
ign_string_append(IGNITION_DOXYGEN_ADDITIONAL_INPUT_DIRS "${dir}")
gz_string_append(IGNITION_DOXYGEN_ADDITIONAL_INPUT_DIRS "${dir}")
endforeach()

set(IGNITION_DOXYGEN_IMAGE_PATH " ")

foreach(dir ${gz_create_docs_IMAGE_PATH_DIRS})
ign_string_append(IGNITION_DOXYGEN_IMAGE_PATH "${dir}")
gz_string_append(IGNITION_DOXYGEN_IMAGE_PATH "${dir}")
endforeach()

find_package(Doxygen)
Expand Down
4 changes: 2 additions & 2 deletions cmake/IgnPkgConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ macro(ign_pkg_check_modules_quiet package signature)

endmacro()

# This creates variables which inform ign_find_package(~) that your package
# This creates variables which inform gz_find_package(~) that your package
# should be found as a module by pkg-config. In most cases, this will be called
# implicitly by ign_pkg_check_modules[_quiet], but if a package provides both a
# cmake config-file (*-config.cmake) and a pkg-config file (*.pc), then you can
Expand All @@ -183,7 +183,7 @@ macro(ign_pkg_config_entry package string)

endmacro()

# This creates variables which inform ign_find_package(~) that your package must
# This creates variables which inform gz_find_package(~) that your package must
# be found as a plain library by pkg-config. This should be used in any
# find-module that handles a library package which does not install a pkg-config
# <package>.pc file.
Expand Down
Loading