diff --git a/ports/ignition-modularscripts/CONTROL b/ports/ignition-modularscripts/CONTROL index 98ceba1af5e4c5..1509631e9133ef 100644 --- a/ports/ignition-modularscripts/CONTROL +++ b/ports/ignition-modularscripts/CONTROL @@ -1,4 +1,3 @@ Source: ignition-modularscripts -Version: 2020-05-16 -Port-Version: 2 +Version: 2020-11-08 Description: Vcpkg helpers to package ignition libraries diff --git a/ports/ignition-modularscripts/ignition_modular_library.cmake b/ports/ignition-modularscripts/ignition_modular_library.cmake index 77506bb3be344d..b23d34568b4419 100644 --- a/ports/ignition-modularscripts/ignition_modular_library.cmake +++ b/ports/ignition-modularscripts/ignition_modular_library.cmake @@ -1,62 +1,3 @@ - -function(ignition_modular_build_library NAME MAJOR_VERSION SOURCE_PATH CMAKE_PACKAGE_NAME DEFAULT_CMAKE_PACKAGE_NAME IML_DISABLE_PKGCONFIG_INSTALL) - vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA - DISABLE_PARALLEL_CONFIGURE - OPTIONS -DBUILD_TESTING=OFF - ) - - vcpkg_install_cmake() - - # If necessary, move the CMake config files - if(EXISTS "${CURRENT_PACKAGES_DIR}/lib/cmake") - # Some ignition libraries install library subcomponents, that are effectively additional cmake packages - # with name ${CMAKE_PACKAGE_NAME}-${COMPONENT_NAME}, so it is needed to call vcpkg_fixup_cmake_targets for them as well - file(GLOB COMPONENTS_CMAKE_PACKAGE_NAMES - LIST_DIRECTORIES TRUE - RELATIVE "${CURRENT_PACKAGES_DIR}/lib/cmake/" - "${CURRENT_PACKAGES_DIR}/lib/cmake/*") - - foreach(COMPONENT_CMAKE_PACKAGE_NAME IN LISTS COMPONENTS_CMAKE_PACKAGE_NAMES) - vcpkg_fixup_cmake_targets(CONFIG_PATH "lib/cmake/${COMPONENT_CMAKE_PACKAGE_NAME}" - TARGET_PATH "share/${COMPONENT_CMAKE_PACKAGE_NAME}" - DO_NOT_DELETE_PARENT_CONFIG_PATH) - endforeach() - - file(GLOB_RECURSE CMAKE_RELEASE_FILES - "${CURRENT_PACKAGES_DIR}/lib/cmake/${CMAKE_PACKAGE_NAME}/*") - - file(COPY ${CMAKE_RELEASE_FILES} DESTINATION - "${CURRENT_PACKAGES_DIR}/share/${CMAKE_PACKAGE_NAME}/") - endif() - - # Remove unused files files - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/cmake - ${CURRENT_PACKAGES_DIR}/debug/include - ${CURRENT_PACKAGES_DIR}/debug/lib/cmake - ${CURRENT_PACKAGES_DIR}/debug/share) - - # Make pkg-config files relocatable - if(NOT IML_DISABLE_PKGCONFIG_INSTALL) - if(VCPKG_TARGET_IS_LINUX) - set(SYSTEM_LIBRARIES SYSTEM_LIBRARIES pthread) - endif() - vcpkg_fixup_pkgconfig(${SYSTEM_LIBRARIES}) - else() - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/pkgconfig - ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig) - endif() - - # Find the relevant license file and install it - if(EXISTS "${SOURCE_PATH}/LICENSE") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE") - elseif(EXISTS "${SOURCE_PATH}/README.md") - set(LICENSE_PATH "${SOURCE_PATH}/README.md") - endif() - file(INSTALL ${LICENSE_PATH} DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) -endfunction() - ## # ignition_modular_library ## ## Download and build a library from the Ignition Robotics project ( https://ignitionrobotics.org/ ). @@ -70,7 +11,8 @@ endfunction() ## [HEAD_REF ] ## [PATCHES ] ## [CMAKE_PACKAGE_NAME ] -## [DISABLE_PKGCONFIG_INSTALL]) +## [DISABLE_PKGCONFIG_INSTALL] +## [CMAKE_OPTIONS ]) ## ``` ## ## ## Parameters: @@ -102,6 +44,9 @@ endfunction() ## ### DISABLE_PKGCONFIG_INSTALL ## If present, disable installation of .pc pkg-config configuration files. ## +## ### CMAKE_OPTIONS +## If present, pass along the specified CMAKE_OPTIONS to the CMake invocation. +## This is appended to the OPTIONS argument vcpkg_configure_cmake call. ## ## ## Examples: ## @@ -111,7 +56,7 @@ endfunction() function(ignition_modular_library) set(options DISABLE_PKGCONFIG_INSTALL) set(oneValueArgs NAME VERSION SHA512 REF HEAD_REF CMAKE_PACKAGE_NAME) - set(multiValueArgs PATCHES) + set(multiValueArgs PATCHES CMAKE_OPTIONS) cmake_parse_arguments(IML "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) string(REPLACE "." ";" IML_VERSION_LIST ${IML_VERSION}) @@ -143,6 +88,59 @@ function(ignition_modular_library) PATCHES ${IML_PATCHES} ) - # Build library - ignition_modular_build_library(${IML_NAME} ${IML_MAJOR_VERSION} ${SOURCE_PATH} ${IML_CMAKE_PACKAGE_NAME} ${DEFAULT_CMAKE_PACKAGE_NAME} ${IML_DISABLE_PKGCONFIG_INSTALL}) + vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + DISABLE_PARALLEL_CONFIGURE + OPTIONS -DBUILD_TESTING=OFF ${IML_CMAKE_OPTIONS} + ) + + vcpkg_install_cmake() + + # If necessary, move the CMake config files + if(EXISTS "${CURRENT_PACKAGES_DIR}/lib/cmake") + # Some ignition libraries install library subcomponents, that are effectively additional cmake packages + # with name ${CMAKE_PACKAGE_NAME}-${COMPONENT_NAME}, so it is needed to call vcpkg_fixup_cmake_targets for them as well + file(GLOB COMPONENTS_CMAKE_PACKAGE_NAMES + LIST_DIRECTORIES TRUE + RELATIVE "${CURRENT_PACKAGES_DIR}/lib/cmake/" + "${CURRENT_PACKAGES_DIR}/lib/cmake/*") + + foreach(COMPONENT_CMAKE_PACKAGE_NAME IN LISTS COMPONENTS_CMAKE_PACKAGE_NAMES) + vcpkg_fixup_cmake_targets(CONFIG_PATH "lib/cmake/${COMPONENT_CMAKE_PACKAGE_NAME}" + TARGET_PATH "share/${COMPONENT_CMAKE_PACKAGE_NAME}" + DO_NOT_DELETE_PARENT_CONFIG_PATH) + endforeach() + + file(GLOB_RECURSE CMAKE_RELEASE_FILES + "${CURRENT_PACKAGES_DIR}/lib/cmake/${CMAKE_PACKAGE_NAME}/*") + + file(COPY ${CMAKE_RELEASE_FILES} DESTINATION + "${CURRENT_PACKAGES_DIR}/share/${CMAKE_PACKAGE_NAME}/") + endif() + + # Remove unused files files + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/cmake + ${CURRENT_PACKAGES_DIR}/debug/include + ${CURRENT_PACKAGES_DIR}/debug/lib/cmake + ${CURRENT_PACKAGES_DIR}/debug/share) + + # Make pkg-config files relocatable + if(NOT IML_DISABLE_PKGCONFIG_INSTALL) + if(VCPKG_TARGET_IS_LINUX) + set(SYSTEM_LIBRARIES SYSTEM_LIBRARIES pthread) + endif() + vcpkg_fixup_pkgconfig(${SYSTEM_LIBRARIES}) + else() + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/pkgconfig + ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig) + endif() + + # Find the relevant license file and install it + if(EXISTS "${SOURCE_PATH}/LICENSE") + set(LICENSE_PATH "${SOURCE_PATH}/LICENSE") + elseif(EXISTS "${SOURCE_PATH}/README.md") + set(LICENSE_PATH "${SOURCE_PATH}/README.md") + endif() + file(INSTALL ${LICENSE_PATH} DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) endfunction() diff --git a/ports/ignition-msgs1/CONTROL b/ports/ignition-msgs1/CONTROL index 1581a5c30f9105..653c5ea94aa48a 100644 --- a/ports/ignition-msgs1/CONTROL +++ b/ports/ignition-msgs1/CONTROL @@ -1,5 +1,5 @@ Source: ignition-msgs1 Version: 1.0.0 -Port-Version: 2 +Port-Version: 3 Build-Depends: ignition-cmake0, ignition-math4, protobuf Description: Middleware protobuf messages for robotics diff --git a/ports/ignition-msgs1/portfile.cmake b/ports/ignition-msgs1/portfile.cmake index d206ded1210075..8fe6223f6d8cea 100644 --- a/ports/ignition-msgs1/portfile.cmake +++ b/ports/ignition-msgs1/portfile.cmake @@ -14,20 +14,11 @@ if(ignition_msgs_CROSSCOMPILING) message(FATAL_ERROR "This port does not currently support triplets that require cross-compilation.") endif() -# This port needs to generate protobuf messages with a custom plugin generator, -# so it needs to have in Windows the relative protobuf dll available in the PATH -set(path_backup $ENV{PATH}) -vcpkg_add_to_path(${CURRENT_INSTALLED_DIR}/bin) -vcpkg_add_to_path(${CURRENT_INSTALLED_DIR}/debug/bin) - ignition_modular_library(NAME msgs VERSION "1.0.0" # See https://bitbucket.org/ignitionrobotics/ign-msgs/issues/33/the-ignition-msgs1_100-tag-does-not-match REF ignition-msgs_1.0.0 SHA512 3a270f0ac988b947091d4626be48fe8cfed5ddfde5a37b9d0f08fddcbf278099ab231fca11e2dd2296ca54e0350ea14e3f685dc238f0827f18f10ab7b75039de # Fix linking order of protobuf libraries (backport of https://bitbucket.org/ignitionrobotics/ign-msgs/pull-requests/151) - PATCHES fix-protobuf-static-link-order.patch) - - -# Restore old path -set(ENV{PATH} ${path_backup}) + PATCHES fix-protobuf-static-link-order.patch + CMAKE_OPTIONS -DVCPKG_APPLOCAL_DEPS:BOOL=ON) diff --git a/ports/ignition-msgs5/CONTROL b/ports/ignition-msgs5/CONTROL index b1317303b68b91..c9f357b49f4fe9 100644 --- a/ports/ignition-msgs5/CONTROL +++ b/ports/ignition-msgs5/CONTROL @@ -1,6 +1,6 @@ Source: ignition-msgs5 Version: 5.3.0 -Port-Version: 1 +Port-Version: 2 Build-Depends: ignition-modularscripts, ignition-cmake2, ignition-math6, protobuf, tinyxml2 Description: Middleware protobuf messages for robotics Supports: !(arm|uwp) \ No newline at end of file diff --git a/ports/ignition-msgs5/portfile.cmake b/ports/ignition-msgs5/portfile.cmake index 1174cb90681eca..9944ef982298e0 100644 --- a/ports/ignition-msgs5/portfile.cmake +++ b/ports/ignition-msgs5/portfile.cmake @@ -4,17 +4,10 @@ vcpkg_fail_port_install(ON_ARCH "arm" ON_TARGET "uwp") include(${CURRENT_INSTALLED_DIR}/share/ignitionmodularscripts/ignition_modular_library.cmake) -# This port needs to generate protobuf messages with a custom plugin generator, -# so it needs to have in Windows the relative protobuf dll available in the PATH -set(path_backup $ENV{PATH}) -vcpkg_add_to_path(${CURRENT_INSTALLED_DIR}/bin) -vcpkg_add_to_path(${CURRENT_INSTALLED_DIR}/debug/bin) - ignition_modular_library(NAME msgs VERSION "5.3.0" SHA512 55c167d00b60ae6da0144a9495e9ac8aed61fcbdc61e057e75d31261e335c573543d60e28a7dc195a7c9849c5c6eb0e088d4f4e79fd927e83470a3f1fabef60e PATCHES - "01-protobuf.patch") + "01-protobuf.patch" + CMAKE_OPTIONS -DVCPKG_APPLOCAL_DEPS:BOOL=ON) -# Restore old path -set(ENV{PATH} "${path_backup}") diff --git a/ports/ignition-msgs6/CONTROL b/ports/ignition-msgs6/CONTROL index 70aa5726cbdb0e..b09a4039493585 100644 --- a/ports/ignition-msgs6/CONTROL +++ b/ports/ignition-msgs6/CONTROL @@ -1,5 +1,6 @@ Source: ignition-msgs6 Version: 6.0.0 +Port-Version: 1 Build-Depends: ignition-modularscripts, ignition-cmake2, ignition-math6, protobuf, tinyxml2 Description: Middleware protobuf messages for robotics Supports: !(arm|uwp) diff --git a/ports/ignition-msgs6/portfile.cmake b/ports/ignition-msgs6/portfile.cmake index 0a3ef841eb604d..b62a57fb4c1cde 100644 --- a/ports/ignition-msgs6/portfile.cmake +++ b/ports/ignition-msgs6/portfile.cmake @@ -4,15 +4,7 @@ vcpkg_fail_port_install(ON_ARCH "arm" ON_TARGET "uwp") include(${CURRENT_INSTALLED_DIR}/share/ignitionmodularscripts/ignition_modular_library.cmake) -# This port needs to generate protobuf messages with a custom plugin generator, -# so it needs to have in Windows the relative protobuf dll available in the PATH -set(path_backup $ENV{PATH}) -vcpkg_add_to_path(${CURRENT_INSTALLED_DIR}/bin) -vcpkg_add_to_path(${CURRENT_INSTALLED_DIR}/debug/bin) - ignition_modular_library(NAME msgs VERSION "6.0.0" - SHA512 d1d6f6602ae33ec95b36c5df7815b06970f349492ef0309d8aacbaf2dca0c3e7314bbd64890a2554485fbd52f148a90b7bf54dceb0b3a1dd40eeb1f5bdb9613c) - -# Restore old path -set(ENV{PATH} "${path_backup}") + SHA512 d1d6f6602ae33ec95b36c5df7815b06970f349492ef0309d8aacbaf2dca0c3e7314bbd64890a2554485fbd52f148a90b7bf54dceb0b3a1dd40eeb1f5bdb9613c + CMAKE_OPTIONS -DVCPKG_APPLOCAL_DEPS:BOOL=ON) diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index f41747f8a13598..2891840aab6e89 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -220,6 +220,12 @@ function(vcpkg_configure_cmake) endif() endif() + # Specify VCPKG_APPLOCAL_DEPS option unless the port set it explicitly + if(NOT (_csc_options MATCHES -DVCPKG_APPLOCAL_DEPS)) + list(APPEND _csc_options + "-DVCPKG_APPLOCAL_DEPS=OFF" + ) + endif() list(APPEND _csc_OPTIONS "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}" @@ -231,7 +237,6 @@ function(vcpkg_configure_cmake) "-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON" "-DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=TRUE" "-DCMAKE_VERBOSE_MAKEFILE=ON" - "-DVCPKG_APPLOCAL_DEPS=OFF" "-DCMAKE_TOOLCHAIN_FILE=${SCRIPTS}/buildsystems/vcpkg.cmake" "-DCMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION=ON" "-DVCPKG_CXX_FLAGS=${VCPKG_CXX_FLAGS}"