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_manual_search, ign_create_packages, ign_create_core_library #255

Merged
merged 7 commits into from
May 17, 2022
Merged
Show file tree
Hide file tree
Changes from 3 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
2 changes: 1 addition & 1 deletion cmake/FindAVCODEC.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ign_pkg_check_modules_quiet(AVCODEC libavcodec)

if(NOT AVCODEC_FOUND)
include(IgnManualSearch)
ign_manual_search(AVCODEC
gz_manual_search(AVCODEC
HEADER_NAMES "libavcodec/avcodec.h"
LIBRARY_NAMES "avcodec")
chapulina marked this conversation as resolved.
Show resolved Hide resolved
endif()
Expand Down
2 changes: 1 addition & 1 deletion cmake/FindAVDEVICE.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ign_pkg_check_modules_quiet(AVDEVICE "libavdevice >= ${av_major}.${av_minor}.${a

if(NOT AVDEVICE_FOUND)
include(IgnManualSearch)
ign_manual_search(AVDEVICE
gz_manual_search(AVDEVICE
HEADER_NAMES "libavdevice/avdevice.h"
LIBRARY_NAMES "avdevice")
chapulina marked this conversation as resolved.
Show resolved Hide resolved

Expand Down
2 changes: 1 addition & 1 deletion cmake/FindAVFORMAT.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ign_pkg_check_modules_quiet(AVFORMAT libavformat)

if(NOT AVFORMAT_FOUND)
include(IgnManualSearch)
ign_manual_search(AVFORMAT
gz_manual_search(AVFORMAT
HEADER_NAMES "libavformat/avformat.h"
LIBRARY_NAMES "avformat")
chapulina marked this conversation as resolved.
Show resolved Hide resolved
endif()
Expand Down
2 changes: 1 addition & 1 deletion cmake/FindAVUTIL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ign_pkg_check_modules_quiet(AVUTIL libavutil)

if(NOT AVUTIL_FOUND)
include(IgnManualSearch)
ign_manual_search(AVUTIL
gz_manual_search(AVUTIL
HEADER_NAMES "libavutil/avutil.h"
LIBRARY_NAMES "avutil")
chapulina marked this conversation as resolved.
Show resolved Hide resolved
endif()
Expand Down
2 changes: 1 addition & 1 deletion cmake/FindSWSCALE.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ign_pkg_check_modules_quiet(SWSCALE libswscale)

if(NOT SWSCALE_FOUND)
include(IgnManualSearch)
ign_manual_search(SWSCALE
gz_manual_search(SWSCALE
HEADER_NAMES "libswscale/swscale.h"
LIBRARY_NAMES "swscale")
chapulina marked this conversation as resolved.
Show resolved Hide resolved
endif()
Expand Down
2 changes: 1 addition & 1 deletion cmake/FindUUID.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ if (UNIX)

if(NOT UUID_FOUND)
include(IgnManualSearch)
ign_manual_search(UUID
gz_manual_search(UUID
HEADER_NAMES "uuid.h"
LIBRARY_NAMES "uuid libuuid"
PATH_SUFFIXES "uuid")
chapulina marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
27 changes: 21 additions & 6 deletions cmake/IgnManualSearch.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# limitations under the License.
#
########################################
# ign_manual_search(<package> [INTERFACE]
# gz_manual_search(<package> [INTERFACE]
# [HEADER_NAMES <header_names>]
# [LIBRARY_NAMES <library_names>]
# [TARGET_NAME <target_name>]
Expand Down Expand Up @@ -42,17 +42,32 @@
# PATH_SUFFIXES: Optional. Parameter forwarded to the find_path and find_library calls.
#
macro(ign_manual_search package)
# TODO(chapulina) Enable warnings after all libraries have migrated.
# message(WARNING "ign_manual_search is deprecated, use gz_manual_search instead.")

#------------------------------------
# Define the expected arguments
set(options INTERFACE)
set(oneValueArgs "TARGET_NAME")
set(multiValueArgs "HEADER_NAMES" "LIBRARY_NAMES" "PATH_SUFFIXES")

#------------------------------------
# Parse the arguments
_gz_cmake_parse_arguments(gz_manual_search "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})

set(gz_manual_search_skip_parsing true)
gz_manual_search(${PACKAGE_NAME})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm... I think this should be ${package} instead of ${PACKAGE_NAME} (see gazebosim/gz-common#386)

endmacro()
macro(gz_manual_search PACKAGE_NAME)

# Deprecated, remove skip parsing logic in version 4
if (NOT gz_manual_search_skip_parsing)
#------------------------------------
# Define the expected arguments
set(options INTERFACE)
set(oneValueArgs "TARGET_NAME")
set(multiValueArgs "HEADER_NAMES" "LIBRARY_NAMES" "PATH_SUFFIXES")

#------------------------------------
# Parse the arguments
_gz_cmake_parse_arguments(gz_manual_search "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
endif()

if(gz_manual_search_INTERFACE)
set(_gz_manual_search_interface_option INTERFACE)
else()
Expand Down
12 changes: 9 additions & 3 deletions cmake/IgnPackaging.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# Sets up package information for an ignition library project.
# This function is internal to gz-cmake.
#
# ign_create_package
# gz_create_packages
#
# Creates a package for an ignition library project
#
Expand Down Expand Up @@ -148,6 +148,12 @@ macro(_gz_setup_packages)
endmacro()

macro(ign_create_packages)
# TODO(chapulina) Enable warnings after all libraries have migrated.
# message(WARNING "ign_create_packages is deprecated, use gz_create_packages instead.")

gz_create_packages()
endmacro()
macro(gz_create_packages)

#============================================================================
# Load platform-specific build hooks if present.
chapulina marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -168,7 +174,7 @@ endmacro()
# If the target is a component, pass in the COMPONENT argument followed by the
# component's name.
#
# NOTE: This will be called automatically by ign_create_core_library(~) and
# NOTE: This will be called automatically by gz_create_core_library(~) and
# ign_add_component(~), so users of ignition-cmake should not call this
# function.
#
Expand Down Expand Up @@ -228,7 +234,7 @@ endfunction()
# variable names (like SDFormat_LIBRARIES), the LEGACY_PROJECT_PREFIX argument
# can be used to specify the prefix of these variables.
#
# NOTE: This will be called automatically by ign_create_core_library(~) and
# NOTE: This will be called automatically by gz_create_core_library(~) and
# ign_add_component(~), so users of ignition-cmake should not call this
# function.
#
Expand Down
41 changes: 30 additions & 11 deletions cmake/IgnUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ endmacro()
# current subdirectory if "src/" does not exist. They will be collated into
# library source files <lib_sources_var> and unittest source files <tests_var>.
#
# These output variables can be consumed directly by ign_create_core_library(~),
# These output variables can be consumed directly by gz_create_core_library(~),
# ign_add_component(~), ign_build_tests(~), and ign_build_executables(~).
function(ign_get_libsources_and_unittests lib_sources_var tests_var)

Expand Down Expand Up @@ -820,7 +820,7 @@ endfunction()
# <target_name>
# <pkgconfig_cflags_variable>)
#
# Handles the C++ standard argument for ign_create_core_library(~) and
# Handles the C++ standard argument for gz_create_core_library(~) and
# ign_add_component(~).
#
# NOTE: This is only meant for internal ign-cmake use.
Expand Down Expand Up @@ -866,7 +866,7 @@ macro(_gz_handle_cxx_standard prefix target pkgconfig_cflags)
endmacro()

#################################################
# ign_create_core_library(SOURCES <sources>
# gz_create_core_library(SOURCES <sources>
# [CXX_STANDARD <11|14|17>]
# [PRIVATE_CXX_STANDARD <11|14|17>]
# [INTERFACE_CXX_STANDARD <11|14|17>]
Expand Down Expand Up @@ -910,21 +910,40 @@ endmacro()
# are not allowed to use either of them if you use the CXX_STANDARD argument.
#
function(ign_create_core_library)
# TODO(chapulina) Enable warnings after all libraries have migrated.
# message(WARNING "ign_create_core_library is deprecated, use gz_create_core_library instead.")

#------------------------------------
# Define the expected arguments
set(options INTERFACE)
set(oneValueArgs INCLUDE_SUBDIR LEGACY_PROJECT_PREFIX CXX_STANDARD PRIVATE_CXX_STANDARD INTERFACE_CXX_STANDARD GET_TARGET_NAME)
set(multiValueArgs SOURCES)

#------------------------------------
# Parse the arguments
cmake_parse_arguments(gz_create_core_library "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})

set(gz_create_core_library_skip_parsing true)
gz_create_core_library()

if(gz_create_core_library_GET_TARGET_NAME)
set(${gz_create_core_library_GET_TARGET_NAME} ${${gz_create_core_library_GET_TARGET_NAME}} PARENT_SCOPE)
endif()
endfunction()
function(gz_create_core_library)

# Deprecated, remove skip parsing logic in version 4
if (NOT gz_create_core_library_skip_parsing)
#------------------------------------
# Define the expected arguments
set(options INTERFACE)
set(oneValueArgs INCLUDE_SUBDIR LEGACY_PROJECT_PREFIX CXX_STANDARD PRIVATE_CXX_STANDARD INTERFACE_CXX_STANDARD GET_TARGET_NAME)
set(multiValueArgs SOURCES)

#------------------------------------
# Parse the arguments
cmake_parse_arguments(gz_create_core_library "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
endif()

if(gz_create_core_library_SOURCES)
set(sources ${gz_create_core_library_SOURCES})
elseif(NOT gz_create_core_library_INTERFACE)
message(FATAL_ERROR "You must specify SOURCES for ign_create_core_library(~)!")
message(FATAL_ERROR "You must specify SOURCES for gz_create_core_library(~)!")
endif()

if(gz_create_core_library_INTERFACE)
Expand Down Expand Up @@ -1065,7 +1084,7 @@ endfunction()
# with the core library), but the component itself does not need to link to
# the core library.
#
# See the documentation of ign_create_core_library(~) for more information about
# See the documentation of gz_create_core_library(~) for more information about
# specifying the C++ standard. If your component publicly depends on the core
# library, then you probably do not need to specify the standard, because it
# will get inherited from the core library.
Expand Down Expand Up @@ -1311,7 +1330,7 @@ endmacro()

#################################################
# This is only meant for internal use by ignition-cmake. If you are a consumer
# of ignition-cmake, please use ign_create_core_library(~) or
# of ignition-cmake, please use gz_create_core_library(~) or
# ign_add_component(~) instead of this.
#
# _gz_add_library_or_component(LIB_NAME <lib_name>
Expand Down
2 changes: 1 addition & 1 deletion examples/comp_deps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ find_package(ignition-cmake3 REQUIRED)
ign_configure_project()
ign_configure_build(QUIT_IF_BUILD_ERRORS
COMPONENTS child parent)
ign_create_packages()
gz_create_packages()
ign_create_docs()
2 changes: 1 addition & 1 deletion examples/comp_deps/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
ign_get_libsources_and_unittests(sources gtest_sources)

ign_create_core_library(SOURCES ${sources})
gz_create_core_library(SOURCES ${sources})
2 changes: 1 addition & 1 deletion examples/core_child/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ find_package(ignition-cmake3 REQUIRED)
ign_configure_project()
ign_find_package(ignition-core_no_deps REQUIRED)
ign_configure_build(QUIT_IF_BUILD_ERRORS)
ign_create_packages()
gz_create_packages()
ign_create_docs(TAGFILES "${IGNITION-CORE_NO_DEPS_DOXYGEN_TAGFILE} = ${IGNITION-CORE_NO_DEPS_API_URL}")
2 changes: 1 addition & 1 deletion examples/core_child/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ign_get_libsources_and_unittests(sources gtest_sources)
ign_create_core_library(SOURCES ${sources} CXX_STANDARD 11)
gz_create_core_library(SOURCES ${sources} CXX_STANDARD 11)
target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME}
PUBLIC
ignition-core_no_deps::ignition-core_no_deps)
Expand Down
2 changes: 1 addition & 1 deletion examples/core_child_private/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ find_package(ignition-cmake3 REQUIRED)
ign_configure_project()
ign_find_package(ignition-core_no_deps PRIVATE REQUIRED)
ign_configure_build(QUIT_IF_BUILD_ERRORS)
ign_create_packages()
gz_create_packages()
ign_create_docs(TAGFILES "${IGNITION-CORE_NO_DEPS_DOXYGEN_TAGFILE} = ${IGNITION-CORE_NO_DEPS_API_URL}")
2 changes: 1 addition & 1 deletion examples/core_child_private/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ign_get_libsources_and_unittests(sources gtest_sources)
ign_create_core_library(SOURCES ${sources} CXX_STANDARD 11)
gz_create_core_library(SOURCES ${sources} CXX_STANDARD 11)
target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME}
PRIVATE
ignition-core_no_deps::ignition-core_no_deps)
Expand Down
2 changes: 1 addition & 1 deletion examples/core_nodep/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ project(ignition-core_no_deps VERSION 0.1.0)
find_package(ignition-cmake3 REQUIRED)
ign_configure_project()
ign_configure_build(QUIT_IF_BUILD_ERRORS)
ign_create_packages()
gz_create_packages()
ign_create_docs()
2 changes: 1 addition & 1 deletion examples/core_nodep/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
ign_get_libsources_and_unittests(sources gtest_sources)
ign_create_core_library(SOURCES ${sources} CXX_STANDARD 11)
gz_create_core_library(SOURCES ${sources} CXX_STANDARD 11)
ign_build_tests(TYPE UNIT SOURCES ${gtest_sources})
2 changes: 1 addition & 1 deletion examples/core_nodep_static/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ find_package(ignition-cmake3 REQUIRED)
ign_configure_project()
OPTION(BUILD_SHARED_LIBS OFF)
ign_configure_build(QUIT_IF_BUILD_ERRORS)
ign_create_packages()
gz_create_packages()
ign_create_docs()
2 changes: 1 addition & 1 deletion examples/core_nodep_static/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
ign_get_libsources_and_unittests(sources gtest_sources)
ign_create_core_library(SOURCES ${sources} CXX_STANDARD 11)
gz_create_core_library(SOURCES ${sources} CXX_STANDARD 11)
ign_build_tests(TYPE UNIT SOURCES ${gtest_sources})
2 changes: 1 addition & 1 deletion examples/core_static_child/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ find_package(ignition-cmake3 REQUIRED)
ign_configure_project()
ign_find_package(ignition-core_no_deps_static REQUIRED)
ign_configure_build(QUIT_IF_BUILD_ERRORS)
ign_create_packages()
gz_create_packages()
ign_create_docs(TAGFILES "${IGNITION-CORE_NO_DEPS_STATIC_DOXYGEN_TAGFILE} = ${IGNITION-CORE_NO_DEPS_STATIC_API_URL}")
2 changes: 1 addition & 1 deletion examples/core_static_child/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ign_get_libsources_and_unittests(sources gtest_sources)
ign_create_core_library(SOURCES ${sources} CXX_STANDARD 11)
gz_create_core_library(SOURCES ${sources} CXX_STANDARD 11)
target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME}
PUBLIC
ignition-core_no_deps_static::ignition-core_no_deps_static)
Expand Down
2 changes: 1 addition & 1 deletion examples/no_ignition_prefix/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ ign_configure_project(
NO_IGNITION_PREFIX
REPLACE_IGNITION_INCLUDE_PATH no_ign)
ign_configure_build(QUIT_IF_BUILD_ERRORS)
ign_create_packages()
gz_create_packages()
ign_create_docs()
2 changes: 1 addition & 1 deletion examples/no_ignition_prefix/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
ign_get_libsources_and_unittests(sources gtest_sources)
ign_create_core_library(SOURCES ${sources} CXX_STANDARD 11)
gz_create_core_library(SOURCES ${sources} CXX_STANDARD 11)
ign_build_tests(TYPE UNIT SOURCES ${gtest_sources})
2 changes: 1 addition & 1 deletion examples/prerelease/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

ign_create_core_library(INTERFACE)
gz_create_core_library(INTERFACE)

2 changes: 1 addition & 1 deletion examples/use_component_depsA/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ find_package(ignition-cmake3 REQUIRED)
ign_configure_project()
ign_find_package(ignition-component_deps REQUIRED COMPONENTS parent child)
ign_configure_build(QUIT_IF_BUILD_ERRORS)
ign_create_packages()
gz_create_packages()
ign_create_docs()
2 changes: 1 addition & 1 deletion examples/use_component_depsA/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ign_get_libsources_and_unittests(sources gtest_sources)
ign_create_core_library(SOURCES ${sources} CXX_STANDARD 11)
gz_create_core_library(SOURCES ${sources} CXX_STANDARD 11)
target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME}
PUBLIC
ignition-component_deps::ignition-component_deps-child)
Expand Down
2 changes: 1 addition & 1 deletion examples/use_component_depsB/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ find_package(ignition-cmake3 REQUIRED)
ign_configure_project()
ign_find_package(ignition-component_deps REQUIRED COMPONENTS child parent)
ign_configure_build(QUIT_IF_BUILD_ERRORS)
ign_create_packages()
gz_create_packages()
ign_create_docs()
2 changes: 1 addition & 1 deletion examples/use_component_depsB/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ign_get_libsources_and_unittests(sources gtest_sources)
ign_create_core_library(SOURCES ${sources} CXX_STANDARD 11)
gz_create_core_library(SOURCES ${sources} CXX_STANDARD 11)
target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME}
PUBLIC
ignition-component_deps::ignition-component_deps-child)
Expand Down
2 changes: 1 addition & 1 deletion examples/use_component_depsC/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ find_package(ignition-cmake3 REQUIRED)
ign_configure_project()
ign_find_package(ignition-component_deps REQUIRED COMPONENTS child)
ign_configure_build(QUIT_IF_BUILD_ERRORS)
ign_create_packages()
gz_create_packages()
ign_create_docs()
2 changes: 1 addition & 1 deletion examples/use_component_depsC/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ign_get_libsources_and_unittests(sources gtest_sources)
ign_create_core_library(SOURCES ${sources} CXX_STANDARD 11)
gz_create_core_library(SOURCES ${sources} CXX_STANDARD 11)
target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME}
PUBLIC
ignition-component_deps::ignition-component_deps-child)
Expand Down
2 changes: 1 addition & 1 deletion examples/use_config_ifp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ else()
endif()
ign_configure_project()
ign_configure_build(QUIT_IF_BUILD_ERRORS)
ign_create_packages()
gz_create_packages()