diff options
| author | Silvio Traversaro <silvio.traversaro@iit.it> | 2019-09-26 21:03:56 +0200 |
|---|---|---|
| committer | Curtis J Bezault <curtbezault@gmail.com> | 2019-09-26 12:03:56 -0700 |
| commit | 4afc873253cbcf46c4418dde3d017cf1cfdfdd71 (patch) | |
| tree | d100e68a49ff70e3cfa158dfea2252574ed727e9 /ports/ignition-modularscripts | |
| parent | 2f4cb2d5be72ab6f40a2a5fc68f8c03a5fa1e8fd (diff) | |
| download | vcpkg-4afc873253cbcf46c4418dde3d017cf1cfdfdd71.tar.gz vcpkg-4afc873253cbcf46c4418dde3d017cf1cfdfdd71.zip | |
[ignition-fuel-tools1] Add new port (#8136)
Add new port for the ignition-fuel-tools version 1, part
of the Ignition Robotics Libraries (https://ignitionrobotics.org/).
Diffstat (limited to 'ports/ignition-modularscripts')
| -rw-r--r-- | ports/ignition-modularscripts/CONTROL | 2 | ||||
| -rw-r--r-- | ports/ignition-modularscripts/ignition_modular_library.cmake | 31 |
2 files changed, 23 insertions, 10 deletions
diff --git a/ports/ignition-modularscripts/CONTROL b/ports/ignition-modularscripts/CONTROL index fa8a222cd..796056b10 100644 --- a/ports/ignition-modularscripts/CONTROL +++ b/ports/ignition-modularscripts/CONTROL @@ -1,3 +1,3 @@ Source: ignition-modularscripts
-Version: 2019-08-20
+Version: 2019-09-11
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 8800353d1..5672ab8f4 100644 --- a/ports/ignition-modularscripts/ignition_modular_library.cmake +++ b/ports/ignition-modularscripts/ignition_modular_library.cmake @@ -1,5 +1,5 @@ -function(ignition_modular_build_library NAME MAJOR_VERSION SOURCE_PATH) +function(ignition_modular_build_library NAME MAJOR_VERSION SOURCE_PATH CMAKE_PACKAGE_NAME DEFAULT_CMAKE_PACKAGE_NAME) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA @@ -8,21 +8,23 @@ function(ignition_modular_build_library NAME MAJOR_VERSION SOURCE_PATH) vcpkg_install_cmake() - vcpkg_fixup_cmake_targets(CONFIG_PATH "lib/cmake/ignition-${NAME}${MAJOR_VERSION}") + vcpkg_fixup_cmake_targets(CONFIG_PATH "lib/cmake/${CMAKE_PACKAGE_NAME}" TARGET_PATH "share/${CMAKE_PACKAGE_NAME}") file(GLOB_RECURSE CMAKE_RELEASE_FILES - "${CURRENT_PACKAGES_DIR}/lib/cmake/ignition-${NAME}${MAJOR_VERSION}/*") + "${CURRENT_PACKAGES_DIR}/lib/cmake/${CMAKE_PACKAGE_NAME}/*") file(COPY ${CMAKE_RELEASE_FILES} DESTINATION - "${CURRENT_PACKAGES_DIR}/share/ignition-${NAME}${MAJOR_VERSION}/") + "${CURRENT_PACKAGES_DIR}/share/${CMAKE_PACKAGE_NAME}/") # Remove debug files file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/lib/cmake ${CURRENT_PACKAGES_DIR}/debug/share) + + # Post-build test for cmake libraries - vcpkg_test_cmake(PACKAGE_NAME ignition-${NAME}${MAJOR_VERSION}) + vcpkg_test_cmake(PACKAGE_NAME ${CMAKE_PACKAGE_NAME}) # Find the relevant license file and install it if(EXISTS "${SOURCE_PATH}/LICENSE") @@ -67,20 +69,25 @@ endfunction() ## ## ### PATCHES ## A list of patches to be applied to the extracted sources. -## This is forwarded to the `vcpkg_from_bitbucket` command. +## This is forwarded to the `vcpkg_from_bitbucket` command. +## +## ### CMAKE_PACKAGE_NAME +## The name of the CMake package for the port. +## If not specified, defaults to `ignition-${NAME}${MAJOR_VERSION}`. ## ## ## Examples: ## ## * [ignition-cmake0](https://github.com/Microsoft/vcpkg/blob/master/ports/ignition-cmake0/portfile.cmake) ## * [ignition-math4](https://github.com/Microsoft/vcpkg/blob/master/ports/ignition-math4/portfile.cmake) +## * [ignition-fuel-tools1](https://github.com/Microsoft/vcpkg/blob/master/ports/ignition-fuel-tools1/portfile.cmake) function(ignition_modular_library) - set(oneValueArgs NAME VERSION SHA512 REF HEAD_REF) + set(oneValueArgs NAME VERSION SHA512 REF HEAD_REF CMAKE_PACKAGE_NAME) set(multiValueArgs PATCHES) cmake_parse_arguments(IML "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) string(REPLACE "." ";" IML_VERSION_LIST ${IML_VERSION}) list(GET IML_VERSION_LIST 0 IML_MAJOR_VERSION) - + # If the REF option is omitted, use the canonical one if(NOT DEFINED IML_REF) set(IML_REF "ignition-${IML_NAME}${IML_MAJOR_VERSION}_${IML_VERSION}") @@ -90,6 +97,12 @@ function(ignition_modular_library) if(NOT DEFINED IML_HEAD_REF) set(IML_HEAD_REF "ign-${IML_NAME}${IML_MAJOR_VERSION}") endif() + + # If the CMAKE_PACKAGE_NAME option is omitted, use the canonical one + set(DEFAULT_CMAKE_PACKAGE_NAME "ignition-${IML_NAME}${IML_MAJOR_VERSION}") + if(NOT DEFINED IML_CMAKE_PACKAGE_NAME) + set(IML_CMAKE_PACKAGE_NAME ${DEFAULT_CMAKE_PACKAGE_NAME}) + endif() # Download library from bitbucket, to support also the --head option vcpkg_from_bitbucket( @@ -102,5 +115,5 @@ function(ignition_modular_library) ) # Build library - ignition_modular_build_library(${IML_NAME} ${IML_MAJOR_VERSION} ${SOURCE_PATH}) + ignition_modular_build_library(${IML_NAME} ${IML_MAJOR_VERSION} ${SOURCE_PATH} ${IML_CMAKE_PACKAGE_NAME} ${DEFAULT_CMAKE_PACKAGE_NAME}) endfunction() |
