Skip to content

Commit

Permalink
[casadi] first step (no dependencies) (#41649)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgillis authored Oct 23, 2024
1 parent 3447aa6 commit d5cf6a9
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 0 deletions.
41 changes: 41 additions & 0 deletions ports/casadi/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Currently no upstream support for static libraries
vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO casadi/casadi
REF "${VERSION}"
SHA512 2c95368281f0bda385c6c451e361c168589f13aa66af6bc6fadf01f899bcd6c785ea7da3dee0fb5835559e58982e499182a4d244af3ea208ac05f672ea99cfd1
HEAD_REF main
)

# Pending upstream fix https://github.com/casadi/casadi/issues/3896
set(VCPKG_POLICY_SKIP_ABSOLUTE_PATHS_CHECK enabled)

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DWITH_SELFCONTAINED=OFF
-DWITH_TINYXML=OFF
-DWITH_BUILD_TINYXML=OFF
-DWITH_QPOASES=OFF
-DWITH_SUNDIALS=OFF
-DWITH_CSPARSE=OFF
-DLIB_PREFIX:PATH=lib
-DBIN_PREFIX:PATH=bin
-DINCLUDE_PREFIX:PATH=include
-DCMAKE_PREFIX:PATH=share/${PORT}
)

vcpkg_cmake_install()

vcpkg_cmake_config_fixup()

vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt")

vcpkg_fixup_pkgconfig()

configure_file("${CMAKE_CURRENT_LIST_DIR}/usage" "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" COPYONLY)

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
vcpkg_copy_tools(TOOL_NAMES casadi-cli AUTO_CLEAN)
5 changes: 5 additions & 0 deletions ports/casadi/usage
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
casadi provides CMake targets:

find_package(casadi CONFIG REQUIRED)
target_link_libraries(main PRIVATE $<TARGET_NAME:casadi>)

17 changes: 17 additions & 0 deletions ports/casadi/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "casadi",
"version": "3.6.7",
"description": "CasADi is a symbolic framework for numeric optimization implementing automatic differentiation in forward and reverse modes on sparse matrix-valued computational graphs. It supports self-contained C-code generation and interfaces state-of-the-art codes such as SUNDIALS, IPOPT etc. It can be used from C++, Python or Matlab/Octave.",
"homepage": "http://casadi.org",
"license": "LGPL-3.0-only",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}
9 changes: 9 additions & 0 deletions scripts/ci.baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,15 @@ c-dbg-macro:x64-osx=skip
c-dbg-macro:arm64-osx=skip
c-dbg-macro:x64-linux=skip

# Needs work
casadi:arm64-android=skip
casadi:x64-android=skip
casadi:arm-neon-android=skip
casadi:x64-windows-static=skip
casadi:x64-windows-static-md=skip
casadi:x64-uwp=skip
casadi:arm64-uwp=skip

casclib:arm64-uwp=fail
casclib:x64-uwp=fail
catch-classic:arm-neon-android=skip
Expand Down
4 changes: 4 additions & 0 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -1516,6 +1516,10 @@
"baseline": "1.0.0",
"port-version": 6
},
"casadi": {
"baseline": "3.6.7",
"port-version": 0
},
"casclib": {
"baseline": "2024-06-05",
"port-version": 0
Expand Down
9 changes: 9 additions & 0 deletions versions/c-/casadi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "1adbc7383777c7c21ca1dea604f4a4c75780fe6e",
"version": "3.6.7",
"port-version": 0
}
]
}

0 comments on commit d5cf6a9

Please sign in to comment.