mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-26 17:41:09 +08:00
Port openmvg, included new ports of coin-or projects, lemon
This commit is contained in:
parent
269450283b
commit
fca5cab9f0
143
ports/clp/CMakeLists.txt
Normal file
143
ports/clp/CMakeLists.txt
Normal file
@ -0,0 +1,143 @@
|
||||
cmake_minimum_required(VERSION 3.11)
|
||||
|
||||
project(Clp LANGUAGES C CXX)
|
||||
|
||||
set(PROJECT_VERSION 1.16.11)
|
||||
set(PROJECT_VERSION_MAJOR 1)
|
||||
set(PROJECT_VERSION_MINOR 16)
|
||||
set(PROJECT_VERSION_PATCH 11)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
|
||||
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||
if(BUILD_SHARED_LIBS AND MSVC)
|
||||
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
||||
endif(BUILD_SHARED_LIBS AND MSVC)
|
||||
if(MSVC)
|
||||
set(
|
||||
CMAKE_CXX_FLAGS
|
||||
"${CMAKE_CXX_FLAGS} /bigobj /MP /wd4996 /wd4819 /wd4251 /wd4267 /wd4244 /wd4275"
|
||||
)
|
||||
endif(MSVC)
|
||||
if(APPLE)
|
||||
set(
|
||||
CMAKE_CXX_FLAGS
|
||||
"${CMAKE_CXX_FLAGS} -Wno-inconsistent-missing-override -Wno-unused-command-line-argument -Wno-unused-result -Wno-exceptions"
|
||||
)
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9"
|
||||
CACHE STRING "Minimum OS X deployment version")
|
||||
endif(APPLE)
|
||||
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
|
||||
# options
|
||||
option(BUILD_SHARED_LIBS "" ON)
|
||||
|
||||
#
|
||||
# 设置用于 install 的变量
|
||||
#
|
||||
# Introduce variables: * CMAKE_INSTALL_LIBDIR * CMAKE_INSTALL_BINDIR
|
||||
include(GNUInstallDirs)
|
||||
|
||||
# Include module with fuction 'write_basic_package_version_file'
|
||||
include(CMakePackageConfigHelpers)
|
||||
|
||||
# Layout. This works for all platforms: * <prefix>/lib*/cmake/<PROJECT-NAME> *
|
||||
# <prefix>/lib*/ * <prefix>/include/
|
||||
set(config_install_dir "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")
|
||||
set(generated_dir "${CMAKE_CURRENT_BINARY_DIR}/generated")
|
||||
# Configuration
|
||||
set(version_config "${generated_dir}/${PROJECT_NAME}ConfigVersion.cmake")
|
||||
set(project_config "${generated_dir}/${PROJECT_NAME}Config.cmake")
|
||||
set(TARGETS_EXPORT_NAME "${PROJECT_NAME}Targets")
|
||||
set(namespace "Coin::")
|
||||
|
||||
# Packages
|
||||
find_package(CoinUtils REQUIRED)
|
||||
find_package(Osi REQUIRED)
|
||||
|
||||
# Add sources
|
||||
include_directories(Clp/src/)
|
||||
include_directories(Clp/src/OsiClp)
|
||||
|
||||
file(GLOB CLP_SOURCES
|
||||
Clp/src/*.hpp
|
||||
Clp/src/*.cpp
|
||||
Clp/src/OsiClp/*.hpp
|
||||
Clp/src/OsiClp/*.cpp)
|
||||
file(GLOB CLP_REMOVE
|
||||
Clp/src/ClpCholeskyMumps.cpp
|
||||
Clp/src/ClpCholeskyUfl.cpp
|
||||
Clp/src/ClpCholeskyWssmp.cpp
|
||||
Clp/src/ClpCholeskyWssmpKKT.cpp
|
||||
Clp/src/ClpMain.cpp
|
||||
Clp/src/*Abc*.cpp
|
||||
Clp/src/ClpCholeskyMumps.hpp
|
||||
Clp/src/ClpCholeskyUfl.hpp
|
||||
Clp/src/ClpCholeskyWssmp.hpp
|
||||
Clp/src/ClpCholeskyWssmpKKT.hpp
|
||||
Clp/src/ClpMain.hpp
|
||||
Clp/src/*Abc*.hpp
|
||||
Clp/src/*Abc*.h)
|
||||
list(REMOVE_ITEM CLP_SOURCES ${CLP_REMOVE})
|
||||
|
||||
add_library(${PROJECT_NAME} ${CLP_SOURCES})
|
||||
|
||||
target_include_directories(${PROJECT_NAME}
|
||||
PUBLIC $<INSTALL_INTERFACE:include/coin>)
|
||||
target_compile_definitions(${PROJECT_NAME}
|
||||
PUBLIC
|
||||
-DHAVE_CMATH
|
||||
-D_CRT_SECURE_NO_WARNINGS
|
||||
-DCOIN_HAS_CLP)
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE Coin::CoinUtils Coin::Osi)
|
||||
|
||||
install(TARGETS ${PROJECT_NAME}
|
||||
EXPORT "${TARGETS_EXPORT_NAME}"
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
RUNTIME DESTINATION bin
|
||||
INCLUDES
|
||||
DESTINATION include)
|
||||
|
||||
install(DIRECTORY Clp/src/
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/coin
|
||||
FILES_MATCHING
|
||||
PATTERN "*.h"
|
||||
PATTERN "*.hpp"
|
||||
PATTERN "config_default.h"
|
||||
EXCLUDE)
|
||||
|
||||
install(DIRECTORY Clp/src/OsiClp/
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/coin
|
||||
FILES_MATCHING
|
||||
PATTERN "*.h"
|
||||
PATTERN "*.hpp"
|
||||
PATTERN "config_default.h"
|
||||
EXCLUDE)
|
||||
|
||||
#
|
||||
# Install Libraries
|
||||
#
|
||||
# Configure '<PROJECT-NAME>ConfigVersion.cmake' Use: * PROJECT_VERSION
|
||||
write_basic_package_version_file("${version_config}"
|
||||
COMPATIBILITY SameMajorVersion)
|
||||
|
||||
# Configure '<PROJECT-NAME>Config.cmake' Use variables: * TARGETS_EXPORT_NAME *
|
||||
# PROJECT_NAME
|
||||
configure_package_config_file("Config.cmake.in"
|
||||
"${project_config}"
|
||||
INSTALL_DESTINATION
|
||||
"${config_install_dir}")
|
||||
|
||||
# Config * <prefix>/lib/cmake/Foo/FooConfig.cmake *
|
||||
# <prefix>/lib/cmake/Foo/FooConfigVersion.cmake
|
||||
install(FILES "${project_config}" "${version_config}"
|
||||
DESTINATION "${config_install_dir}")
|
||||
|
||||
# Config * <prefix>/lib/cmake/Foo/FooTargets.cmake
|
||||
install(EXPORT "${TARGETS_EXPORT_NAME}"
|
||||
NAMESPACE "${namespace}"
|
||||
DESTINATION "${config_install_dir}")
|
4
ports/clp/CONTROL
Normal file
4
ports/clp/CONTROL
Normal file
@ -0,0 +1,4 @@
|
||||
Source: clp
|
||||
Version: 1.16.11-0
|
||||
Description: Clp (Coin-or linear programming) is an open-source linear programming solver written in C++. It is primarily meant to be used as a callable library, but a basic, stand-alone executable version is also available.
|
||||
Build-Depends: coinutils, osi
|
5
ports/clp/Config.cmake.in
Normal file
5
ports/clp/Config.cmake.in
Normal file
@ -0,0 +1,5 @@
|
||||
|
||||
@PACKAGE_INIT@
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake")
|
||||
check_required_components("@PROJECT_NAME@")
|
46
ports/clp/portfile.cmake
Normal file
46
ports/clp/portfile.cmake
Normal file
@ -0,0 +1,46 @@
|
||||
# Common Ambient Variables:
|
||||
# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT}
|
||||
# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET}
|
||||
# CURRENT_PORT_DIR = ${VCPKG_ROOT_DIR}\ports\${PORT}
|
||||
# PORT = current port name (zlib, etc)
|
||||
# TARGET_TRIPLET = current triplet (x86-windows, x64-windows-static, etc)
|
||||
# VCPKG_CRT_LINKAGE = C runtime linkage type (static, dynamic)
|
||||
# VCPKG_LIBRARY_LINKAGE = target library linkage type (static, dynamic)
|
||||
# VCPKG_ROOT_DIR = <C:\path\to\current\vcpkg>
|
||||
# VCPKG_TARGET_ARCHITECTURE = target architecture (x64, x86, arm)
|
||||
#
|
||||
|
||||
include(vcpkg_common_functions)
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO coin-or/Clp
|
||||
REF releases/1.16.11
|
||||
SHA512 4291ab6c4985491c100fab265ebeace88623a691f87890ed7b9240b4b1111fb55043be4e0f226cfa0e565f593f4df4c3661c570a39189f17f48b6f710a10fffe
|
||||
)
|
||||
|
||||
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
|
||||
file(COPY ${CMAKE_CURRENT_LIST_DIR}/Config.cmake.in DESTINATION ${SOURCE_PATH})
|
||||
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
||||
set(BUILD_SHARED_LIBS ON)
|
||||
else()
|
||||
set(BUILD_SHARED_LIBS OFF)
|
||||
endif()
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA # Disable this option if project cannot be built with Ninja
|
||||
OPTIONS
|
||||
-DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
vcpkg_copy_pdbs()
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
||||
vcpkg_fixup_cmake_targets(CONFIG_PATH "lib/cmake/Clp")
|
||||
|
||||
# Handle copyright
|
||||
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/clp RENAME copyright)
|
||||
|
||||
# Post-build test for cmake libraries
|
||||
# vcpkg_test_cmake(PACKAGE_NAME osi)
|
111
ports/coinutils/CMakeLists.txt
Normal file
111
ports/coinutils/CMakeLists.txt
Normal file
@ -0,0 +1,111 @@
|
||||
cmake_minimum_required(VERSION 3.11)
|
||||
|
||||
project(CoinUtils LANGUAGES C CXX)
|
||||
|
||||
set(PROJECT_VERSION 2.10.14)
|
||||
set(PROJECT_VERSION_MAJOR 2)
|
||||
set(PROJECT_VERSION_MINOR 10)
|
||||
set(PROJECT_VERSION_PATCH 14)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
|
||||
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||
if(BUILD_SHARED_LIBS AND MSVC)
|
||||
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
||||
endif(BUILD_SHARED_LIBS AND MSVC)
|
||||
if(MSVC)
|
||||
set(
|
||||
CMAKE_CXX_FLAGS
|
||||
"${CMAKE_CXX_FLAGS} /bigobj /MP /wd4996 /wd4819 /wd4251 /wd4267 /wd4244 /wd4275"
|
||||
)
|
||||
endif(MSVC)
|
||||
if(APPLE)
|
||||
set(
|
||||
CMAKE_CXX_FLAGS
|
||||
"${CMAKE_CXX_FLAGS} -Wno-inconsistent-missing-override -Wno-unused-command-line-argument -Wno-unused-result -Wno-exceptions"
|
||||
)
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9"
|
||||
CACHE STRING "Minimum OS X deployment version")
|
||||
endif(APPLE)
|
||||
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
|
||||
# options
|
||||
option(BUILD_SHARED_LIBS "" ON)
|
||||
|
||||
#
|
||||
# 设置用于 install 的变量
|
||||
#
|
||||
# Introduce variables: * CMAKE_INSTALL_LIBDIR * CMAKE_INSTALL_BINDIR
|
||||
include(GNUInstallDirs)
|
||||
|
||||
# Include module with fuction 'write_basic_package_version_file'
|
||||
include(CMakePackageConfigHelpers)
|
||||
|
||||
# Layout. This works for all platforms: * <prefix>/lib*/cmake/<PROJECT-NAME> *
|
||||
# <prefix>/lib*/ * <prefix>/include/
|
||||
set(config_install_dir "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")
|
||||
set(generated_dir "${CMAKE_CURRENT_BINARY_DIR}/generated")
|
||||
# Configuration
|
||||
set(version_config "${generated_dir}/${PROJECT_NAME}ConfigVersion.cmake")
|
||||
set(project_config "${generated_dir}/${PROJECT_NAME}Config.cmake")
|
||||
set(TARGETS_EXPORT_NAME "${PROJECT_NAME}Targets")
|
||||
set(namespace "Coin::")
|
||||
|
||||
#
|
||||
# Add sources
|
||||
#
|
||||
include_directories(CoinUtils/src)
|
||||
|
||||
file(GLOB UTILS_SOURCES
|
||||
CoinUtils/src/*.hpp
|
||||
CoinUtils/src/*.cpp
|
||||
CoinUtils/src/*.h)
|
||||
add_library(${PROJECT_NAME} ${UTILS_SOURCES})
|
||||
|
||||
target_include_directories(${PROJECT_NAME}
|
||||
PUBLIC $<INSTALL_INTERFACE:include/coin>)
|
||||
target_compile_definitions(${PROJECT_NAME}
|
||||
PUBLIC
|
||||
$<INSTALL_INTERFACE:-DHAVE_CMATH>
|
||||
$<INSTALL_INTERFACE:-D_CRT_SECURE_NO_WARNINGS>)
|
||||
|
||||
install(TARGETS ${PROJECT_NAME}
|
||||
EXPORT "${TARGETS_EXPORT_NAME}"
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
RUNTIME DESTINATION bin
|
||||
INCLUDES
|
||||
DESTINATION include)
|
||||
|
||||
install(DIRECTORY CoinUtils/src/
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/coin
|
||||
FILES_MATCHING
|
||||
PATTERN "*.h"
|
||||
PATTERN "*.hpp")
|
||||
|
||||
#
|
||||
# Install Libraries
|
||||
#
|
||||
# Configure '<PROJECT-NAME>ConfigVersion.cmake' Use: * PROJECT_VERSION
|
||||
write_basic_package_version_file("${version_config}"
|
||||
COMPATIBILITY SameMajorVersion)
|
||||
|
||||
# Configure '<PROJECT-NAME>Config.cmake' Use variables: * TARGETS_EXPORT_NAME *
|
||||
# PROJECT_NAME
|
||||
configure_package_config_file("Config.cmake.in"
|
||||
"${project_config}"
|
||||
INSTALL_DESTINATION
|
||||
"${config_install_dir}")
|
||||
|
||||
# Config * <prefix>/lib/cmake/Foo/FooConfig.cmake *
|
||||
# <prefix>/lib/cmake/Foo/FooConfigVersion.cmake
|
||||
install(FILES "${project_config}" "${version_config}"
|
||||
DESTINATION "${config_install_dir}")
|
||||
|
||||
# Config * <prefix>/lib/cmake/Foo/FooTargets.cmake
|
||||
install(EXPORT "${TARGETS_EXPORT_NAME}"
|
||||
NAMESPACE "${namespace}"
|
||||
DESTINATION "${config_install_dir}")
|
3
ports/coinutils/CONTROL
Normal file
3
ports/coinutils/CONTROL
Normal file
@ -0,0 +1,3 @@
|
||||
Source: coinutils
|
||||
Version: 2.10.14-0
|
||||
Description: CoinUtils (Coin-or Utilities) is an open-source collection of classes and functions that are generally useful to more than one COIN-OR project
|
5
ports/coinutils/Config.cmake.in
Normal file
5
ports/coinutils/Config.cmake.in
Normal file
@ -0,0 +1,5 @@
|
||||
|
||||
@PACKAGE_INIT@
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake")
|
||||
check_required_components("@PROJECT_NAME@")
|
49
ports/coinutils/portfile.cmake
Normal file
49
ports/coinutils/portfile.cmake
Normal file
@ -0,0 +1,49 @@
|
||||
# Common Ambient Variables:
|
||||
# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT}
|
||||
# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET}
|
||||
# CURRENT_PORT_DIR = ${VCPKG_ROOT_DIR}\ports\${PORT}
|
||||
# PORT = current port name (zlib, etc)
|
||||
# TARGET_TRIPLET = current triplet (x86-windows, x64-windows-static, etc)
|
||||
# VCPKG_CRT_LINKAGE = C runtime linkage type (static, dynamic)
|
||||
# VCPKG_LIBRARY_LINKAGE = target library linkage type (static, dynamic)
|
||||
# VCPKG_ROOT_DIR = <C:\path\to\current\vcpkg>
|
||||
# VCPKG_TARGET_ARCHITECTURE = target architecture (x64, x86, arm)
|
||||
#
|
||||
|
||||
include(vcpkg_common_functions)
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO coin-or/CoinUtils
|
||||
REF releases/2.10.14
|
||||
SHA512 2d5108e096f126cf98750a4892ca4d946d0bad41b65f29001c116c5ad15aa4900c3091d163fa16b6a55f0518344c6681ad95bbc6efa431c77aaaaa751494c48b
|
||||
)
|
||||
|
||||
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
|
||||
file(COPY ${CMAKE_CURRENT_LIST_DIR}/Config.cmake.in DESTINATION ${SOURCE_PATH})
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
||||
set(VCPKG_LIBRARY_LINKAGE static)
|
||||
endif()
|
||||
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA # Disable this option if project cannot be built with Ninja
|
||||
OPTIONS
|
||||
-DBUILD_SHARED_LIBS=OFF
|
||||
# OPTIONS -DUSE_THIS_IN_ALL_BUILDS=1 -DUSE_THIS_TOO=2
|
||||
# OPTIONS_RELEASE -DOPTIMIZE=1
|
||||
# OPTIONS_DEBUG -DDEBUGGABLE=1
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
vcpkg_fixup_cmake_targets(CONFIG_PATH "lib/cmake/CoinUtils")
|
||||
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
||||
|
||||
# Handle copyright
|
||||
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/coinutils RENAME copyright)
|
||||
|
||||
# Post-build test for cmake libraries
|
||||
# vcpkg_test_cmake(PACKAGE_NAME coinutils)
|
3
ports/lemon/CONTROL
Normal file
3
ports/lemon/CONTROL
Normal file
@ -0,0 +1,3 @@
|
||||
Source: lemon
|
||||
Version:
|
||||
Description:
|
47
ports/lemon/portfile.cmake
Normal file
47
ports/lemon/portfile.cmake
Normal file
@ -0,0 +1,47 @@
|
||||
# Common Ambient Variables:
|
||||
# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT}
|
||||
# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET}
|
||||
# CURRENT_PORT_DIR = ${VCPKG_ROOT_DIR}\ports\${PORT}
|
||||
# PORT = current port name (zlib, etc)
|
||||
# TARGET_TRIPLET = current triplet (x86-windows, x64-windows-static, etc)
|
||||
# VCPKG_CRT_LINKAGE = C runtime linkage type (static, dynamic)
|
||||
# VCPKG_LIBRARY_LINKAGE = target library linkage type (static, dynamic)
|
||||
# VCPKG_ROOT_DIR = <C:\path\to\current\vcpkg>
|
||||
# VCPKG_TARGET_ARCHITECTURE = target architecture (x64, x86, arm)
|
||||
#
|
||||
|
||||
include(vcpkg_common_functions)
|
||||
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/lemon-1.3.1)
|
||||
vcpkg_download_distfile(ARCHIVE
|
||||
URLS "http://lemon.cs.elte.hu/pub/sources/lemon-1.3.1.tar.gz"
|
||||
FILENAME "lemon-1.3.1.tar.gz"
|
||||
SHA512 715eb45e790c908e41de4c13e68b7880e1d86c54eca53f896c95b6bc411ded504f3f768bed9d63562ed4adad53167fb3a7828c67456fdea645a5d0a94ae2e038
|
||||
)
|
||||
vcpkg_extract_source_archive(${ARCHIVE})
|
||||
vcpkg_apply_patches(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PATCHES ${CMAKE_CURRENT_LIST_DIR} remove-directory.patch)
|
||||
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
||||
set(VCPKG_LIBRARY_LINKAGE static)
|
||||
endif()
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA # Disable this option if project cannot be built with Ninja
|
||||
# OPTIONS -DUSE_THIS_IN_ALL_BUILDS=1 -DUSE_THIS_TOO=2
|
||||
# OPTIONS_RELEASE -DOPTIMIZE=1
|
||||
# OPTIONS_DEBUG -DDEBUGGABLE=1
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/cmake)
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/cmake)
|
||||
|
||||
# Handle copyright
|
||||
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/lemon RENAME copyright)
|
||||
|
||||
# Post-build test for cmake libraries
|
||||
# vcpkg_test_cmake(PACKAGE_NAME lemon)
|
21
ports/lemon/remove-directory.patch
Normal file
21
ports/lemon/remove-directory.patch
Normal file
@ -0,0 +1,21 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 03e1cc7..edbd05f 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -256,11 +256,11 @@ ENDIF()
|
||||
|
||||
ADD_SUBDIRECTORY(lemon)
|
||||
IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
|
||||
- ADD_SUBDIRECTORY(contrib)
|
||||
- ADD_SUBDIRECTORY(demo)
|
||||
- ADD_SUBDIRECTORY(tools)
|
||||
- ADD_SUBDIRECTORY(doc)
|
||||
- ADD_SUBDIRECTORY(test)
|
||||
+ # ADD_SUBDIRECTORY(contrib)
|
||||
+ # ADD_SUBDIRECTORY(demo)
|
||||
+ # ADD_SUBDIRECTORY(tools)
|
||||
+ # ADD_SUBDIRECTORY(doc)
|
||||
+ # ADD_SUBDIRECTORY(test)
|
||||
ENDIF()
|
||||
|
||||
CONFIGURE_FILE(
|
4
ports/openmvg/CONTROL
Normal file
4
ports/openmvg/CONTROL
Normal file
@ -0,0 +1,4 @@
|
||||
Source: openmvg
|
||||
Version: 1.4-0
|
||||
Description: open Multiple View Geometry library. Basis for 3D computer vision and Structure from Motion.
|
||||
Build-Depends: coinutils, clp, osi, lemon, flann, eigen3, ceres, cereal, libjpeg-turbo, tiff, libpng, zlib
|
119
ports/openmvg/fixcmake.patch
Normal file
119
ports/openmvg/fixcmake.patch
Normal file
@ -0,0 +1,119 @@
|
||||
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
|
||||
index 654bebd..6d1c671 100644
|
||||
--- a/src/CMakeLists.txt
|
||||
+++ b/src/CMakeLists.txt
|
||||
@@ -39,6 +39,10 @@ option(OpenMVG_USE_OPENCV "Build or not opencv+openMVG samples programs" OFF)
|
||||
# ==============================================================================
|
||||
option(OpenMVG_USE_OCVSIFT "Add or not OpenCV SIFT in available features" OFF)
|
||||
|
||||
+if(OpenMVG_BUILD_SHARED AND MSVC)
|
||||
+ set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
||||
+endif(OpenMVG_BUILD_SHARED AND MSVC)
|
||||
+
|
||||
# ==============================================================================
|
||||
# OpenMVG version
|
||||
# ==============================================================================
|
||||
@@ -88,11 +92,11 @@ endif()
|
||||
# ==============================================================================
|
||||
# Check that submodule have been initialized and updated
|
||||
# ==============================================================================
|
||||
-if (NOT EXISTS ${PROJECT_SOURCE_DIR}/dependencies/cereal/include)
|
||||
- message(FATAL_ERROR
|
||||
- "\n submodule(s) are missing, please update your repository:\n"
|
||||
- " > git submodule update -i\n")
|
||||
-endif()
|
||||
+# if (NOT EXISTS ${PROJECT_SOURCE_DIR}/dependencies/cereal/include)
|
||||
+# message(FATAL_ERROR
|
||||
+# "\n submodule(s) are missing, please update your repository:\n"
|
||||
+# " > git submodule update -i\n")
|
||||
+# endif()
|
||||
|
||||
# ==============================================================================
|
||||
# Additional cmake find modules
|
||||
@@ -184,12 +188,12 @@ if (OpenMVG_BUILD_OPENGL_EXAMPLES)
|
||||
endif (OpenMVG_BUILD_OPENGL_EXAMPLES)
|
||||
|
||||
# Dependencies install rules
|
||||
-install(
|
||||
- DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/dependencies/
|
||||
- DESTINATION include/openMVG_dependencies
|
||||
- COMPONENT headers
|
||||
- FILES_MATCHING PATTERN "*.hpp" PATTERN "*.h"
|
||||
-)
|
||||
+# install(
|
||||
+# DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/dependencies/
|
||||
+# DESTINATION include/openMVG_dependencies
|
||||
+# COMPONENT headers
|
||||
+# FILES_MATCHING PATTERN "*.hpp" PATTERN "*.h"
|
||||
+# )
|
||||
|
||||
# ==============================================================================
|
||||
# --END-- SUBMODULE CONFIGURATION
|
||||
diff --git a/src/cmakeFindModules/FindClp.cmake b/src/cmakeFindModules/FindClp.cmake
|
||||
index c997b87..74c3aae 100644
|
||||
--- a/src/cmakeFindModules/FindClp.cmake
|
||||
+++ b/src/cmakeFindModules/FindClp.cmake
|
||||
@@ -51,8 +51,8 @@ IF(EXISTS "${CLP_DIR}" AND NOT "${CLP_DIR}" STREQUAL "")
|
||||
SET(CLP_INCLUDE_DIR ${CLP_DIR})
|
||||
|
||||
FIND_LIBRARY(CLP_LIBRARY NAMES Clp)
|
||||
- FIND_LIBRARY(CLPSOLVER_LIBRARY NAMES ClpSolver)
|
||||
- FIND_LIBRARY(OSICLP_LIBRARY NAMES OsiClp)
|
||||
+ FIND_LIBRARY(CLPSOLVER_LIBRARY NAMES ClpSolver Clp)
|
||||
+ FIND_LIBRARY(OSICLP_LIBRARY NAMES OsiClp Clp)
|
||||
|
||||
# locate Clp libraries
|
||||
IF(DEFINED CLP_LIBRARY AND DEFINED CLPSOLVER_LIBRARY AND DEFINED OSICLP_LIBRARY)
|
||||
diff --git a/src/openMVG/matching/CMakeLists.txt b/src/openMVG/matching/CMakeLists.txt
|
||||
index 80b1fe6..cb396c7 100644
|
||||
--- a/src/openMVG/matching/CMakeLists.txt
|
||||
+++ b/src/openMVG/matching/CMakeLists.txt
|
||||
@@ -38,7 +38,7 @@ target_link_libraries(openMVG_matching
|
||||
openMVG_features
|
||||
Threads::Threads
|
||||
)
|
||||
-if (NOT DEFINED OpenMVG_USE_INTERNAL_FLANN)
|
||||
+if (NOT OpenMVG_USE_INTERNAL_FLANN)
|
||||
target_link_libraries(openMVG_matching
|
||||
PUBLIC
|
||||
${FLANN_LIBRARIES}
|
||||
diff --git a/src/third_party/CMakeLists.txt b/src/third_party/CMakeLists.txt
|
||||
index 816a941..f0b7145 100644
|
||||
--- a/src/third_party/CMakeLists.txt
|
||||
+++ b/src/third_party/CMakeLists.txt
|
||||
@@ -18,7 +18,7 @@ add_subdirectory(stlplus3)
|
||||
set(STLPLUS_LIBRARY openMVG_stlplus PARENT_SCOPE)
|
||||
|
||||
# Add graph library
|
||||
-if(DEFINED OpenMVG_USE_INTERNAL_LEMON)
|
||||
+if(OpenMVG_USE_INTERNAL_LEMON)
|
||||
add_subdirectory(lemon)
|
||||
set_property(TARGET openMVG_lemon PROPERTY FOLDER OpenMVG/3rdParty/lemon)
|
||||
set_property(TARGET check PROPERTY FOLDER OpenMVG/3rdParty/lemon)
|
||||
@@ -68,7 +68,7 @@ endif (NOT TIFF_FOUND)
|
||||
add_subdirectory(vectorGraphics)
|
||||
|
||||
# Add ceres-solver (A Nonlinear Least Squares Minimizer)
|
||||
-if (DEFINED OpenMVG_USE_INTERNAL_CERES)
|
||||
+if (OpenMVG_USE_INTERNAL_CERES)
|
||||
add_subdirectory(cxsparse)
|
||||
add_subdirectory(ceres-solver)
|
||||
set_property(TARGET openMVG_cxsparse PROPERTY FOLDER OpenMVG/3rdParty/ceres)
|
||||
@@ -76,7 +76,7 @@ if (DEFINED OpenMVG_USE_INTERNAL_CERES)
|
||||
endif()
|
||||
|
||||
# Add an Approximate Nearest Neighbor library
|
||||
-if (DEFINED OpenMVG_USE_INTERNAL_FLANN)
|
||||
+if (OpenMVG_USE_INTERNAL_FLANN)
|
||||
set(FLANN_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/openMVG/third_party/flann/src/cpp)
|
||||
add_subdirectory(flann)
|
||||
endif()
|
||||
@@ -90,7 +90,7 @@ add_subdirectory(fast)
|
||||
##
|
||||
# Install Header only libraries if necessary
|
||||
##
|
||||
-if (DEFINED OpenMVG_USE_INTERNAL_EIGEN)
|
||||
+if (OpenMVG_USE_INTERNAL_EIGEN)
|
||||
#Configure Eigen install
|
||||
set(EIGEN_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/openMVG/third_party/eigen)
|
||||
add_subdirectory(eigen)
|
101
ports/openmvg/portfile.cmake
Normal file
101
ports/openmvg/portfile.cmake
Normal file
@ -0,0 +1,101 @@
|
||||
# Common Ambient Variables:
|
||||
# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT}
|
||||
# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET}
|
||||
# CURRENT_PORT_DIR = ${VCPKG_ROOT_DIR}\ports\${PORT}
|
||||
# PORT = current port name (zlib, etc)
|
||||
# TARGET_TRIPLET = current triplet (x86-windows, x64-windows-static, etc)
|
||||
# VCPKG_CRT_LINKAGE = C runtime linkage type (static, dynamic)
|
||||
# VCPKG_LIBRARY_LINKAGE = target library linkage type (static, dynamic)
|
||||
# VCPKG_ROOT_DIR = <C:\path\to\current\vcpkg>
|
||||
# VCPKG_TARGET_ARCHITECTURE = target architecture (x64, x86, arm)
|
||||
#
|
||||
|
||||
include(vcpkg_common_functions)
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO openMVG/openMVG
|
||||
REF v1.4
|
||||
SHA512 949cf3680375c87b06db0f4713c846422c98d1979d49e9db65761f63f6f3212f0fcd8425f23c6112f04fbbb90b241638c2fd9329bb6b8b612c1d073aac55759a
|
||||
)
|
||||
|
||||
vcpkg_apply_patches(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PATCHES ${CMAKE_CURRENT_LIST_DIR} fixcmake.patch)
|
||||
|
||||
|
||||
# remove some deps to prevent conflict
|
||||
file(REMOVE_RECURSE ${SOURCE_PATH}/src/third_party/ceres-solver)
|
||||
file(REMOVE_RECURSE ${SOURCE_PATH}/src/third_party/cxsparse)
|
||||
file(REMOVE_RECURSE ${SOURCE_PATH}/src/third_party/eigen)
|
||||
file(REMOVE_RECURSE ${SOURCE_PATH}/src/third_party/flann)
|
||||
file(REMOVE_RECURSE ${SOURCE_PATH}/src/third_party/jpeg)
|
||||
file(REMOVE_RECURSE ${SOURCE_PATH}/src/third_party/lemon)
|
||||
file(REMOVE_RECURSE ${SOURCE_PATH}/src/third_party/png)
|
||||
file(REMOVE_RECURSE ${SOURCE_PATH}/src/third_party/tiff)
|
||||
file(REMOVE_RECURSE ${SOURCE_PATH}/src/third_party/zlib)
|
||||
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
||||
set(OpenMVG_BUILD_SHARED ON)
|
||||
else()
|
||||
set(OpenMVG_BUILD_SHARED OFF)
|
||||
endif()
|
||||
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}/src
|
||||
# PREFER_NINJA # Disable this option if project cannot be built with Ninja
|
||||
# OPTIONS -DUSE_THIS_IN_ALL_BUILDS=1 -DUSE_THIS_TOO=2
|
||||
OPTIONS
|
||||
-DOpenMVG_BUILD_SHARED=${OpenMVG_BUILD_SHARED}
|
||||
-DOpenMVG_BUILD_DOC=OFF
|
||||
-DOpenMVG_BUILD_EXAMPLES=OFF
|
||||
-DOpenMVG_BUILD_SOFTWARES=OFF
|
||||
-DOpenMVG_BUILD_GUI_SOFTWARES=OFF
|
||||
# TODO, use packgeconfig.cmake file instead
|
||||
-DEIGEN_INCLUDE_DIR_HINTS=${CURRENT_INSTALLED_DIR}/include/
|
||||
-DCERES_DIR_HINTS=${CURRENT_INSTALLED_DIR}/ceres
|
||||
-DFLANN_INCLUDE_DIR_HINTS=${CURRENT_INSTALLED_DIR}/flann
|
||||
-DLEMON_INCLUDE_DIR_HINTS=${CURRENT_INSTALLED_DIR}/include/lemon
|
||||
-DCOINUTILS_INCLUDE_DIR_HINTS=${CURRENT_INSTALLED_DIR}/include/coin
|
||||
-DCLP_INCLUDE_DIR_HINTS=${CURRENT_INSTALLED_DIR}/include/coin
|
||||
-DOSI_INCLUDE_DIR_HINTS=${CURRENT_INSTALLED_DIR}/include/coin
|
||||
-DOpenMVG_USE_INTERNAL_CLP=OFF
|
||||
-DOpenMVG_USE_INTERNAL_COINUTILS=OFF
|
||||
-DOpenMVG_USE_INTERNAL_OSI=OFF
|
||||
-DOpenMVG_USE_INTERNAL_EIGEN=OFF
|
||||
-DOpenMVG_USE_INTERNAL_CEREAL=OFF
|
||||
-DOpenMVG_USE_INTERNAL_CERES=OFF
|
||||
-DOpenMVG_USE_INTERNAL_FLANN=OFF
|
||||
-DTARGET_ARCHITECTURE=core # disable instruction like avx
|
||||
# OPTIONS_RELEASE -DOPTIMIZE=1
|
||||
OPTIONS_RELEASE
|
||||
-DFLANN_LIBRARY=${CURRENT_INSTALLED_DIR}/lib/flann_cpp.lib
|
||||
OPTIONS_DEBUG
|
||||
-DFLANN_LIBRARY=${CURRENT_INSTALLED_DIR}/debug/lib/flann_cpp-gd.lib
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
vcpkg_fixup_cmake_targets(CONFIG_PATH "share/openMVG/cmake")
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/openMVG/image/image_test)
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/openMVG/exif/image_data)
|
||||
file(GLOB REMOVE_CMAKE ${CURRENT_PACKAGES_DIR}/lib/*.cmake)
|
||||
file(REMOVE_RECURSE ${REMOVE_CMAKE})
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
|
||||
if(OpenMVG_BUILD_SHARED)
|
||||
# release
|
||||
file(GLOB DLL_FILES ${CURRENT_PACKAGES_DIR}/lib/*.dll)
|
||||
file(COPY ${DLL_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/bin)
|
||||
file(REMOVE_RECURSE ${DLL_FILES})
|
||||
# debug
|
||||
file(GLOB DLL_FILES ${CURRENT_PACKAGES_DIR}/debug/lib/*.dll)
|
||||
file(COPY ${DLL_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin)
|
||||
file(REMOVE_RECURSE ${DLL_FILES})
|
||||
endif()
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
# Handle copyright
|
||||
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/openmvg RENAME copyright)
|
||||
|
||||
# Post-build test for cmake libraries
|
||||
# vcpkg_test_cmake(PACKAGE_NAME openmvg)
|
112
ports/osi/CMakeLists.txt
Normal file
112
ports/osi/CMakeLists.txt
Normal file
@ -0,0 +1,112 @@
|
||||
cmake_minimum_required(VERSION 3.11)
|
||||
|
||||
project(Osi LANGUAGES C CXX)
|
||||
|
||||
set(PROJECT_VERSION 0.107.9)
|
||||
set(PROJECT_VERSION_MAJOR 0)
|
||||
set(PROJECT_VERSION_MINOR 107)
|
||||
set(PROJECT_VERSION_PATCH 9)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
|
||||
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||
if(BUILD_SHARED_LIBS AND MSVC)
|
||||
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
||||
endif(BUILD_SHARED_LIBS AND MSVC)
|
||||
if(MSVC)
|
||||
set(
|
||||
CMAKE_CXX_FLAGS
|
||||
"${CMAKE_CXX_FLAGS} /bigobj /MP /wd4996 /wd4819 /wd4251 /wd4267 /wd4244 /wd4275"
|
||||
)
|
||||
endif(MSVC)
|
||||
if(APPLE)
|
||||
set(
|
||||
CMAKE_CXX_FLAGS
|
||||
"${CMAKE_CXX_FLAGS} -Wno-inconsistent-missing-override -Wno-unused-command-line-argument -Wno-unused-result -Wno-exceptions"
|
||||
)
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9"
|
||||
CACHE STRING "Minimum OS X deployment version")
|
||||
endif(APPLE)
|
||||
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
|
||||
# options
|
||||
option(BUILD_SHARED_LIBS "" ON)
|
||||
|
||||
#
|
||||
# 设置用于 install 的变量
|
||||
#
|
||||
# Introduce variables: * CMAKE_INSTALL_LIBDIR * CMAKE_INSTALL_BINDIR
|
||||
include(GNUInstallDirs)
|
||||
|
||||
# Include module with fuction 'write_basic_package_version_file'
|
||||
include(CMakePackageConfigHelpers)
|
||||
|
||||
# Layout. This works for all platforms: * <prefix>/lib*/cmake/<PROJECT-NAME> *
|
||||
# <prefix>/lib*/ * <prefix>/include/
|
||||
set(config_install_dir "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")
|
||||
set(generated_dir "${CMAKE_CURRENT_BINARY_DIR}/generated")
|
||||
# Configuration
|
||||
set(version_config "${generated_dir}/${PROJECT_NAME}ConfigVersion.cmake")
|
||||
set(project_config "${generated_dir}/${PROJECT_NAME}Config.cmake")
|
||||
set(TARGETS_EXPORT_NAME "${PROJECT_NAME}Targets")
|
||||
set(namespace "Coin::")
|
||||
|
||||
# Packages
|
||||
find_package(CoinUtils REQUIRED)
|
||||
|
||||
# Add sources
|
||||
include_directories(Osi/src/Osi)
|
||||
|
||||
file(GLOB OSI_SOURCES Osi/src/Osi/*.hpp Osi/src/Osi/*.cpp)
|
||||
|
||||
add_library(${PROJECT_NAME} ${OSI_SOURCES})
|
||||
|
||||
target_include_directories(${PROJECT_NAME}
|
||||
PUBLIC $<INSTALL_INTERFACE:include/coin>)
|
||||
target_compile_definitions(${PROJECT_NAME}
|
||||
PUBLIC
|
||||
$<INSTALL_INTERFACE:-DHAVE_CMATH>
|
||||
$<INSTALL_INTERFACE:-D_CRT_SECURE_NO_WARNINGS>)
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE Coin::CoinUtils)
|
||||
|
||||
install(TARGETS ${PROJECT_NAME}
|
||||
EXPORT "${TARGETS_EXPORT_NAME}"
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
RUNTIME DESTINATION bin
|
||||
INCLUDES
|
||||
DESTINATION include)
|
||||
|
||||
install(DIRECTORY Osi/src/Osi/
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/coin
|
||||
FILES_MATCHING
|
||||
PATTERN "*.h"
|
||||
PATTERN "*.hpp"
|
||||
PATTERN "config_default.h" EXCLUDE)
|
||||
|
||||
#
|
||||
# Install Libraries
|
||||
#
|
||||
# Configure '<PROJECT-NAME>ConfigVersion.cmake' Use: * PROJECT_VERSION
|
||||
write_basic_package_version_file("${version_config}"
|
||||
COMPATIBILITY SameMajorVersion)
|
||||
|
||||
# Configure '<PROJECT-NAME>Config.cmake' Use variables: * TARGETS_EXPORT_NAME *
|
||||
# PROJECT_NAME
|
||||
configure_package_config_file("Config.cmake.in"
|
||||
"${project_config}"
|
||||
INSTALL_DESTINATION
|
||||
"${config_install_dir}")
|
||||
|
||||
# Config * <prefix>/lib/cmake/Foo/FooConfig.cmake *
|
||||
# <prefix>/lib/cmake/Foo/FooConfigVersion.cmake
|
||||
install(FILES "${project_config}" "${version_config}"
|
||||
DESTINATION "${config_install_dir}")
|
||||
|
||||
# Config * <prefix>/lib/cmake/Foo/FooTargets.cmake
|
||||
install(EXPORT "${TARGETS_EXPORT_NAME}"
|
||||
NAMESPACE "${namespace}"
|
||||
DESTINATION "${config_install_dir}")
|
4
ports/osi/CONTROL
Normal file
4
ports/osi/CONTROL
Normal file
@ -0,0 +1,4 @@
|
||||
Source: osi
|
||||
Version: 0.107.9-0
|
||||
Description: Osi (Open Solver Interface) provides an abstract base class to a generic linear programming (LP) solver, along with derived classes for specific solvers. Many applications may be able to use the Osi to insulate themselves from a specific LP solver.
|
||||
Build-Depends: coinutils
|
5
ports/osi/Config.cmake.in
Normal file
5
ports/osi/Config.cmake.in
Normal file
@ -0,0 +1,5 @@
|
||||
|
||||
@PACKAGE_INIT@
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake")
|
||||
check_required_components("@PROJECT_NAME@")
|
45
ports/osi/portfile.cmake
Normal file
45
ports/osi/portfile.cmake
Normal file
@ -0,0 +1,45 @@
|
||||
# Common Ambient Variables:
|
||||
# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT}
|
||||
# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET}
|
||||
# CURRENT_PORT_DIR = ${VCPKG_ROOT_DIR}\ports\${PORT}
|
||||
# PORT = current port name (zlib, etc)
|
||||
# TARGET_TRIPLET = current triplet (x86-windows, x64-windows-static, etc)
|
||||
# VCPKG_CRT_LINKAGE = C runtime linkage type (static, dynamic)
|
||||
# VCPKG_LIBRARY_LINKAGE = target library linkage type (static, dynamic)
|
||||
# VCPKG_ROOT_DIR = <C:\path\to\current\vcpkg>
|
||||
# VCPKG_TARGET_ARCHITECTURE = target architecture (x64, x86, arm)
|
||||
#
|
||||
|
||||
include(vcpkg_common_functions)
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO coin-or/Osi
|
||||
REF releases/0.107.9
|
||||
SHA512 52501e2fa81ad9ec1412596b5945e11f2d5c5c91bdb148f41dad9efb8e4a033cfc2f76e389b9e546593b89ae6c7f74c32e6c5b78337c967ad0c90cd6a7183a28
|
||||
)
|
||||
|
||||
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
|
||||
file(COPY ${CMAKE_CURRENT_LIST_DIR}/Config.cmake.in DESTINATION ${SOURCE_PATH})
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
||||
set(BUILD_SHARED_LIBS ON)
|
||||
else()
|
||||
set(BUILD_SHARED_LIBS OFF)
|
||||
endif()
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA # Disable this option if project cannot be built with Ninja
|
||||
OPTIONS
|
||||
-DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
vcpkg_copy_pdbs()
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
||||
vcpkg_fixup_cmake_targets(CONFIG_PATH "lib/cmake/Osi")
|
||||
|
||||
# Handle copyright
|
||||
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/osi RENAME copyright)
|
||||
|
||||
# Post-build test for cmake libraries
|
||||
# vcpkg_test_cmake(PACKAGE_NAME osi)
|
Loading…
x
Reference in New Issue
Block a user