Skip to content

Commit

Permalink
Deprecate public ign functions in favor of gz
Browse files Browse the repository at this point in the history
Signed-off-by: Louise Poubel <[email protected]>
  • Loading branch information
chapulina committed May 17, 2022
1 parent 1a87c1a commit d2c1b2a
Show file tree
Hide file tree
Showing 57 changed files with 395 additions and 219 deletions.
2 changes: 1 addition & 1 deletion cmake/FindAVCODEC.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
########################################
# Find avcodec
include(IgnPkgConfig)
ign_pkg_check_modules_quiet(AVCODEC libavcodec)
gz_pkg_check_modules_quiet(AVCODEC libavcodec)

if(NOT AVCODEC_FOUND)
include(IgnManualSearch)
Expand Down
2 changes: 1 addition & 1 deletion cmake/FindAVDEVICE.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ set(av_minor ${AVDEVICE_FIND_VERSION_MINOR})
set(av_patch ${AVDEVICE_FIND_VERSION_PATCH})

include(IgnPkgConfig)
ign_pkg_check_modules_quiet(AVDEVICE "libavdevice >= ${av_major}.${av_minor}.${av_patch}")
gz_pkg_check_modules_quiet(AVDEVICE "libavdevice >= ${av_major}.${av_minor}.${av_patch}")

if(NOT AVDEVICE_FOUND)
include(IgnManualSearch)
Expand Down
2 changes: 1 addition & 1 deletion cmake/FindAVFORMAT.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
########################################
# Find AV format
include(IgnPkgConfig)
ign_pkg_check_modules_quiet(AVFORMAT libavformat)
gz_pkg_check_modules_quiet(AVFORMAT libavformat)

if(NOT AVFORMAT_FOUND)
include(IgnManualSearch)
Expand Down
2 changes: 1 addition & 1 deletion cmake/FindAVUTIL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
########################################
# Find avutil
include(IgnPkgConfig)
ign_pkg_check_modules_quiet(AVUTIL libavutil)
gz_pkg_check_modules_quiet(AVUTIL libavutil)

if(NOT AVUTIL_FOUND)
include(IgnManualSearch)
Expand Down
2 changes: 1 addition & 1 deletion cmake/FindCPPZMQ.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ if(CPPZMQ_FOUND)

# Since this is a header-only library, we should import it as an INTERFACE
# target.
ign_import_target(CPPZMQ INTERFACE)
gz_import_target(CPPZMQ INTERFACE)

# Now, to use the CPPZMQ headers, you should call
# target_link_libraries(<tgt> CPPZMQ::CPPZMQ) instead of using
Expand Down
6 changes: 3 additions & 3 deletions cmake/FindDL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,16 @@ else()

if(DL_FOUND)
include(IgnImportTarget)
ign_import_target(DL)
gz_import_target(DL)
set(DL_TARGET DL::DL)
endif()

endif()

