diff options
Diffstat (limited to 'vcpkg/ports/gz-msgs')
| -rw-r--r-- | vcpkg/ports/gz-msgs/cmake-project-include.cmake | 3 | ||||
| -rw-r--r-- | vcpkg/ports/gz-msgs/move_bin_to_tools.patch | 24 | ||||
| -rw-r--r-- | vcpkg/ports/gz-msgs/portfile.cmake | 36 | ||||
| -rw-r--r-- | vcpkg/ports/gz-msgs/pthread.diff | 18 | ||||
| -rw-r--r-- | vcpkg/ports/gz-msgs/remove_ruby.patch | 20 | ||||
| -rw-r--r-- | vcpkg/ports/gz-msgs/vcpkg.json | 25 |
6 files changed, 126 insertions, 0 deletions
diff --git a/vcpkg/ports/gz-msgs/cmake-project-include.cmake b/vcpkg/ports/gz-msgs/cmake-project-include.cmake new file mode 100644 index 0000000..6705106 --- /dev/null +++ b/vcpkg/ports/gz-msgs/cmake-project-include.cmake @@ -0,0 +1,3 @@ +if(MSVC) + add_compile_options("/bigobj") +endif() diff --git a/vcpkg/ports/gz-msgs/move_bin_to_tools.patch b/vcpkg/ports/gz-msgs/move_bin_to_tools.patch new file mode 100644 index 0000000..1399983 --- /dev/null +++ b/vcpkg/ports/gz-msgs/move_bin_to_tools.patch @@ -0,0 +1,24 @@ +diff --git a/gz-msgs-extras.cmake.in b/gz-msgs-extras.cmake.in +index 7c322b1..78cf807 100644 +--- a/gz-msgs-extras.cmake.in ++++ b/gz-msgs-extras.cmake.in +@@ -33,7 +33,7 @@ set(FACTORY_SCRIPT_NAME "@PROJECT_NAME@_generate_factory.py") + set(@PROJECT_NAME@_PROTO_PATH ${@PROJECT_NAME@_INSTALL_PATH}/share/protos) + # Provide support to override generator executable used during cross-compilation + if(NOT DEFINED @PROJECT_NAME@_PROTO_GENERATOR_PLUGIN) +- set(@PROJECT_NAME@_PROTO_GENERATOR_PLUGIN ${@PROJECT_NAME@_INSTALL_PATH}/bin/${PROTOC_NAME}) ++ set(@PROJECT_NAME@_PROTO_GENERATOR_PLUGIN ${VCPKG_IMPORT_PREFIX}/tools/@PROJECT_NAME@/${PROTOC_NAME}) + endif() + if(NOT DEFINED @PROJECT_NAME@_PROTOC_EXECUTABLE) + set(@PROJECT_NAME@_PROTOC_EXECUTABLE protobuf::protoc) +@@ -41,8 +41,8 @@ endif() + if(NOT DEFINED @PROJECT_NAME@_PYTHON_INTERPRETER) + set(@PROJECT_NAME@_PYTHON_INTERPRETER Python3::Interpreter) + endif() +-set(@PROJECT_NAME@_PROTO_GENERATOR_SCRIPT ${@PROJECT_NAME@_INSTALL_PATH}/bin/${PROTO_SCRIPT_NAME}) +-set(@PROJECT_NAME@_FACTORY_GENERATOR_SCRIPT ${@PROJECT_NAME@_INSTALL_PATH}/bin/${FACTORY_SCRIPT_NAME}) ++set(@PROJECT_NAME@_PROTO_GENERATOR_SCRIPT ${VCPKG_IMPORT_PREFIX}/tools/@PROJECT_NAME@/${PROTO_SCRIPT_NAME}) ++set(@PROJECT_NAME@_FACTORY_GENERATOR_SCRIPT ${VCPKG_IMPORT_PREFIX}/tools/@PROJECT_NAME@/${FACTORY_SCRIPT_NAME}) + + ################################################## + # A function to generate a target message library from a group of protobuf files . diff --git a/vcpkg/ports/gz-msgs/portfile.cmake b/vcpkg/ports/gz-msgs/portfile.cmake new file mode 100644 index 0000000..cef2ace --- /dev/null +++ b/vcpkg/ports/gz-msgs/portfile.cmake @@ -0,0 +1,36 @@ +string(REGEX MATCH "^[0-9]+" VERSION_MAJOR "${VERSION}") +string(REGEX REPLACE "^gz-" "" PACKAGE_NAME "${PORT}") + +set(options "") +if(VCPKG_CROSSCOMPILING) + list(APPEND options + "-Dgz-msgs${VERSION_MAJOR}_PROTO_GENERATOR_PLUGIN=${CURRENT_HOST_INSTALLED_DIR}/tools/gz-msgs${VERSION_MAJOR}/gz-msgs${VERSION_MAJOR}_protoc_plugin${VCPKG_HOST_EXECUTABLE_SUFFIX}" + "-Dgz-msgs${VERSION_MAJOR}_PROTOC_EXECUTABLE=${CURRENT_HOST_INSTALLED_DIR}/tools/protobuf/protoc${VCPKG_HOST_EXECUTABLE_SUFFIX}" + ) +endif() + +vcpkg_find_acquire_program(PYTHON3) + +ignition_modular_library( + NAME ${PACKAGE_NAME} + REF ${PORT}${VERSION_MAJOR}_${VERSION} + VERSION ${VERSION} + SHA512 43c75eb30f00708c54f3de54737a4f1bda4a77a1d1ca3ba1354270beb01db078e73b909fdebb33b938a45a9808d4d2f2c164efe01c98aaec7a88003c85fab6f9 + OPTIONS + ${options} + "-DCMAKE_PROJECT_INCLUDE=${CURRENT_PORT_DIR}/cmake-project-include.cmake" + "-DPython3_EXECUTABLE=${PYTHON3}" + PATCHES + remove_ruby.patch + move_bin_to_tools.patch + pthread.diff +) + +file(GLOB python_files_debug "${CURRENT_PACKAGES_DIR}/debug/bin/${PORT}${VERSION_MAJOR}_*.py") +file(GLOB python_files_release "${CURRENT_PACKAGES_DIR}/bin/${PORT}${VERSION_MAJOR}_*.py") +file(COPY ${python_files_release} DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}${VERSION_MAJOR}") +file(REMOVE ${python_files_release} ${python_files_debug}) + +vcpkg_copy_tools(TOOL_NAMES "${PORT}${VERSION_MAJOR}_protoc_plugin" AUTO_CLEAN + DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}${VERSION_MAJOR}" +) diff --git a/vcpkg/ports/gz-msgs/pthread.diff b/vcpkg/ports/gz-msgs/pthread.diff new file mode 100644 index 0000000..ea999a5 --- /dev/null +++ b/vcpkg/ports/gz-msgs/pthread.diff @@ -0,0 +1,18 @@ +diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt +index 951b72d..0547ee0 100644 +--- a/core/CMakeLists.txt ++++ b/core/CMakeLists.txt +@@ -12,7 +12,12 @@ target_include_directories(${PROTOC_PLUGIN} PRIVATE ${PROTOBUF_INCLUDE_DIR}) + target_compile_features(${PROTOC_PLUGIN} PRIVATE ${GZ_CXX_11_FEATURES}) + + if (UNIX) +- target_link_libraries(${PROTOC_PLUGIN} pthread) ++ set(THREADS_PREFER_PTHREAD_FLAG ON) ++ gz_find_package(Threads REQUIRED PKGCONFIG_IGNORE) ++ if(CMAKE_THREAD_LIBS_INIT) ++ gz_string_append(PROJECT_PKGCONFIG_LIBS ${CMAKE_THREAD_LIBS_INIT}) ++ endif() ++ target_link_libraries(${PROTOC_PLUGIN} Threads::Threads) + endif() + + install(TARGETS ${PROTOC_PLUGIN} DESTINATION ${GZ_BIN_INSTALL_DIR}) diff --git a/vcpkg/ports/gz-msgs/remove_ruby.patch b/vcpkg/ports/gz-msgs/remove_ruby.patch new file mode 100644 index 0000000..35d7b13 --- /dev/null +++ b/vcpkg/ports/gz-msgs/remove_ruby.patch @@ -0,0 +1,20 @@ +diff --git a/core/cmd/CMakeLists.txt b/core/cmd/CMakeLists.txt
+index 736f537..ace3d77 100644
+--- a/core/cmd/CMakeLists.txt
++++ b/core/cmd/CMakeLists.txt
+@@ -9,6 +9,7 @@ set(EXE_INSTALL_DIR ${CMAKE_INSTALL_LIBEXECDIR}/gz/${GZ_DESIGNATION}${PROJECT_VE
+ install(TARGETS ${msgs_executable} DESTINATION ${EXE_INSTALL_DIR})
+ set(executable_location "../../../${EXE_INSTALL_DIR}/$<TARGET_FILE_NAME:${msgs_executable}>")
+
++if(0)
+ set(cmd_script_generated "${CMAKE_CURRENT_BINARY_DIR}/cmd${GZ_DESIGNATION}${PROJECT_VERSION_MAJOR}.rb")
+ set(cmd_script_configured "${cmd_script_generated}.configured")
+
+@@ -23,6 +24,7 @@ file(GENERATE
+
+ install(FILES ${cmd_script_generated} DESTINATION lib/ruby/gz)
+
++endif()
+ #===============================================================================
+ # Bash completion
+
diff --git a/vcpkg/ports/gz-msgs/vcpkg.json b/vcpkg/ports/gz-msgs/vcpkg.json new file mode 100644 index 0000000..58a8912 --- /dev/null +++ b/vcpkg/ports/gz-msgs/vcpkg.json @@ -0,0 +1,25 @@ +{ + "name": "gz-msgs", + "version": "11.1.0", + "description": "Protobuf messages and functions for robot applications", + "license": "Apache-2.0", + "supports": "!uwp", + "dependencies": [ + "gz-cmake", + "gz-math", + { + "name": "gz-msgs", + "host": true + }, + { + "name": "ignition-modularscripts", + "host": true + }, + "protobuf", + { + "name": "protobuf", + "host": true + }, + "tinyxml2" + ] +} |