mirror of
https://github.com/microsoft/vcpkg.git
synced 2026-01-18 01:11:23 +01:00
[qpoases] Add new port (#49101)
This commit is contained in:
113
ports/qpoases/export_target.diff
Normal file
113
ports/qpoases/export_target.diff
Normal file
@@ -0,0 +1,113 @@
|
||||
Index: qpOASESConfig.cmake.in
|
||||
IDEA additional info:
|
||||
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
|
||||
<+>GBK
|
||||
===================================================================
|
||||
diff --git a/qpOASESConfig.cmake.in b/qpOASESConfig.cmake.in
|
||||
--- a/qpOASESConfig.cmake.in (revision 35b762ba3fee2e009d9e99650c68514da05585c5)
|
||||
+++ b/qpOASESConfig.cmake.in (date 1766737135519)
|
||||
@@ -5,25 +5,54 @@
|
||||
# qpOASES_INCLUDE_DIR - The qpOASES include directory
|
||||
# qpOASES_LIBRARY_DIR - The qpOASES library directory
|
||||
# qpOASES_LIBRARY - The qpOASES library
|
||||
-# qpOASES_VERSION - The qpOASES version in the form <major>.<minor>
|
||||
-
|
||||
-
|
||||
+# qpOASES_VERSION - The qpOASES version in the form <major>.<minor>
|
||||
+#
|
||||
+# It also provides the following imported target:
|
||||
+#
|
||||
+# qpOASES::qpOASES
|
||||
|
||||
@PACKAGE_INIT@
|
||||
|
||||
set(qpOASES_VERSION @PACKAGE_VERSION@)
|
||||
|
||||
+# ------------------------------------------------------------
|
||||
+# Load exported targets (modern CMake)
|
||||
+# ------------------------------------------------------------
|
||||
+include("${CMAKE_CURRENT_LIST_DIR}/qpOASESTargets.cmake")
|
||||
|
||||
-set_and_check(qpOASES_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@")
|
||||
+# ------------------------------------------------------------
|
||||
+# Backward compatibility variables (derived from target)
|
||||
+# ------------------------------------------------------------
|
||||
|
||||
+# Include directory
|
||||
+get_target_property(_qpOASES_INCLUDE_DIR qpOASES::qpOASES INTERFACE_INCLUDE_DIRECTORIES)
|
||||
+
|
||||
+# Handle generator expressions and lists
|
||||
+list(GET _qpOASES_INCLUDE_DIR 0 qpOASES_INCLUDE_DIR)
|
||||
|
||||
set(qpOASES_INCLUDE_DIR "${qpOASES_INCLUDE_DIR}" CACHE STRING "Include path for qpOASES and its dependencies")
|
||||
-set_and_check(qpOASES_LIBRARY_DIR @PACKAGE_LIB_INSTALL_DIR@)
|
||||
+
|
||||
+# Library file (configuration-aware)
|
||||
+get_target_property(_qpOASES_LIB_LOCATION qpOASES::qpOASES IMPORTED_LOCATION)
|
||||
+
|
||||
+if(NOT _qpOASES_LIB_LOCATION)
|
||||
+ if(CMAKE_BUILD_TYPE STREQUAL Debug)
|
||||
+ get_target_property(_qpOASES_LIB_LOCATION qpOASES::qpOASES IMPORTED_LOCATION_DEBUG)
|
||||
+ else()
|
||||
+ get_target_property(_qpOASES_LIB_LOCATION qpOASES::qpOASES IMPORTED_LOCATION_RELEASE)
|
||||
+ endif()
|
||||
+endif()
|
||||
+
|
||||
+set(qpOASES_LIBRARY "${_qpOASES_LIB_LOCATION}")
|
||||
+
|
||||
+# Library directory
|
||||
+get_filename_component(qpOASES_LIBRARY_DIR "${qpOASES_LIBRARY}" DIRECTORY)
|
||||
+
|
||||
set(qpOASES_LIBRARY_DIR "${qpOASES_LIBRARY_DIR}" CACHE STRING "Library path for qpOASES and its dependencies")
|
||||
|
||||
-find_library(qpOASES_LIBRARY NAMES qpOASES
|
||||
- PATHS ${qpOASES_LIBRARY_DIR} NO_DEFAULT_PATH)
|
||||
-
|
||||
-
|
||||
+# ------------------------------------------------------------
|
||||
+# Standard find_package result handling
|
||||
+# ------------------------------------------------------------
|
||||
include(FindPackageHandleStandardArgs)
|
||||
-find_package_handle_standard_args(qpOASES DEFAULT_MSG qpOASES_INCLUDE_DIR qpOASES_LIBRARY_DIR qpOASES_LIBRARY qpOASES_VERSION)
|
||||
\ No newline at end of file
|
||||
+
|
||||
+find_package_handle_standard_args(qpOASES REQUIRED_VARS qpOASES_LIBRARY qpOASES_INCLUDE_DIR VERSION_VAR qpOASES_VERSION)
|
||||
\ No newline at end of file
|
||||
Index: CMakeLists.txt
|
||||
IDEA additional info:
|
||||
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
|
||||
<+>GBK
|
||||
===================================================================
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
--- a/CMakeLists.txt (revision 35b762ba3fee2e009d9e99650c68514da05585c5)
|
||||
+++ b/CMakeLists.txt (date 1766735663415)
|
||||
@@ -125,7 +125,17 @@
|
||||
|
||||
# library
|
||||
ADD_LIBRARY(qpOASES ${SRC})
|
||||
+
|
||||
+add_library(qpOASES::qpOASES ALIAS qpOASES)
|
||||
+
|
||||
+target_include_directories(qpOASES
|
||||
+ PUBLIC
|
||||
+ $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
|
||||
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
+)
|
||||
+
|
||||
INSTALL(TARGETS qpOASES
|
||||
+ EXPORT qpOASESTargets
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
@@ -164,6 +174,11 @@
|
||||
VERSION ${PACKAGE_VERSION}
|
||||
COMPATIBILITY SameMajorVersion)
|
||||
|
||||
+install(EXPORT qpOASESTargets
|
||||
+ NAMESPACE qpOASES::
|
||||
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/qpOASES
|
||||
+)
|
||||
+
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/qpOASESConfig.cmake
|
||||
${CMAKE_CURRENT_BINARY_DIR}/qpOASESConfigVersion.cmake
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/qpOASES
|
||||
25
ports/qpoases/portfile.cmake
Normal file
25
ports/qpoases/portfile.cmake
Normal file
@@ -0,0 +1,25 @@
|
||||
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
||||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO coin-or/qpOASES
|
||||
REF 35b762ba3fee2e009d9e99650c68514da05585c5
|
||||
SHA512 691b91113cc8c0ab05f3143749c225a44bcb16a2dc6e60ecd3a4d00f44b8284a3d57dad83e4ef53d56b033e9ce9346735496263fb9f8def6f62ccd429f154a0d
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
export_target.diff
|
||||
)
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS
|
||||
-DQPOASES_BUILD_EXAMPLES=OFF
|
||||
)
|
||||
|
||||
vcpkg_cmake_install()
|
||||
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/qpOASES)
|
||||
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
||||
|
||||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
|
||||
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
||||
10
ports/qpoases/usage
Normal file
10
ports/qpoases/usage
Normal file
@@ -0,0 +1,10 @@
|
||||
The package quarter provides CMake targets:
|
||||
|
||||
find_package(qpOASES CONFIG REQUIRED)
|
||||
|
||||
target_link_libraries(your_target PRIVATE qpOASES::qpOASES)
|
||||
|
||||
For backward compatibility, the following variables are also provided:
|
||||
|
||||
target_include_directories(your_target PRIVATE ${qpOASES_INCLUDE_DIR})
|
||||
target_link_libraries(your_target PRIVATE ${qpOASES_LIBRARY})
|
||||
17
ports/qpoases/vcpkg.json
Normal file
17
ports/qpoases/vcpkg.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "qpoases",
|
||||
"version": "3.2.2",
|
||||
"description": "Open-source C++ implementation of the online active set strategy for quadratic programming",
|
||||
"homepage": "https://github.com/coin-or/qpOASES",
|
||||
"license": "LGPL-2.1-only",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake-config",
|
||||
"host": true
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -7928,6 +7928,10 @@
|
||||
"baseline": "0.40.0",
|
||||
"port-version": 0
|
||||
},
|
||||
"qpoases": {
|
||||
"baseline": "3.2.2",
|
||||
"port-version": 0
|
||||
},
|
||||
"qscintilla": {
|
||||
"baseline": "2.14.1",
|
||||
"port-version": 1
|
||||
|
||||
9
versions/q-/qpoases.json
Normal file
9
versions/q-/qpoases.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "0d697d0ba4fabd912f943b4f22fd41416b247ca2",
|
||||
"version": "3.2.2",
|
||||
"port-version": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user