# We need to manually specify the pkgconfig entry (and type of entry) for dl,
# because ign_pkg_check_modules does not work for it.
# because gz_pkg_check_modules does not work for it.
include(IgnPkgConfig)
ign_pkg_config_library_entry(DL dl)
gz_pkg_config_library_entry(DL dl)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
Expand Down
12 changes: 6 additions & 6 deletions cmake/FindEIGEN3.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,25 @@ if(EIGEN3_FOUND)
# Attempt to create an imported target in case we're using an old version
# of Eigen. (This function skip creating the imported target if it already
# exists).
ign_import_target(EIGEN3 INTERFACE
gz_import_target(EIGEN3 INTERFACE
TARGET_NAME Eigen3::Eigen)

if(EIGEN3_FIND_VERSION)
ign_pkg_config_entry(EIGEN3 "eigen3 >= ${EIGEN3_FIND_VERSION}")
gz_pkg_config_entry(EIGEN3 "eigen3 >= ${EIGEN3_FIND_VERSION}")
else()
ign_pkg_config_entry(EIGEN3 "eigen3")
gz_pkg_config_entry(EIGEN3 "eigen3")
endif()

return()

endif()

if(EIGEN3_FIND_VERSION)
ign_pkg_check_modules_quiet(EIGEN3 "eigen3 >= ${EIGEN3_FIND_VERSION}"
gz_pkg_check_modules_quiet(EIGEN3 "eigen3 >= ${EIGEN3_FIND_VERSION}"
INTERFACE
TARGET_NAME Eigen3::Eigen)
else()
ign_pkg_check_modules_quiet(EIGEN3 "eigen3"
gz_pkg_check_modules_quiet(EIGEN3 "eigen3"
INTERFACE
TARGET_NAME Eigen3::Eigen)
endif()
Expand All @@ -68,7 +68,7 @@ if(MSVC)
endif()
endif()

ign_import_target(EIGEN3 INTERFACE
gz_import_target(EIGEN3 INTERFACE
TARGET_NAME Eigen3::Eigen)

endif()
8 changes: 4 additions & 4 deletions cmake/FindFreeImage.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ set(full_version ${major_version}.${minor_version})

if (NOT WIN32)
include(IgnPkgConfig)
ign_pkg_config_library_entry(FreeImage freeimage)
gz_pkg_config_library_entry(FreeImage freeimage)

# If we don't have PkgConfig, or if PkgConfig failed, then do a manual search
if(NOT FreeImage_FOUND)
Expand Down Expand Up @@ -88,7 +88,7 @@ if (NOT WIN32)
if(FreeImage_FOUND)
# Create the imported target for FreeImage if we found it
include(IgnImportTarget)
ign_import_target(FreeImage)
gz_import_target(FreeImage)
endif()

include(FindPackageHandleStandardArgs)
Expand Down Expand Up @@ -141,9 +141,9 @@ else()

if (FreeImage_FOUND)
include(IgnPkgConfig)
ign_pkg_config_library_entry(FreeImage "FreeImage")
gz_pkg_config_library_entry(FreeImage "FreeImage")
include(IgnImportTarget)
ign_import_target(FreeImage)
gz_import_target(FreeImage)
endif()

endif()
8 changes: 4 additions & 4 deletions cmake/FindGTS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
if (NOT WIN32)
# Configuration using pkg-config modules
include(IgnPkgConfig)
ign_pkg_check_modules(GTS gts)
gz_pkg_check_modules(GTS gts)
else()
# true by default, change to false when a failure appears
set(GTS_FOUND true)
Expand Down Expand Up @@ -91,10 +91,10 @@ else()

if (GTS_FOUND)
# We need to manually specify the pkgconfig entry (and type of entry),
# because ign_pkg_check_modules does not work for it.
# because gz_pkg_check_modules does not work for it.
include(IgnPkgConfig)
ign_pkg_config_library_entry(GTS gts)
gz_pkg_config_library_entry(GTS gts)
include(IgnImportTarget)
ign_import_target(GTS)
gz_import_target(GTS)
endif()
endif()
2 changes: 1 addition & 1 deletion cmake/FindIFADDRS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ if(IFADDRS_FOUND)

# Since this is a header-only library, we should import it as an INTERFACE
# target.
ign_import_target(IFADDRS INTERFACE)
gz_import_target(IFADDRS INTERFACE)

endif()

Expand Down
2 changes: 1 addition & 1 deletion cmake/FindIgnBullet.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ set(IgnBullet_FOUND false)
if(BULLET_FOUND)
set(IgnBullet_FOUND true)

ign_import_target(IgnBullet
gz_import_target(IgnBullet
TARGET_NAME IgnBullet::IgnBullet
LIB_VAR BULLET_LIBRARIES
INCLUDE_VAR BULLET_INCLUDE_DIRS
Expand Down
4 changes: 2 additions & 2 deletions cmake/FindIgnCURL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ if(${IgnCURL_FOUND})
include(IgnImportTarget)

if(NOT TARGET curl::curl)
ign_import_target(curl
gz_import_target(curl
LIB_VAR CURL_LIBRARIES
INCLUDE_VAR CURL_INCLUDE_DIRS)
endif()

include(IgnPkgConfig)
ign_pkg_config_entry(IgnCURL "libcurl >= ${IgnCURL_FIND_VERSION}")
gz_pkg_config_entry(IgnCURL "libcurl >= ${IgnCURL_FIND_VERSION}")

endif()
12 changes: 6 additions & 6 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 Expand Up @@ -92,7 +92,7 @@ if (NOT WIN32)
set(OGRE_LIBRARY_DIRS "")
set(OGRE_LIBRARIES "")
set(ENV{PKG_CONFIG_PATH} ${pkg_path})
ign_pkg_check_modules_quiet(OGRE "OGRE >= ${full_version}"
gz_pkg_check_modules_quiet(OGRE "OGRE >= ${full_version}"
NO_CMAKE_ENVIRONMENT_PATH
QUIET)
if (OGRE_FOUND)
Expand Down Expand Up @@ -140,7 +140,7 @@ if (NOT WIN32)

# find ogre components
foreach(component ${IgnOGRE_FIND_COMPONENTS})
ign_pkg_check_modules_quiet(IgnOGRE-${component} "OGRE-${component} >= ${full_version}" NO_CMAKE_ENVIRONMENT_PATH)
gz_pkg_check_modules_quiet(IgnOGRE-${component} "OGRE-${component} >= ${full_version}" NO_CMAKE_ENVIRONMENT_PATH)
if(IgnOGRE-${component}_FOUND)
list(APPEND OGRE_LIBRARIES IgnOGRE-${component}::IgnOGRE-${component})
elseif(IgnOGRE_FIND_REQUIRED_${component})
Expand All @@ -158,7 +158,7 @@ if (NOT WIN32)
set(OGRE_PLUGINDIR ${_pkgconfig_invoke_result})
endif()

ign_pkg_config_library_entry(IgnOGRE OgreMain)
gz_pkg_config_library_entry(IgnOGRE OgreMain)

set(OGRE_RESOURCE_PATH ${OGRE_PLUGINDIR})
# Seems that OGRE_PLUGINDIR can end in a newline, which will cause problems
Expand Down Expand Up @@ -260,7 +260,7 @@ if(OGRE_FOUND)
endforeach()

include(IgnImportTarget)
ign_import_target(IgnOGRE
gz_import_target(IgnOGRE
TARGET_NAME IgnOGRE::IgnOGRE
LIB_VAR OGRE_LIBRARIES
INCLUDE_VAR OGRE_INCLUDE_DIRS)
Expand Down
16 changes: 8 additions & 8 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 Expand Up @@ -155,7 +155,7 @@ if (NOT WIN32)
# Note: OGRE2 installed from debs is named OGRE-2.2 while the version
# installed from source does not have the 2.2 suffix
# look for OGRE2 installed from debs
ign_pkg_check_modules_quiet(${IGN_OGRE2_PROJECT_NAME} ${OGRE2_INSTALL_PATH} NO_CMAKE_ENVIRONMENT_PATH QUIET)
gz_pkg_check_modules_quiet(${IGN_OGRE2_PROJECT_NAME} ${OGRE2_INSTALL_PATH} NO_CMAKE_ENVIRONMENT_PATH QUIET)

if (${IGN_OGRE2_PROJECT_NAME}_FOUND)
set(IGN_PKG_NAME ${OGRE2_INSTALL_PATH})
Expand Down Expand Up @@ -296,7 +296,7 @@ if (NOT WIN32)

set(component_LIBRARY_DIRS ${OGRE2_LIBRARY_DIRS})
set(component_LIBRARIES ${OGRE2-${component}})
ign_import_target(${component} TARGET_NAME ${component_TARGET_NAME}
gz_import_target(${component} TARGET_NAME ${component_TARGET_NAME}
LIB_VAR component_LIBRARIES
INCLUDE_VAR component_INCLUDE_DIRS)

Expand Down Expand Up @@ -338,9 +338,9 @@ if (NOT WIN32)
fix_pkgconfig_resource_path_jammy_bug("${OGRE2_RESOURCE_PATH}" OGRE2_RESOURCE_PATH)

# We need to manually specify the pkgconfig entry (and type of entry),
# because ign_pkg_check_modules does not work for it.
# because gz_pkg_check_modules does not work for it.
include(IgnPkgConfig)
ign_pkg_config_library_entry(IgnOGRE2 OgreMain)
gz_pkg_config_library_entry(IgnOGRE2 OgreMain)
else() #WIN32

set(OGRE2_FOUND TRUE)
Expand Down Expand Up @@ -482,7 +482,7 @@ else() #WIN32

set(component_LIBRARIES ${${PREFIX}_LIBRARIES})

ign_import_target(${component}
gz_import_target(${component}
TARGET_NAME ${component_TARGET_NAME}
LIB_VAR component_LIBRARIES
INCLUDE_VAR component_INCLUDE_DIRS
Expand All @@ -505,7 +505,7 @@ set(IgnOGRE2_FOUND false)
if (OGRE2_FOUND)
set(IgnOGRE2_FOUND true)

ign_import_target(IgnOGRE2
gz_import_target(IgnOGRE2
TARGET_NAME IgnOGRE2::IgnOGRE2
LIB_VAR OGRE2_LIBRARIES
INCLUDE_VAR OGRE2_INCLUDE_DIRS)
Expand Down
14 changes: 7 additions & 7 deletions cmake/FindIgnProtobuf.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
# support shared library versions of Protobuf.

include(IgnPkgConfig)
ign_pkg_config_entry(IgnProtobuf "protobuf >= ${IgnProtobuf_FIND_VERSION}")
gz_pkg_config_entry(IgnProtobuf "protobuf >= ${IgnProtobuf_FIND_VERSION}")

find_package(Protobuf ${IgnProtobuf_FIND_VERSION} QUIET CONFIG)

Expand All @@ -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,22 +76,22 @@ 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
# them here if they have not been provided.
include(IgnImportTarget)

if(NOT TARGET protobuf::libprotobuf)
ign_import_target(protobuf
gz_import_target(protobuf
TARGET_NAME protobuf::libprotobuf
LIB_VAR PROTOBUF_LIBRARY
INCLUDE_VAR PROTOBUF_INCLUDE_DIR)
endif()

if(NOT TARGET protobuf::libprotoc)
ign_import_target(protobuf
gz_import_target(protobuf
TARGET_NAME protobuf::libprotoc
LIB_VAR PROTOBUF_PROTOC_LIBRARY
INCLUDE_VAR PROTOBUF_INCLUDE_DIR)
Expand Down
4 changes: 2 additions & 2 deletions cmake/FindIgnURDFDOM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ if(PKG_CONFIG_FOUND)
else()
set(signature "urdfdom")
endif()
ign_pkg_check_modules(IgnURDFDOM "${signature}")
gz_pkg_check_modules(IgnURDFDOM "${signature}")
else()
message(VERBOSE "Unable to find pkg-config in the system, fallback to use CMake")
endif()
Expand All @@ -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
Loading

0 comments on commit d2c1b2a

Please sign in to comment.