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 FindXXX migration : gz-cmake #273

Merged
merged 2 commits into from
Jul 10, 2022
Merged
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
22 changes: 11 additions & 11 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
1. Fix check for missing components in OGRE2. Be more verbose with components
* [Pull request #220](https://github.com/gazebosim/gz-cmake/pull/220)

1. FindIgnOGRE2: exclude ogre versions different than 2.x
1. FindGzOGRE2: exclude ogre versions different than 2.x
* [Pull request #219](https://github.com/gazebosim/gz-cmake/pull/219)
* [Pull request #221](https://github.com/gazebosim/gz-cmake/pull/221)

Expand Down Expand Up @@ -52,7 +52,7 @@
1. Add Ubuntu Jammy CI
* [Pull request #194](https://github.com/gazebosim/gz-cmake/pull/194)

1. FindIgnURDFDOM cmake module
1. FindGzURDFDOM cmake module
* [Pull request #193](https://github.com/gazebosim/gz-cmake/pull/193)

1. Do not modify `CMAKE_FIND_LIBRARY_PREFIXES` and `CMAKE_FIND_LIBRARY_SUFFIXES` on Windows
Expand Down Expand Up @@ -115,7 +115,7 @@
1. Fix cmake message types
* [Pull request #159](https://github.com/gazebosim/gz-cmake/pull/159)

1. Support imported targets in FindIgnOGRE.cmake
1. Support imported targets in FindGzOGRE.cmake
* [Pull request #150](https://github.com/gazebosim/gz-cmake/pull/150)

1. Infrastructure
Expand Down Expand Up @@ -176,10 +176,10 @@
1. Added build-essential and cmake to packages.apt
* [Pull request 130](https://github.com/gazebosim/gz-cmake/pull/130)

1. Fix FindIgnOgre on Windows when not using vcpkg
1. Fix FindGzOgre on Windows when not using vcpkg
* [Pull request 124](https://github.com/gazebosim/gz-cmake/pull/124)

1. FindIgnOGRE2: prefer versioned component libraries
1. FindGzOGRE2: prefer versioned component libraries
* [Pull request 125](https://github.com/gazebosim/gz-cmake/pull/125)

1. Correct CMake logic and update cpplint to Python3
Expand Down Expand Up @@ -209,7 +209,7 @@
1. Fix use of FindYAML.cmake and FindJSONCPP without pkg-config
* [Pull request 79](https://github.com/gazebosim/gz-cmake/pull/79)

1. Fix use of FindIgnOGRE2 on Windows if OGRE2 is not found
1. Fix use of FindGzOGRE2 on Windows if OGRE2 is not found
* [Pull request 94](https://github.com/gazebosim/gz-cmake/pull/94)
* Thanks to Silvio Traversaro

Expand Down Expand Up @@ -243,14 +243,14 @@
1. Set viewport for doxygen pages.
* [BitBucket pull request 167](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-cmake/pull-requests/167)

1. Use upstream `CURL::libcurl` imported target in FindIgnCURL.cmake if available.
1. Use upstream `CURL::libcurl` imported target in FindGzCURL.cmake if available.
* [BitBucket pull request 175](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-cmake/pull-requests/175)

1. Avoid hardcoding /machine:x64 flag on 64-bit on MSVC.
* [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. FindIgnOGRE2: fix include paths for new directory structure.
1. FindGzOGRE2: fix include paths for new directory structure.
* [BitBucket pull request 170](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-cmake/pull-requests/170)
* [BitBucket pull request 157](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-cmake/pull-requests/157)

Expand All @@ -261,7 +261,7 @@
1. IgnConfigureBuild: 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 FindIgnBullet cmake module.
1. Add FindGzBullet cmake module.
* [BitBucket pull request 162](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-cmake/pull-requests/162)

### Gazebo CMake 2.1.1 (2019-08-07)
Expand Down Expand Up @@ -308,7 +308,7 @@
1. Set viewport for doxygen pages.
* [BitBucket pull request 167](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-cmake/pull-requests/167)

1. Use upstream `CURL::libcurl` imported target in FindIgnCURL.cmake if available.
1. Use upstream `CURL::libcurl` imported target in FindGzCURL.cmake if available.
* [BitBucket pull request 175](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-cmake/pull-requests/175)

1. Avoid hardcoding /machine:x64 flag on 64-bit on MSVC.
Expand Down Expand Up @@ -339,7 +339,7 @@
1. Set viewport for doxygen pages.
* [BitBucket pull request 167](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-cmake/pull-requests/167)

1. Use upstream `CURL::libcurl` imported target in FindIgnCURL.cmake if available.
1. Use upstream `CURL::libcurl` imported target in FindGzCURL.cmake if available.
* [BitBucket pull request 175](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-cmake/pull-requests/175)

1. Avoid hardcoding /machine:x64 flag on 64-bit on MSVC.
Expand Down
12 changes: 7 additions & 5 deletions cmake/FindIgnBullet.cmake → cmake/FindGzBullet.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
########################################

set(gz_quiet_arg)
if(IgnBullet_FIND_QUIETLY)
if(GzBullet_FIND_QUIETLY)
set(gz_quiet_arg QUIET)
endif()

Expand All @@ -33,14 +33,16 @@ endif()
# with Bullet, which uses relative paths and may break transitive dependencies.
find_package(Bullet MODULE ${gz_quiet_arg})

set(IgnBullet_FOUND false)
set(GzBullet_FOUND false)
# create Bullet target
if(BULLET_FOUND)
set(IgnBullet_FOUND true)
set(GzBullet_FOUND true)

gz_import_target(IgnBullet
TARGET_NAME IgnBullet::IgnBullet
gz_import_target(GzBullet
TARGET_NAME GzBullet::GzBullet
LIB_VAR BULLET_LIBRARIES
INCLUDE_VAR BULLET_INCLUDE_DIRS
)
endif()

set(IgnBullet_FOUND ${GzBullet_FOUND}) # TODO(CH3): Deprecated. Remove on tock.
32 changes: 19 additions & 13 deletions cmake/FindIgnCURL.cmake → cmake/FindGzCURL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,31 +18,37 @@
#
# Usage of this module as follows:
#
# find_package(IgnCURL)
# find_package(GzCURL)
#
# Variables defined by this module:
#
# curl::curl Imported target for libcurl
#
# IgnCURL_FOUND System has CURL libs/headers
# IgnCURL_INCLUDE_DIRS The location of CURL headers
# IgnCURL_LIBRARIES The CURL libraries
# IgnCURL_VERSION The version of CURL found
# GzCURL_FOUND System has CURL libs/headers
# GzCURL_INCLUDE_DIRS The location of CURL headers
# GzCURL_LIBRARIES The CURL libraries
# GzCURL_VERSION The version of CURL found

set(gz_quiet_arg)
if(IgnCURL_FIND_QUIETLY)
if(GzCURL_FIND_QUIETLY)
set(gz_quiet_arg QUIET)
endif()

find_package(CURL ${IgnCURL_FIND_VERSION} ${gz_quiet_arg})
find_package(CURL ${GzCURL_FIND_VERSION} ${gz_quiet_arg})

set(IgnCURL_FOUND ${CURL_FOUND})
set(GzCURL_FOUND ${CURL_FOUND})
set(IgnCURL_FOUND ${GzCURL_FOUND}) # TODO(CH3): Deprecated. Remove on tock.

if(${IgnCURL_FOUND})
if(${GzCURL_FOUND})

set(IgnCURL_INCLUDE_DIRS ${CURL_INCLUDE_DIRS})
set(IgnCURL_LIBRARIES ${CURL_LIBRARIES})
set(IgnCURL_VERSION ${CURL_VERSION_STRING})
set(GzCURL_INCLUDE_DIRS ${CURL_INCLUDE_DIRS})
set(GzCURL_LIBRARIES ${CURL_LIBRARIES})
set(GzCURL_VERSION ${CURL_VERSION_STRING})

# TODO(CH3): Deprecated. Remove on tock.
set(IgnCURL_INCLUDE_DIRS ${GzCURL_INCLUDE_DIRS})
set(IgnCURL_LIBRARIES ${GzCURL_LIBRARIES})
set(IgnCURL_VERSION ${GzCURL_VERSION})

# Older versions of curl don't create imported targets, so we will create
# them here if they have not been provided.
Expand All @@ -61,6 +67,6 @@ if(${IgnCURL_FOUND})
endif()

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

endif()
42 changes: 22 additions & 20 deletions cmake/FindIgnOGRE.cmake → cmake/FindGzOGRE.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#
# Usage of this module as follows:
#
# gz_find_package(IgnOGRE)
# gz_find_package(GzOGRE)
#
# Variables defined by this module:
#
Expand All @@ -32,7 +32,7 @@
# OGRE_VERSION_MINOR OGRE minor version
# OGRE_VERSION_PATCH OGRE patch version
# OGRE_RESOURCE_PATH Path to ogre plugins directory
# IgnOGRE::IgnOGRE Imported target for OGRE
# GzOGRE::GzOGRE Imported target for OGRE
#
# On Windows, we assume that all the OGRE* defines are passed in manually
# to CMake.
Expand All @@ -41,13 +41,13 @@
#
# Example usage:
#
# gz_find_package(IgnOGRE
# gz_find_package(GzOGRE
# VERSION 1.8.0
# COMPONENTS RTShaderSystem Terrain Overlay)

# Grab the version numbers requested by the call to find_package(~)
set(major_version ${IgnOGRE_FIND_VERSION_MAJOR})
set(minor_version ${IgnOGRE_FIND_VERSION_MINOR})
set(major_version ${GzOGRE_FIND_VERSION_MAJOR})
set(minor_version ${GzOGRE_FIND_VERSION_MINOR})

# Set the full version number
set(full_version ${major_version}.${minor_version})
Expand All @@ -69,7 +69,7 @@ if (NOT WIN32)
OUTPUT_VARIABLE _pkgconfig_invoke_result
RESULT_VARIABLE _pkgconfig_failed)
if(_pkgconfig_failed)
IGN_BUILD_WARNING ("Failed to get pkg-config search paths")
GZ_BUILD_WARNING ("Failed to get pkg-config search paths")
elseif (NOT _pkgconfig_invoke_result STREQUAL "")
set (PKG_CONFIG_PATH_TMP "${PKG_CONFIG_PATH_TMP}:${_pkgconfig_invoke_result}")
endif()
Expand Down Expand Up @@ -105,7 +105,7 @@ if (NOT WIN32)
OUTPUT_VARIABLE _pkgconfig_invoke_result
RESULT_VARIABLE _pkgconfig_failed)
if(_pkgconfig_failed)
IGN_BUILD_WARNING ("Failed to find OGRE's library directory. The build will succeed, but there will likely be run-time errors.")
GZ_BUILD_WARNING ("Failed to find OGRE's library directory. The build will succeed, but there will likely be run-time errors.")
else()
# set ogre library dir and strip line break
set(OGRE_LIBRARY_DIRS ${_pkgconfig_invoke_result})
Expand Down Expand Up @@ -139,11 +139,11 @@ if (NOT WIN32)
OGRE_VERSION_PATCH ${OGRE_VERSION})

# find ogre components
foreach(component ${IgnOGRE_FIND_COMPONENTS})
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})
foreach(component ${GzOGRE_FIND_COMPONENTS})
gz_pkg_check_modules_quiet(GzOGRE-${component} "OGRE-${component} >= ${full_version}" NO_CMAKE_ENVIRONMENT_PATH)
if(GzOGRE-${component}_FOUND)
list(APPEND OGRE_LIBRARIES GzOGRE-${component}::GzOGRE-${component})
elseif(GzOGRE_FIND_REQUIRED_${component})
set(OGRE_FOUND false)
endif()
endforeach()
Expand All @@ -152,13 +152,13 @@ if (NOT WIN32)
OUTPUT_VARIABLE _pkgconfig_invoke_result
RESULT_VARIABLE _pkgconfig_failed)
if(_pkgconfig_failed)
IGN_BUILD_WARNING ("Failed to find OGRE's plugin directory. The build will succeed, but there will likely be run-time errors.")
GZ_BUILD_WARNING ("Failed to find OGRE's plugin directory. The build will succeed, but there will likely be run-time errors.")
else()
# This variable will be substituted into cmake/setup.sh.in
set(OGRE_PLUGINDIR ${_pkgconfig_invoke_result})
endif()

gz_pkg_config_library_entry(IgnOGRE OgreMain)
gz_pkg_config_library_entry(GzOGRE OgreMain)

set(OGRE_RESOURCE_PATH ${OGRE_PLUGINDIR})
# Seems that OGRE_PLUGINDIR can end in a newline, which will cause problems
Expand All @@ -171,12 +171,12 @@ if (NOT WIN32)

else()
find_package(OGRE ${full_version}
COMPONENTS ${IgnOGRE_FIND_COMPONENTS})
COMPONENTS ${GzOGRE_FIND_COMPONENTS})
if(OGRE_FOUND)
# OGREConfig.cmake from vcpkg disable the link against plugin libs
# when compiling the shared version of it. Here we copied the code
# to use it.
foreach(ogre_component ${IgnOGRE_FIND_COMPONENTS})
foreach(ogre_component ${GzOGRE_FIND_COMPONENTS})
if(ogre_component MATCHES "Plugin_" OR ogre_component MATCHES "RenderSystem_")
string(LENGTH "${ogre_component}" len)
string(FIND "${ogre_component}" "_" split_pos)
Expand Down Expand Up @@ -239,9 +239,9 @@ else()
endif()
endif()

set(IgnOGRE_FOUND false)
set(GzOGRE_FOUND false)
if(OGRE_FOUND)
set(IgnOGRE_FOUND true)
set(GzOGRE_FOUND true)

# manually search and append the the RenderSystem/GL path to
# OGRE_INCLUDE_DIRS so OGRE GL headers can be found
Expand All @@ -260,8 +260,10 @@ if(OGRE_FOUND)
endforeach()

include(IgnImportTarget)
gz_import_target(IgnOGRE
TARGET_NAME IgnOGRE::IgnOGRE
gz_import_target(GzOGRE
TARGET_NAME GzOGRE::GzOGRE
LIB_VAR OGRE_LIBRARIES
INCLUDE_VAR OGRE_INCLUDE_DIRS)
endif()

set(IgnOGRE_FOUND ${GzOGRE_FOUND}) # TODO(CH3): Deprecated. Remove on tock.
Loading