2018-08-09 16:02:12 +08:00
|
|
|
include(vcpkg_common_functions)
|
|
|
|
|
2019-10-08 01:35:13 +08:00
|
|
|
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
|
|
|
|
2018-08-09 16:02:12 +08:00
|
|
|
vcpkg_download_distfile(ARCHIVE
|
|
|
|
URLS "https://jmodelica.org/fmil/FMILibrary-2.0.3-src.zip"
|
|
|
|
FILENAME "FMILibrary-2.0.3-src.zip"
|
|
|
|
SHA512 86e4b5019d8f2a76b01141411845d977fb3949617604de0b34351f23647e3e8b378477de184e1c4f2f59297bc4c7de3155e0edba9099b8924594a36b37b04cc8
|
|
|
|
)
|
|
|
|
|
2019-10-08 01:35:13 +08:00
|
|
|
vcpkg_extract_source_archive_ex(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
ARCHIVE ${ARCHIVE}
|
|
|
|
PATCHES
|
|
|
|
0001-remove-install-prefix.patch
|
2020-09-25 06:15:06 +08:00
|
|
|
0002-include-sys-stat.h-for-mkdir.patch
|
2019-10-08 01:35:13 +08:00
|
|
|
)
|
2018-08-09 16:02:12 +08:00
|
|
|
|
|
|
|
# Note that if you have configured and built both static and shared library on Windows
|
|
|
|
# but want to link with the static library compile time define "FMILIB_BUILDING_LIBRARY" must be set.
|
[openexr,openimageio,suitesparse,theia] updates for non-win32 (#6371)
* [openexr,openimageio,suitesparse,theia] updates for non-win32
* [theia] use only valid cmake symbols
* [suitesparse] Fix build
* [lapack] still not properly integrating with other ports
* [lapack] intercept cmake module calls and substitute them with our defs
* [suitesparse,clapack] fixes for proper integration
* [ceres,clapack] bump CONTROL
* [suitesparse] remove unnecessary defs
* [clapack] improve wrapper logic
* [WIN32] remove wrong symbol
* [clapack] fix wrapper integration
* [Accelerate] use best framework when available
* [clapack] separate config from wrapper
* [clapack] fix paths and filenames
* [mlpack,armadillo,clapack] improve library handling
* [mlpack] remove unnecessary cmake option
* [clp,coinutils,osi,liblemon] dependencies of openmvg, improve compatibility with non-win32
* [openmvg] fix for case-sensitive filesystems
* [clp,coinutils,osi] simplify CMakeLists removing many unnecessary steps
* [sophus] Force rebuild
* [theia] fixes for linux, part1
* [io2d] remove broken sintax
* [fontconfig] bump version to remove CI cached failure
* [theia] fixes for linux, part2
* [theia] remove unnecessary empty folders and comments from portfile
* [theia] use correct build type removing forced vars in cmakelists.txt
* [openmvg] add missing suitesparse target detection
* [sophus] fix Suitesparse dependency
* [sophus,openmvg] use suitesparse lowercase for module compatibility on case-sensitive filesystems
* [suitesparse] fixes for case-sensitive filesystems
* [openmvg] use correct Eigen3 name for case-sensitive filesystems
* [sophus] trigger rebuild
* [shogun] use modern vcpkg style
* [shogun] add missing cmake system processor symbol
2019-06-01 06:48:17 +08:00
|
|
|
if ((NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") AND VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
2018-08-09 16:02:12 +08:00
|
|
|
SET(FMILIB_BUILDING_LIBRARY ON)
|
[openexr,openimageio,suitesparse,theia] updates for non-win32 (#6371)
* [openexr,openimageio,suitesparse,theia] updates for non-win32
* [theia] use only valid cmake symbols
* [suitesparse] Fix build
* [lapack] still not properly integrating with other ports
* [lapack] intercept cmake module calls and substitute them with our defs
* [suitesparse,clapack] fixes for proper integration
* [ceres,clapack] bump CONTROL
* [suitesparse] remove unnecessary defs
* [clapack] improve wrapper logic
* [WIN32] remove wrong symbol
* [clapack] fix wrapper integration
* [Accelerate] use best framework when available
* [clapack] separate config from wrapper
* [clapack] fix paths and filenames
* [mlpack,armadillo,clapack] improve library handling
* [mlpack] remove unnecessary cmake option
* [clp,coinutils,osi,liblemon] dependencies of openmvg, improve compatibility with non-win32
* [openmvg] fix for case-sensitive filesystems
* [clp,coinutils,osi] simplify CMakeLists removing many unnecessary steps
* [sophus] Force rebuild
* [theia] fixes for linux, part1
* [io2d] remove broken sintax
* [fontconfig] bump version to remove CI cached failure
* [theia] fixes for linux, part2
* [theia] remove unnecessary empty folders and comments from portfile
* [theia] use correct build type removing forced vars in cmakelists.txt
* [openmvg] add missing suitesparse target detection
* [sophus] fix Suitesparse dependency
* [sophus,openmvg] use suitesparse lowercase for module compatibility on case-sensitive filesystems
* [suitesparse] fixes for case-sensitive filesystems
* [openmvg] use correct Eigen3 name for case-sensitive filesystems
* [sophus] trigger rebuild
* [shogun] use modern vcpkg style
* [shogun] add missing cmake system processor symbol
2019-06-01 06:48:17 +08:00
|
|
|
else()
|
2018-08-09 16:02:12 +08:00
|
|
|
SET(FMILIB_BUILDING_LIBRARY OFF)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# Use static run-time libraries (/MT or /MTd code generation flags)
|
|
|
|
# This is only used when generating Microsoft Visual Studio solutions. If the options is on then the library will
|
|
|
|
# be built against static runtime, otherwise - dynamic runtime (/MD or /MDd). Make sure the client code is using
|
|
|
|
# matching runtime
|
[openexr,openimageio,suitesparse,theia] updates for non-win32 (#6371)
* [openexr,openimageio,suitesparse,theia] updates for non-win32
* [theia] use only valid cmake symbols
* [suitesparse] Fix build
* [lapack] still not properly integrating with other ports
* [lapack] intercept cmake module calls and substitute them with our defs
* [suitesparse,clapack] fixes for proper integration
* [ceres,clapack] bump CONTROL
* [suitesparse] remove unnecessary defs
* [clapack] improve wrapper logic
* [WIN32] remove wrong symbol
* [clapack] fix wrapper integration
* [Accelerate] use best framework when available
* [clapack] separate config from wrapper
* [clapack] fix paths and filenames
* [mlpack,armadillo,clapack] improve library handling
* [mlpack] remove unnecessary cmake option
* [clp,coinutils,osi,liblemon] dependencies of openmvg, improve compatibility with non-win32
* [openmvg] fix for case-sensitive filesystems
* [clp,coinutils,osi] simplify CMakeLists removing many unnecessary steps
* [sophus] Force rebuild
* [theia] fixes for linux, part1
* [io2d] remove broken sintax
* [fontconfig] bump version to remove CI cached failure
* [theia] fixes for linux, part2
* [theia] remove unnecessary empty folders and comments from portfile
* [theia] use correct build type removing forced vars in cmakelists.txt
* [openmvg] add missing suitesparse target detection
* [sophus] fix Suitesparse dependency
* [sophus,openmvg] use suitesparse lowercase for module compatibility on case-sensitive filesystems
* [suitesparse] fixes for case-sensitive filesystems
* [openmvg] use correct Eigen3 name for case-sensitive filesystems
* [sophus] trigger rebuild
* [shogun] use modern vcpkg style
* [shogun] add missing cmake system processor symbol
2019-06-01 06:48:17 +08:00
|
|
|
if ((NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") AND VCPKG_CRT_LINKAGE STREQUAL static)
|
2018-08-09 16:02:12 +08:00
|
|
|
SET(FMILIB_BUILD_WITH_STATIC_RTLIB ON)
|
|
|
|
else()
|
|
|
|
SET(FMILIB_BUILD_WITH_STATIC_RTLIB OFF)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# On LINUX position independent code (-fPIC) must be used on all files to be linked into a shared library (.so file).
|
|
|
|
# On other systems this is not needed (either is default or relocation is done). Set this option to OFF if you
|
|
|
|
# are building an application on Linux and use static library only
|
[openexr,openimageio,suitesparse,theia] updates for non-win32 (#6371)
* [openexr,openimageio,suitesparse,theia] updates for non-win32
* [theia] use only valid cmake symbols
* [suitesparse] Fix build
* [lapack] still not properly integrating with other ports
* [lapack] intercept cmake module calls and substitute them with our defs
* [suitesparse,clapack] fixes for proper integration
* [ceres,clapack] bump CONTROL
* [suitesparse] remove unnecessary defs
* [clapack] improve wrapper logic
* [WIN32] remove wrong symbol
* [clapack] fix wrapper integration
* [Accelerate] use best framework when available
* [clapack] separate config from wrapper
* [clapack] fix paths and filenames
* [mlpack,armadillo,clapack] improve library handling
* [mlpack] remove unnecessary cmake option
* [clp,coinutils,osi,liblemon] dependencies of openmvg, improve compatibility with non-win32
* [openmvg] fix for case-sensitive filesystems
* [clp,coinutils,osi] simplify CMakeLists removing many unnecessary steps
* [sophus] Force rebuild
* [theia] fixes for linux, part1
* [io2d] remove broken sintax
* [fontconfig] bump version to remove CI cached failure
* [theia] fixes for linux, part2
* [theia] remove unnecessary empty folders and comments from portfile
* [theia] use correct build type removing forced vars in cmakelists.txt
* [openmvg] add missing suitesparse target detection
* [sophus] fix Suitesparse dependency
* [sophus,openmvg] use suitesparse lowercase for module compatibility on case-sensitive filesystems
* [suitesparse] fixes for case-sensitive filesystems
* [openmvg] use correct Eigen3 name for case-sensitive filesystems
* [sophus] trigger rebuild
* [shogun] use modern vcpkg style
* [shogun] add missing cmake system processor symbol
2019-06-01 06:48:17 +08:00
|
|
|
if ((VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux" OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Darwin") AND VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
2018-08-09 16:02:12 +08:00
|
|
|
SET(FMILIB_BUILD_FOR_SHARED_LIBS OFF)
|
[openexr,openimageio,suitesparse,theia] updates for non-win32 (#6371)
* [openexr,openimageio,suitesparse,theia] updates for non-win32
* [theia] use only valid cmake symbols
* [suitesparse] Fix build
* [lapack] still not properly integrating with other ports
* [lapack] intercept cmake module calls and substitute them with our defs
* [suitesparse,clapack] fixes for proper integration
* [ceres,clapack] bump CONTROL
* [suitesparse] remove unnecessary defs
* [clapack] improve wrapper logic
* [WIN32] remove wrong symbol
* [clapack] fix wrapper integration
* [Accelerate] use best framework when available
* [clapack] separate config from wrapper
* [clapack] fix paths and filenames
* [mlpack,armadillo,clapack] improve library handling
* [mlpack] remove unnecessary cmake option
* [clp,coinutils,osi,liblemon] dependencies of openmvg, improve compatibility with non-win32
* [openmvg] fix for case-sensitive filesystems
* [clp,coinutils,osi] simplify CMakeLists removing many unnecessary steps
* [sophus] Force rebuild
* [theia] fixes for linux, part1
* [io2d] remove broken sintax
* [fontconfig] bump version to remove CI cached failure
* [theia] fixes for linux, part2
* [theia] remove unnecessary empty folders and comments from portfile
* [theia] use correct build type removing forced vars in cmakelists.txt
* [openmvg] add missing suitesparse target detection
* [sophus] fix Suitesparse dependency
* [sophus,openmvg] use suitesparse lowercase for module compatibility on case-sensitive filesystems
* [suitesparse] fixes for case-sensitive filesystems
* [openmvg] use correct Eigen3 name for case-sensitive filesystems
* [sophus] trigger rebuild
* [shogun] use modern vcpkg style
* [shogun] add missing cmake system processor symbol
2019-06-01 06:48:17 +08:00
|
|
|
else()
|
2018-08-09 16:02:12 +08:00
|
|
|
SET(FMILIB_BUILD_FOR_SHARED_LIBS ON)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# Only build the requested library
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
|
|
|
SET(FMILIB_BUILD_STATIC_LIB ON)
|
|
|
|
SET(FMILIB_BUILD_SHARED_LIB OFF)
|
|
|
|
else()
|
|
|
|
SET(FMILIB_BUILD_STATIC_LIB OFF)
|
|
|
|
SET(FMILIB_BUILD_SHARED_LIB ON)
|
|
|
|
endif()
|
|
|
|
|
2019-10-08 01:35:13 +08:00
|
|
|
vcpkg_configure_cmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
|
|
PREFER_NINJA
|
|
|
|
OPTIONS
|
|
|
|
-DFMILIB_BUILD_TESTS=OFF
|
|
|
|
-DFMILIB_BUILD_STATIC_LIB=${FMILIB_BUILD_STATIC_LIB}
|
|
|
|
-DFMILIB_BUILD_SHARED_LIB=${FMILIB_BUILD_SHARED_LIB}
|
|
|
|
-DFMILIB_BUILDING_LIBRARY=${FMILIB_BUILDING_LIBRARY}
|
|
|
|
-DFMILIB_BUILD_WITH_STATIC_RTLIB=${FMILIB_BUILD_WITH_STATIC_RTLIB}
|
2018-08-09 16:02:12 +08:00
|
|
|
)
|
|
|
|
|
2019-10-08 01:35:13 +08:00
|
|
|
vcpkg_install_cmake()
|
2018-08-09 16:02:12 +08:00
|
|
|
vcpkg_copy_pdbs()
|
2019-10-08 01:35:13 +08:00
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
2019-09-06 01:43:09 +08:00
|
|
|
file(INSTALL ${SOURCE_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|