Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 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
3 changes: 1 addition & 2 deletions ports/ignition-modularscripts/CONTROL
Original file line number Diff line number Diff line change
@@ -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
124 changes: 61 additions & 63 deletions ports/ignition-modularscripts/ignition_modular_library.cmake
Original file line number Diff line number Diff line change
@@ -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/ ).
Expand All @@ -70,7 +11,8 @@ endfunction()
## [HEAD_REF <head_ref>]
## [PATCHES <patches>]
## [CMAKE_PACKAGE_NAME <cmake_package_name>]
## [DISABLE_PKGCONFIG_INSTALL])
## [DISABLE_PKGCONFIG_INSTALL]
## [CMAKE_OPTIONS <cmake_options>])
## ```
##
## ## Parameters:
Expand Down Expand Up @@ -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:
##
Expand All @@ -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})
Expand Down Expand Up @@ -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()
2 changes: 1 addition & 1 deletion ports/ignition-msgs1/CONTROL
Original file line number Diff line number Diff line change
@@ -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
13 changes: 2 additions & 11 deletions ports/ignition-msgs1/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion ports/ignition-msgs5/CONTROL
Original file line number Diff line number Diff line change
@@ -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)
11 changes: 2 additions & 9 deletions ports/ignition-msgs5/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
1 change: 1 addition & 0 deletions ports/ignition-msgs6/CONTROL
Original file line number Diff line number Diff line change
@@ -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)
12 changes: 2 additions & 10 deletions ports/ignition-msgs6/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
7 changes: 6 additions & 1 deletion scripts/cmake/vcpkg_configure_cmake.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand All @@ -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}"
Expand Down