-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ignition-cmake2/ignition-modularscripts/ignition-common3] Add option…
…s, support pkgconfig and fix usage for common3-graph (#25021) * [ignition-common3] Fix usage for graph * version * Apply suggestion * version * Add option OPTIONS, add pkgconfig support, refactor function option declarations * Remove cmake find module installation, add pkgconfig support and fix PRIVATE_FOR limit * Apply suggestions, fix dependency libxml2 * version
- Loading branch information
Showing
12 changed files
with
184 additions
and
15 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
ports/ignition-cmake2/add-pkgconfig-and-remove-privatefor-limit.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
diff --git a/cmake/IgnUtils.cmake b/cmake/IgnUtils.cmake | ||
index bc6dbdc..1e8adbb 100644 | ||
--- a/cmake/IgnUtils.cmake | ||
+++ b/cmake/IgnUtils.cmake | ||
@@ -138,7 +138,7 @@ macro(ign_find_package PACKAGE_NAME) | ||
#------------------------------------ | ||
# Define the expected arguments | ||
set(options REQUIRED PRIVATE EXACT QUIET BUILD_ONLY PKGCONFIG_IGNORE) | ||
- set(oneValueArgs VERSION PRETTY PURPOSE EXTRA_ARGS PKGCONFIG PKGCONFIG_LIB PKGCONFIG_VER_COMPARISON) | ||
+ set(oneValueArgs VERSION PRETTY PURPOSE EXTRA_ARGS PKGCONFIG PKGCONFIG_LIB PKGCONFIG_VER_COMPARISON BY_PKGCONFIG) | ||
set(multiValueArgs REQUIRED_BY PRIVATE_FOR COMPONENTS OPTIONAL_COMPONENTS) | ||
|
||
#------------------------------------ | ||
@@ -183,9 +183,15 @@ macro(ign_find_package PACKAGE_NAME) | ||
endif() | ||
|
||
|
||
+ if (NOT ign_find_package_BY_PKGCONFIG) | ||
#------------------------------------ | ||
# Call find_package with the provided arguments | ||
find_package(${${PACKAGE_NAME}_find_package_args}) | ||
+ else() | ||
+ find_package(PkgConfig REQUIRED) | ||
+ include(FindPkgConfig) | ||
+ pkg_check_modules(${PACKAGE_NAME} ${ign_find_package_BY_PKGCONFIG}) | ||
+ endif() | ||
|
||
if(${PACKAGE_NAME}_FOUND) | ||
|
||
@@ -300,17 +306,11 @@ macro(ign_find_package PACKAGE_NAME) | ||
endif() | ||
|
||
if(ign_find_package_REQUIRED_BY) | ||
- | ||
- # Identify which components are privately requiring this package | ||
- foreach(component ${ign_find_package_PRIVATE_FOR}) | ||
- set(${component}_${PACKAGE_NAME}_PRIVATE true) | ||
- endforeach() | ||
- | ||
# If this is required by some components, add it to the | ||
# ${component}_CMAKE_DEPENDENCIES variables that are specific to those | ||
# componenets | ||
foreach(component ${ign_find_package_REQUIRED_BY}) | ||
- if(NOT ${component}_${PACKAGE_NAME}_PRIVATE) | ||
+ if(NOT ign_find_package_BY_PKGCONFIG) | ||
ign_string_append(${component}_CMAKE_DEPENDENCIES "${${PACKAGE_NAME}_find_dependency}" DELIM "\n") | ||
endif() | ||
endforeach() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 73920fe..8bee7fe 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -52,7 +52,7 @@ set(IGN_MATH_VER ${ignition-math6_VERSION_MAJOR}) | ||
#-------------------------------------- | ||
# Find Tinyxml2 | ||
if(USE_EXTERNAL_TINYXML2) | ||
- ign_find_package(TINYXML2 PRETTY tinyxml2 | ||
+ ign_find_package(tinyxml2 EXTRA_ARGS CONFIG | ||
REQUIRED_BY graphics | ||
PRIVATE_FOR graphics) | ||
else() | ||
@@ -70,13 +70,13 @@ if(NOT MSVC) | ||
|
||
#------------------------------------ | ||
# Find uuid | ||
- ign_find_package(UUID REQUIRED PRETTY uuid) | ||
+ ign_find_package(UUID REQUIRED PRETTY uuid REQUIRED_BY graphics) | ||
|
||
endif() | ||
|
||
#------------------------------------ | ||
# Find Freeimage | ||
-ign_find_package(FreeImage VERSION 3.9 | ||
+ign_find_package(freeimage EXTRA_ARGS CONFIG | ||
REQUIRED_BY graphics | ||
PRIVATE_FOR graphics) | ||
|
||
@@ -84,6 +84,7 @@ ign_find_package(FreeImage VERSION 3.9 | ||
# Find GNU Triangulation Surface Library | ||
ign_find_package( | ||
GTS PRETTY gts PURPOSE "GNU Triangulation Surface library" | ||
+ BY_PKGCONFIG gts | ||
REQUIRED_BY graphics | ||
PRIVATE_FOR graphics) | ||
|
||
diff --git a/graphics/src/CMakeLists.txt b/graphics/src/CMakeLists.txt | ||
index 000a0ce..f6e1831 100644 | ||
--- a/graphics/src/CMakeLists.txt | ||
+++ b/graphics/src/CMakeLists.txt | ||
@@ -16,8 +16,10 @@ target_link_libraries(${graphics_target} | ||
PUBLIC | ||
ignition-math${IGN_MATH_VER}::ignition-math${IGN_MATH_VER} | ||
PRIVATE | ||
- GTS::GTS | ||
- FreeImage::FreeImage) | ||
+ ${GTS_LINK_LIBRARIES} | ||
+ freeimage::FreeImage) | ||
+ | ||
+target_include_directories(${graphics_target} PRIVATE ${GTS_INCLUDE_DIRS}) | ||
|
||
ign_build_tests(TYPE UNIT SOURCES ${gtest_sources} | ||
LIB_DEPS ${graphics_target}) | ||
@@ -28,13 +30,13 @@ if(USE_EXTERNAL_TINYXML2) | ||
# If we are using an external copy of tinyxml2, add its imported target | ||
target_link_libraries(${graphics_target} | ||
PRIVATE | ||
- TINYXML2::TINYXML2) | ||
+ tinyxml2::tinyxml2) | ||
|
||
# The collada exporter test uses tinyxml2, so we must link it if we're using | ||
# an external copy. The graphics target considers tinyxml2 to be a private | ||
# dependency, so it will not automatically get linked to this test. | ||
if(TARGET UNIT_ColladaExporter_TEST) | ||
- target_link_libraries(UNIT_ColladaExporter_TEST TINYXML2::TINYXML2) | ||
+ target_link_libraries(UNIT_ColladaExporter_TEST tinyxml2::tinyxml2) | ||
endif() | ||
|
||
else() | ||
@@ -62,8 +64,8 @@ endif() | ||
|
||
# define of tinxml2 major version >= 6 | ||
# https://github.com/ignitionrobotics/ign-common/issues/28 | ||
-if (NOT TINYXML2_VERSION VERSION_LESS "6.0.0") | ||
- message(STATUS "TINYXML2_VERSION ${TINYXML2_VERSION} >= 6.0.0") | ||
+if (NOT tinyxml2_VERSION VERSION_LESS "6.0.0") | ||
+ message(STATUS "TINYXML2_VERSION ${tinyxml2_VERSION} >= 6.0.0") | ||
target_compile_definitions(${graphics_target} | ||
PRIVATE "TINYXML2_MAJOR_VERSION_GE_6") | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{ | ||
"name": "ignition-modularscripts", | ||
"version-date": "2022-05-11", | ||
"port-version": 1, | ||
"description": "Vcpkg helpers to package ignition libraries", | ||
"license": null | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters