[ignition-modularscripts] Disable docs, reduce warnings, update style (#31309)

* [ignition-modularscripts] CMake style update

* Add MAYBE_UNUSED_VARIABLES

* Don't build docs (unless overriden)

* Require install for host
This commit is contained in:
Kai Pastor 2023-05-09 01:01:29 +02:00 committed by GitHub
parent 1f94beda2b
commit 9a5e44fcc1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 32 additions and 24 deletions

View File

@ -5,15 +5,20 @@ function(ignition_modular_build_library)
set(options DISABLE_PKGCONFIG_INSTALL) set(options DISABLE_PKGCONFIG_INSTALL)
set(oneValueArgs NAME MAJOR_VERSION SOURCE_PATH CMAKE_PACKAGE_NAME DEFAULT_CMAKE_PACKAGE_NAME) set(oneValueArgs NAME MAJOR_VERSION SOURCE_PATH CMAKE_PACKAGE_NAME DEFAULT_CMAKE_PACKAGE_NAME)
set(multiValueArgs OPTIONS) set(multiValueArgs OPTIONS)
cmake_parse_arguments(IML "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) cmake_parse_arguments(PARSE_ARGV 0 IML "${options}" "${oneValueArgs}" "${multiValueArgs}")
vcpkg_find_acquire_program(PKGCONFIG) vcpkg_find_acquire_program(PKGCONFIG)
vcpkg_cmake_configure( vcpkg_cmake_configure(
SOURCE_PATH "${IML_SOURCE_PATH}" SOURCE_PATH "${IML_SOURCE_PATH}"
DISABLE_PARALLEL_CONFIGURE DISABLE_PARALLEL_CONFIGURE
OPTIONS OPTIONS
"-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}" "-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}"
-DBUILD_DOCS=OFF
-DBUILD_TESTING=OFF -DBUILD_TESTING=OFF
${IML_OPTIONS} ${IML_OPTIONS}
MAYBE_UNUSED_VARIABLES
BUILD_DOCS
BUILD_TESTING
PKG_CONFIG_EXECUTABLE
) )
vcpkg_cmake_install(ADD_BIN_TO_PATH) vcpkg_cmake_install(ADD_BIN_TO_PATH)
@ -29,7 +34,7 @@ function(ignition_modular_build_library)
foreach(COMPONENT_CMAKE_PACKAGE_NAME IN LISTS COMPONENTS_CMAKE_PACKAGE_NAMES) foreach(COMPONENT_CMAKE_PACKAGE_NAME IN LISTS COMPONENTS_CMAKE_PACKAGE_NAMES)
vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/${COMPONENT_CMAKE_PACKAGE_NAME}" vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/${COMPONENT_CMAKE_PACKAGE_NAME}"
PACKAGE_NAME ${COMPONENT_CMAKE_PACKAGE_NAME} PACKAGE_NAME "${COMPONENT_CMAKE_PACKAGE_NAME}"
DO_NOT_DELETE_PARENT_CONFIG_PATH) DO_NOT_DELETE_PARENT_CONFIG_PATH)
endforeach() endforeach()
@ -48,10 +53,7 @@ function(ignition_modular_build_library)
# Make pkg-config files relocatable # Make pkg-config files relocatable
if(NOT IML_DISABLE_PKGCONFIG_INSTALL) if(NOT IML_DISABLE_PKGCONFIG_INSTALL)
if(VCPKG_TARGET_IS_LINUX) vcpkg_fixup_pkgconfig()
set(SYSTEM_LIBRARIES SYSTEM_LIBRARIES pthread)
endif()
vcpkg_fixup_pkgconfig(${SYSTEM_LIBRARIES})
else() else()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib/pkgconfig" file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib/pkgconfig"
"${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig") "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig")
@ -121,9 +123,9 @@ function(ignition_modular_library)
set(options DISABLE_PKGCONFIG_INSTALL) set(options DISABLE_PKGCONFIG_INSTALL)
set(oneValueArgs NAME VERSION SHA512 REF HEAD_REF CMAKE_PACKAGE_NAME) set(oneValueArgs NAME VERSION SHA512 REF HEAD_REF CMAKE_PACKAGE_NAME)
set(multiValueArgs PATCHES OPTIONS) set(multiValueArgs PATCHES OPTIONS)
cmake_parse_arguments(IML "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) cmake_parse_arguments(PARSE_ARGV 0 IML "${options}" "${oneValueArgs}" "${multiValueArgs}")
string(REPLACE "." ";" IML_VERSION_LIST ${IML_VERSION}) string(REPLACE "." ";" IML_VERSION_LIST "${IML_VERSION}")
list(GET IML_VERSION_LIST 0 IML_MAJOR_VERSION) list(GET IML_VERSION_LIST 0 IML_MAJOR_VERSION)
# If the REF option is omitted, use the canonical one # If the REF option is omitted, use the canonical one
@ -139,32 +141,33 @@ function(ignition_modular_library)
# If the CMAKE_PACKAGE_NAME option is omitted, use the canonical one # If the CMAKE_PACKAGE_NAME option is omitted, use the canonical one
set(DEFAULT_CMAKE_PACKAGE_NAME "ignition-${IML_NAME}${IML_MAJOR_VERSION}") set(DEFAULT_CMAKE_PACKAGE_NAME "ignition-${IML_NAME}${IML_MAJOR_VERSION}")
if(NOT DEFINED IML_CMAKE_PACKAGE_NAME) if(NOT DEFINED IML_CMAKE_PACKAGE_NAME)
set(IML_CMAKE_PACKAGE_NAME ${DEFAULT_CMAKE_PACKAGE_NAME}) set(IML_CMAKE_PACKAGE_NAME "${DEFAULT_CMAKE_PACKAGE_NAME}")
endif() endif()
# Download library from github, to support also the --head option # Download library from github, to support also the --head option
vcpkg_from_github( vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH OUT_SOURCE_PATH SOURCE_PATH
REPO ignitionrobotics/ign-${IML_NAME} REPO "ignitionrobotics/ign-${IML_NAME}"
REF ${IML_REF} REF "${IML_REF}"
SHA512 ${IML_SHA512} SHA512 "${IML_SHA512}"
HEAD_REF ${IML_HEAD_REF} HEAD_REF "${IML_HEAD_REF}"
PATCHES ${IML_PATCHES} PATCHES ${IML_PATCHES}
FILE_DISAMBIGUATOR 1 FILE_DISAMBIGUATOR 1
) )
set(extra_arguments "")
if (IML_DISABLE_PKGCONFIG_INSTALL) if (IML_DISABLE_PKGCONFIG_INSTALL)
set(EXTRA_OPTIONS DISABLE_PKGCONFIG_INSTALL) list(APPEND extra_arguments DISABLE_PKGCONFIG_INSTALL)
endif() endif()
# Build library # Build library
ignition_modular_build_library( ignition_modular_build_library(
NAME ${IML_NAME} NAME "${IML_NAME}"
MAJOR_VERSION ${IML_MAJOR_VERSION} MAJOR_VERSION "${IML_MAJOR_VERSION}"
SOURCE_PATH ${SOURCE_PATH} SOURCE_PATH "${SOURCE_PATH}"
CMAKE_PACKAGE_NAME ${IML_CMAKE_PACKAGE_NAME} CMAKE_PACKAGE_NAME "${IML_CMAKE_PACKAGE_NAME}"
DEFAULT_CMAKE_PACKAGE_NAME ${DEFAULT_CMAKE_PACKAGE_NAME} DEFAULT_CMAKE_PACKAGE_NAME "${DEFAULT_CMAKE_PACKAGE_NAME}"
${EXTRA_OPTIONS} ${extra_arguments}
OPTIONS ${IML_OPTIONS} OPTIONS ${IML_OPTIONS}
) )
endfunction() endfunction()

View File

@ -1,9 +1,9 @@
{ {
"name": "ignition-modularscripts", "name": "ignition-modularscripts",
"version-date": "2022-05-11", "version-date": "2023-05-05",
"port-version": 2,
"description": "Vcpkg helpers to package ignition libraries", "description": "Vcpkg helpers to package ignition libraries",
"license": null, "license": null,
"supports": "native",
"dependencies": [ "dependencies": [
{ {
"name": "vcpkg-cmake", "name": "vcpkg-cmake",

View File

@ -3229,8 +3229,8 @@
"port-version": 1 "port-version": 1
}, },
"ignition-modularscripts": { "ignition-modularscripts": {
"baseline": "2022-05-11", "baseline": "2023-05-05",
"port-version": 2 "port-version": 0
}, },
"ignition-msgs1": { "ignition-msgs1": {
"baseline": "1.0.0", "baseline": "1.0.0",

View File

@ -1,5 +1,10 @@
{ {
"versions": [ "versions": [
{
"git-tree": "f770940cc2085c2f24a1673730fd8d642b49717f",
"version-date": "2023-05-05",
"port-version": 0
},
{ {
"git-tree": "bc5dc2fa00b5023e9f2fa1610a986e8d61874380", "git-tree": "bc5dc2fa00b5023e9f2fa1610a986e8d61874380",
"version-date": "2022-05-11", "version-date": "2022-05-11",