mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-14 05:38:00 +08:00
[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
This commit is contained in:
parent
26a9338c50
commit
5898891125
@ -1,3 +1,4 @@
|
||||
Source: armadillo
|
||||
Version: 2019-04-16-f00d3225
|
||||
Version: 2019-04-16-1
|
||||
Description: Armadillo is a high quality linear algebra library (matrix maths) for the C++ language, aiming towards a good balance between speed and ease of use
|
||||
Build-Depends: openblas (!osx), clapack (!osx)
|
||||
|
@ -1,29 +1,35 @@
|
||||
include(vcpkg_common_functions)
|
||||
|
||||
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
||||
|
||||
vcpkg_from_gitlab(
|
||||
GITLAB_URL https://gitlab.com
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO conradsnicta/armadillo-code
|
||||
REF f00d3225b1c005775044369723f31cecc3cd6569
|
||||
SHA512 ca3574edf5de8c752867403c3856ed9569fbed2ce9729585cae59be5751493c2e71121319b0a812e2ea56baada6b6f62fbc84ce6f1efb362347e5fd4141ccf1b
|
||||
HEAD_REF 9.400.x
|
||||
)
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
OPTIONS
|
||||
-DDETECT_HDF5=false
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
vcpkg_fixup_cmake_targets(CONFIG_PATH share/Armadillo/CMake TARGET_PATH share/armadillo)
|
||||
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
|
||||
|
||||
file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/Armadillo RENAME copyright)
|
||||
include(vcpkg_common_functions)
|
||||
|
||||
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
||||
|
||||
vcpkg_from_gitlab(
|
||||
GITLAB_URL https://gitlab.com
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO conradsnicta/armadillo-code
|
||||
REF f00d3225b1c005775044369723f31cecc3cd6569
|
||||
SHA512 ca3574edf5de8c752867403c3856ed9569fbed2ce9729585cae59be5751493c2e71121319b0a812e2ea56baada6b6f62fbc84ce6f1efb362347e5fd4141ccf1b
|
||||
HEAD_REF 9.400.x
|
||||
PATCHES
|
||||
remove_custom_modules.patch
|
||||
)
|
||||
|
||||
file(REMOVE ${SOURCE_PATH}/cmake_aux/Modules/ARMA_FindBLAS.cmake)
|
||||
file(REMOVE ${SOURCE_PATH}/cmake_aux/Modules/ARMA_FindLAPACK.cmake)
|
||||
file(REMOVE ${SOURCE_PATH}/cmake_aux/Modules/ARMA_FindOpenBLAS.cmake)
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
OPTIONS
|
||||
-DDETECT_HDF5=false
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
vcpkg_fixup_cmake_targets(CONFIG_PATH share/armadillo/CMake TARGET_PATH share/armadillo)
|
||||
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
|
||||
|
||||
file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/armadillo RENAME copyright)
|
||||
|
17
ports/armadillo/remove_custom_modules.patch
Normal file
17
ports/armadillo/remove_custom_modules.patch
Normal file
@ -0,0 +1,17 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 0959127..9fea721 100755
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -176,10 +176,9 @@ else()
|
||||
include(ARMA_FindMKL)
|
||||
include(ARMA_FindACMLMP)
|
||||
include(ARMA_FindACML)
|
||||
- include(ARMA_FindOpenBLAS)
|
||||
include(ARMA_FindATLAS)
|
||||
- include(ARMA_FindBLAS)
|
||||
- include(ARMA_FindLAPACK)
|
||||
+ find_package(BLAS)
|
||||
+ find_package(LAPACK)
|
||||
|
||||
message(STATUS " MKL_FOUND = ${MKL_FOUND}" )
|
||||
message(STATUS " ACMLMP_FOUND = ${ACMLMP_FOUND}" )
|
@ -50,7 +50,7 @@ file(READ ${CURRENT_PACKAGES_DIR}/share/assimp/assimp-config.cmake ASSIMP_CONFIG
|
||||
string(REPLACE "get_filename_component(ASSIMP_ROOT_DIR \"\${_PREFIX}\" PATH)"
|
||||
"set(ASSIMP_ROOT_DIR \${_PREFIX})" ASSIMP_CONFIG ${ASSIMP_CONFIG})
|
||||
|
||||
if(WIN32)
|
||||
if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
||||
string(REPLACE "set( ASSIMP_LIBRARIES \${ASSIMP_LIBRARIES})"
|
||||
"set( ASSIMP_LIBRARIES optimized \${ASSIMP_LIBRARY_DIRS}/\${ASSIMP_LIBRARIES}.lib debug \${ASSIMP_LIBRARY_DIRS}/../debug/lib/\${ASSIMP_LIBRARIES}d.lib)" ASSIMP_CONFIG ${ASSIMP_CONFIG})
|
||||
else()
|
||||
|
@ -1,4 +1,4 @@
|
||||
Source: blaze
|
||||
Version: 3.5
|
||||
Build-Depends: clapack, boost-exception
|
||||
Build-Depends: clapack (!osx), boost-exception
|
||||
Description: Blaze is an open-source, high-performance C++ math library for dense and sparse arithmetic.
|
||||
|
@ -1,949 +0,0 @@
|
||||
diff --git a/cmake/FindGflags.cmake b/cmake/FindGflags.cmake
|
||||
deleted file mode 100644
|
||||
index 32c04ea..0000000
|
||||
--- a/cmake/FindGflags.cmake
|
||||
+++ /dev/null
|
||||
@@ -1,591 +0,0 @@
|
||||
-# Ceres Solver - A fast non-linear least squares minimizer
|
||||
-# Copyright 2015 Google Inc. All rights reserved.
|
||||
-# http://ceres-solver.org/
|
||||
-#
|
||||
-# Redistribution and use in source and binary forms, with or without
|
||||
-# modification, are permitted provided that the following conditions are met:
|
||||
-#
|
||||
-# * Redistributions of source code must retain the above copyright notice,
|
||||
-# this list of conditions and the following disclaimer.
|
||||
-# * Redistributions in binary form must reproduce the above copyright notice,
|
||||
-# this list of conditions and the following disclaimer in the documentation
|
||||
-# and/or other materials provided with the distribution.
|
||||
-# * Neither the name of Google Inc. nor the names of its contributors may be
|
||||
-# used to endorse or promote products derived from this software without
|
||||
-# specific prior written permission.
|
||||
-#
|
||||
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
-# POSSIBILITY OF SUCH DAMAGE.
|
||||
-#
|
||||
-# Author: alexs.mac@gmail.com (Alex Stewart)
|
||||
-#
|
||||
-
|
||||
-# FindGflags.cmake - Find Google gflags logging library.
|
||||
-#
|
||||
-# This module will attempt to find gflags, either via an exported CMake
|
||||
-# configuration (generated by gflags >= 2.1 which are built with CMake), or
|
||||
-# by performing a standard search for all gflags components. The order of
|
||||
-# precedence for these two methods of finding gflags is controlled by:
|
||||
-# GFLAGS_PREFER_EXPORTED_GFLAGS_CMAKE_CONFIGURATION.
|
||||
-#
|
||||
-# This module defines the following variables:
|
||||
-#
|
||||
-# GFLAGS_FOUND: TRUE iff gflags is found.
|
||||
-# GFLAGS_INCLUDE_DIRS: Include directories for gflags.
|
||||
-# GFLAGS_LIBRARIES: Libraries required to link gflags.
|
||||
-# GFLAGS_NAMESPACE: The namespace in which gflags is defined. In versions of
|
||||
-# gflags < 2.1, this was google, for versions >= 2.1 it is
|
||||
-# by default gflags, although can be configured when building
|
||||
-# gflags to be something else (i.e. google for legacy
|
||||
-# compatibility).
|
||||
-# FOUND_INSTALLED_GFLAGS_CMAKE_CONFIGURATION: True iff the version of gflags
|
||||
-# found was built & installed /
|
||||
-# exported as a CMake package.
|
||||
-#
|
||||
-# The following variables control the behaviour of this module when an exported
|
||||
-# gflags CMake configuration is not found.
|
||||
-#
|
||||
-# GFLAGS_PREFER_EXPORTED_GFLAGS_CMAKE_CONFIGURATION: TRUE/FALSE, iff TRUE then
|
||||
-# then prefer using an exported CMake configuration
|
||||
-# generated by gflags >= 2.1 over searching for the
|
||||
-# gflags components manually. Otherwise (FALSE)
|
||||
-# ignore any exported gflags CMake configurations and
|
||||
-# always perform a manual search for the components.
|
||||
-# Default: TRUE iff user does not define this variable
|
||||
-# before we are called, and does NOT specify either
|
||||
-# GFLAGS_INCLUDE_DIR_HINTS or GFLAGS_LIBRARY_DIR_HINTS
|
||||
-# otherwise FALSE.
|
||||
-# GFLAGS_INCLUDE_DIR_HINTS: List of additional directories in which to
|
||||
-# search for gflags includes, e.g: /timbuktu/include.
|
||||
-# GFLAGS_LIBRARY_DIR_HINTS: List of additional directories in which to
|
||||
-# search for gflags libraries, e.g: /timbuktu/lib.
|
||||
-#
|
||||
-# The following variables are also defined by this module, but in line with
|
||||
-# CMake recommended FindPackage() module style should NOT be referenced directly
|
||||
-# by callers (use the plural variables detailed above instead). These variables
|
||||
-# do however affect the behaviour of the module via FIND_[PATH/LIBRARY]() which
|
||||
-# are NOT re-called (i.e. search for library is not repeated) if these variables
|
||||
-# are set with valid values _in the CMake cache_. This means that if these
|
||||
-# variables are set directly in the cache, either by the user in the CMake GUI,
|
||||
-# or by the user passing -DVAR=VALUE directives to CMake when called (which
|
||||
-# explicitly defines a cache variable), then they will be used verbatim,
|
||||
-# bypassing the HINTS variables and other hard-coded search locations.
|
||||
-#
|
||||
-# GFLAGS_INCLUDE_DIR: Include directory for gflags, not including the
|
||||
-# include directory of any dependencies.
|
||||
-# GFLAGS_LIBRARY: gflags library, not including the libraries of any
|
||||
-# dependencies.
|
||||
-
|
||||
-# Reset CALLERS_CMAKE_FIND_LIBRARY_PREFIXES to its value when FindGflags was
|
||||
-# invoked, necessary for MSVC.
|
||||
-macro(GFLAGS_RESET_FIND_LIBRARY_PREFIX)
|
||||
- if (MSVC AND CALLERS_CMAKE_FIND_LIBRARY_PREFIXES)
|
||||
- set(CMAKE_FIND_LIBRARY_PREFIXES "${CALLERS_CMAKE_FIND_LIBRARY_PREFIXES}")
|
||||
- endif()
|
||||
-endmacro(GFLAGS_RESET_FIND_LIBRARY_PREFIX)
|
||||
-
|
||||
-# Called if we failed to find gflags or any of it's required dependencies,
|
||||
-# unsets all public (designed to be used externally) variables and reports
|
||||
-# error message at priority depending upon [REQUIRED/QUIET/<NONE>] argument.
|
||||
-macro(GFLAGS_REPORT_NOT_FOUND REASON_MSG)
|
||||
- unset(GFLAGS_FOUND)
|
||||
- unset(GFLAGS_INCLUDE_DIRS)
|
||||
- unset(GFLAGS_LIBRARIES)
|
||||
- # Do not use unset, as we want to keep GFLAGS_NAMESPACE in the cache,
|
||||
- # but simply clear its value.
|
||||
- set(GFLAGS_NAMESPACE "" CACHE STRING
|
||||
- "gflags namespace (google or gflags)" FORCE)
|
||||
-
|
||||
- # Make results of search visible in the CMake GUI if gflags has not
|
||||
- # been found so that user does not have to toggle to advanced view.
|
||||
- mark_as_advanced(CLEAR GFLAGS_INCLUDE_DIR
|
||||
- GFLAGS_LIBRARY
|
||||
- GFLAGS_NAMESPACE)
|
||||
-
|
||||
- gflags_reset_find_library_prefix()
|
||||
-
|
||||
- # Note <package>_FIND_[REQUIRED/QUIETLY] variables defined by FindPackage()
|
||||
- # use the camelcase library name, not uppercase.
|
||||
- if (Gflags_FIND_QUIETLY)
|
||||
- message(STATUS "Failed to find gflags - " ${REASON_MSG} ${ARGN})
|
||||
- elseif (Gflags_FIND_REQUIRED)
|
||||
- message(FATAL_ERROR "Failed to find gflags - " ${REASON_MSG} ${ARGN})
|
||||
- else()
|
||||
- # Neither QUIETLY nor REQUIRED, use no priority which emits a message
|
||||
- # but continues configuration and allows generation.
|
||||
- message("-- Failed to find gflags - " ${REASON_MSG} ${ARGN})
|
||||
- endif ()
|
||||
- return()
|
||||
-endmacro(GFLAGS_REPORT_NOT_FOUND)
|
||||
-
|
||||
-# Verify that all variable names passed as arguments are defined (can be empty
|
||||
-# but must be defined) or raise a fatal error.
|
||||
-macro(GFLAGS_CHECK_VARS_DEFINED)
|
||||
- foreach(CHECK_VAR ${ARGN})
|
||||
- if (NOT DEFINED ${CHECK_VAR})
|
||||
- message(FATAL_ERROR "Ceres Bug: ${CHECK_VAR} is not defined.")
|
||||
- endif()
|
||||
- endforeach()
|
||||
-endmacro(GFLAGS_CHECK_VARS_DEFINED)
|
||||
-
|
||||
-# Use check_cxx_source_compiles() to compile trivial test programs to determine
|
||||
-# the gflags namespace. This works on all OSs except Windows. If using Visual
|
||||
-# Studio, it fails because msbuild forces check_cxx_source_compiles() to use
|
||||
-# CMAKE_BUILD_TYPE=Debug for the test project, which usually breaks detection
|
||||
-# because MSVC requires that the test project use the same build type as gflags,
|
||||
-# which would normally be built in Release.
|
||||
-#
|
||||
-# Defines: GFLAGS_NAMESPACE in the caller's scope with the detected namespace,
|
||||
-# which is blank (empty string, will test FALSE is CMake conditionals)
|
||||
-# if detection failed.
|
||||
-function(GFLAGS_CHECK_GFLAGS_NAMESPACE_USING_TRY_COMPILE)
|
||||
- # Verify that all required variables are defined.
|
||||
- gflags_check_vars_defined(
|
||||
- GFLAGS_INCLUDE_DIR GFLAGS_LIBRARY)
|
||||
- # Ensure that GFLAGS_NAMESPACE is always unset on completion unless
|
||||
- # we explicitly set if after having the correct namespace.
|
||||
- set(GFLAGS_NAMESPACE "" PARENT_SCOPE)
|
||||
-
|
||||
- include(CheckCXXSourceCompiles)
|
||||
- # Setup include path & link library for gflags for CHECK_CXX_SOURCE_COMPILES.
|
||||
- set(CMAKE_REQUIRED_INCLUDES ${GFLAGS_INCLUDE_DIR})
|
||||
- set(CMAKE_REQUIRED_LIBRARIES ${GFLAGS_LIBRARY} ${GFLAGS_LINK_LIBRARIES})
|
||||
- # First try the (older) google namespace. Note that the output variable
|
||||
- # MUST be unique to the build type as otherwise the test is not repeated as
|
||||
- # it is assumed to have already been performed.
|
||||
- check_cxx_source_compiles(
|
||||
- "#include <gflags/gflags.h>
|
||||
- int main(int argc, char * argv[]) {
|
||||
- google::ParseCommandLineFlags(&argc, &argv, true);
|
||||
- return 0;
|
||||
- }"
|
||||
- GFLAGS_IN_GOOGLE_NAMESPACE)
|
||||
- if (GFLAGS_IN_GOOGLE_NAMESPACE)
|
||||
- set(GFLAGS_NAMESPACE google PARENT_SCOPE)
|
||||
- return()
|
||||
- endif()
|
||||
-
|
||||
- # Try (newer) gflags namespace instead. Note that the output variable
|
||||
- # MUST be unique to the build type as otherwise the test is not repeated as
|
||||
- # it is assumed to have already been performed.
|
||||
- set(CMAKE_REQUIRED_INCLUDES ${GFLAGS_INCLUDE_DIR})
|
||||
- set(CMAKE_REQUIRED_LIBRARIES ${GFLAGS_LIBRARY} ${GFLAGS_LINK_LIBRARIES})
|
||||
- check_cxx_source_compiles(
|
||||
- "#include <gflags/gflags.h>
|
||||
- int main(int argc, char * argv[]) {
|
||||
- gflags::ParseCommandLineFlags(&argc, &argv, true);
|
||||
- return 0;
|
||||
- }"
|
||||
- GFLAGS_IN_GFLAGS_NAMESPACE)
|
||||
- if (GFLAGS_IN_GFLAGS_NAMESPACE)
|
||||
- set(GFLAGS_NAMESPACE gflags PARENT_SCOPE)
|
||||
- return()
|
||||
- endif (GFLAGS_IN_GFLAGS_NAMESPACE)
|
||||
-endfunction(GFLAGS_CHECK_GFLAGS_NAMESPACE_USING_TRY_COMPILE)
|
||||
-
|
||||
-# Use regex on the gflags headers to attempt to determine the gflags namespace.
|
||||
-# Checks both gflags.h (contained namespace on versions < 2.1.2) and
|
||||
-# gflags_declare.h, which contains the namespace on versions >= 2.1.2.
|
||||
-# In general, this method should only be used when
|
||||
-# GFLAGS_CHECK_GFLAGS_NAMESPACE_USING_TRY_COMPILE() cannot be used, or has
|
||||
-# failed.
|
||||
-#
|
||||
-# Defines: GFLAGS_NAMESPACE in the caller's scope with the detected namespace,
|
||||
-# which is blank (empty string, will test FALSE is CMake conditionals)
|
||||
-# if detection failed.
|
||||
-function(GFLAGS_CHECK_GFLAGS_NAMESPACE_USING_REGEX)
|
||||
- # Verify that all required variables are defined.
|
||||
- gflags_check_vars_defined(GFLAGS_INCLUDE_DIR)
|
||||
- # Ensure that GFLAGS_NAMESPACE is always undefined on completion unless
|
||||
- # we explicitly set if after having the correct namespace.
|
||||
- set(GFLAGS_NAMESPACE "" PARENT_SCOPE)
|
||||
-
|
||||
- # Scan gflags.h to identify what namespace gflags was built with. On
|
||||
- # versions of gflags < 2.1.2, gflags.h was configured with the namespace
|
||||
- # directly, on >= 2.1.2, gflags.h uses the GFLAGS_NAMESPACE #define which
|
||||
- # is defined in gflags_declare.h, we try each location in turn.
|
||||
- set(GFLAGS_HEADER_FILE ${GFLAGS_INCLUDE_DIR}/gflags/gflags.h)
|
||||
- if (NOT EXISTS ${GFLAGS_HEADER_FILE})
|
||||
- gflags_report_not_found(
|
||||
- "Could not find file: ${GFLAGS_HEADER_FILE} "
|
||||
- "containing namespace information in gflags install located at: "
|
||||
- "${GFLAGS_INCLUDE_DIR}.")
|
||||
- endif()
|
||||
- file(READ ${GFLAGS_HEADER_FILE} GFLAGS_HEADER_FILE_CONTENTS)
|
||||
-
|
||||
- string(REGEX MATCH "namespace [A-Za-z]+"
|
||||
- GFLAGS_NAMESPACE "${GFLAGS_HEADER_FILE_CONTENTS}")
|
||||
- string(REGEX REPLACE "namespace ([A-Za-z]+)" "\\1"
|
||||
- GFLAGS_NAMESPACE "${GFLAGS_NAMESPACE}")
|
||||
-
|
||||
- if (NOT GFLAGS_NAMESPACE)
|
||||
- gflags_report_not_found(
|
||||
- "Failed to extract gflags namespace from header file: "
|
||||
- "${GFLAGS_HEADER_FILE}.")
|
||||
- endif (NOT GFLAGS_NAMESPACE)
|
||||
-
|
||||
- if (GFLAGS_NAMESPACE STREQUAL "google" OR
|
||||
- GFLAGS_NAMESPACE STREQUAL "gflags")
|
||||
- # Found valid gflags namespace from gflags.h.
|
||||
- set(GFLAGS_NAMESPACE "${GFLAGS_NAMESPACE}" PARENT_SCOPE)
|
||||
- return()
|
||||
- endif()
|
||||
-
|
||||
- # Failed to find gflags namespace from gflags.h, gflags is likely a new
|
||||
- # version, check gflags_declare.h, which in newer versions (>= 2.1.2) contains
|
||||
- # the GFLAGS_NAMESPACE #define, which is then referenced in gflags.h.
|
||||
- set(GFLAGS_DECLARE_FILE ${GFLAGS_INCLUDE_DIR}/gflags/gflags_declare.h)
|
||||
- if (NOT EXISTS ${GFLAGS_DECLARE_FILE})
|
||||
- gflags_report_not_found(
|
||||
- "Could not find file: ${GFLAGS_DECLARE_FILE} "
|
||||
- "containing namespace information in gflags install located at: "
|
||||
- "${GFLAGS_INCLUDE_DIR}.")
|
||||
- endif()
|
||||
- file(READ ${GFLAGS_DECLARE_FILE} GFLAGS_DECLARE_FILE_CONTENTS)
|
||||
-
|
||||
- string(REGEX MATCH "#define GFLAGS_NAMESPACE [A-Za-z]+"
|
||||
- GFLAGS_NAMESPACE "${GFLAGS_DECLARE_FILE_CONTENTS}")
|
||||
- string(REGEX REPLACE "#define GFLAGS_NAMESPACE ([A-Za-z]+)" "\\1"
|
||||
- GFLAGS_NAMESPACE "${GFLAGS_NAMESPACE}")
|
||||
-
|
||||
- if (NOT GFLAGS_NAMESPACE)
|
||||
- gflags_report_not_found(
|
||||
- "Failed to extract gflags namespace from declare file: "
|
||||
- "${GFLAGS_DECLARE_FILE}.")
|
||||
- endif (NOT GFLAGS_NAMESPACE)
|
||||
-
|
||||
- if (GFLAGS_NAMESPACE STREQUAL "google" OR
|
||||
- GFLAGS_NAMESPACE STREQUAL "gflags")
|
||||
- # Found valid gflags namespace from gflags.h.
|
||||
- set(GFLAGS_NAMESPACE "${GFLAGS_NAMESPACE}" PARENT_SCOPE)
|
||||
- return()
|
||||
- endif()
|
||||
-endfunction(GFLAGS_CHECK_GFLAGS_NAMESPACE_USING_REGEX)
|
||||
-
|
||||
-# Protect against any alternative find_package scripts for this library having
|
||||
-# been called previously (in a client project) which set GFLAGS_FOUND, but not
|
||||
-# the other variables we require / set here which could cause the search logic
|
||||
-# here to fail.
|
||||
-unset(GFLAGS_FOUND)
|
||||
-
|
||||
-# -----------------------------------------------------------------
|
||||
-# By default, if the user has expressed no preference for using an exported
|
||||
-# gflags CMake configuration over performing a search for the installed
|
||||
-# components, and has not specified any hints for the search locations, then
|
||||
-# prefer a gflags exported configuration if available.
|
||||
-if (NOT DEFINED GFLAGS_PREFER_EXPORTED_GFLAGS_CMAKE_CONFIGURATION
|
||||
- AND NOT GFLAGS_INCLUDE_DIR_HINTS
|
||||
- AND NOT GFLAGS_LIBRARY_DIR_HINTS)
|
||||
- message(STATUS "No preference for use of exported gflags CMake configuration "
|
||||
- "set, and no hints for include/library directories provided. "
|
||||
- "Defaulting to preferring an installed/exported gflags CMake configuration "
|
||||
- "if available.")
|
||||
- set(GFLAGS_PREFER_EXPORTED_GFLAGS_CMAKE_CONFIGURATION TRUE)
|
||||
-endif()
|
||||
-
|
||||
-if (GFLAGS_PREFER_EXPORTED_GFLAGS_CMAKE_CONFIGURATION)
|
||||
- # Try to find an exported CMake configuration for gflags, as generated by
|
||||
- # gflags versions >= 2.1.
|
||||
- #
|
||||
- # We search twice, s/t we can invert the ordering of precedence used by
|
||||
- # find_package() for exported package build directories, and installed
|
||||
- # packages (found via CMAKE_SYSTEM_PREFIX_PATH), listed as items 6) and 7)
|
||||
- # respectively in [1].
|
||||
- #
|
||||
- # By default, exported build directories are (in theory) detected first, and
|
||||
- # this is usually the case on Windows. However, on OS X & Linux, the install
|
||||
- # path (/usr/local) is typically present in the PATH environment variable
|
||||
- # which is checked in item 4) in [1] (i.e. before both of the above, unless
|
||||
- # NO_SYSTEM_ENVIRONMENT_PATH is passed). As such on those OSs installed
|
||||
- # packages are usually detected in preference to exported package build
|
||||
- # directories.
|
||||
- #
|
||||
- # To ensure a more consistent response across all OSs, and as users usually
|
||||
- # want to prefer an installed version of a package over a locally built one
|
||||
- # where both exist (esp. as the exported build directory might be removed
|
||||
- # after installation), we first search with NO_CMAKE_PACKAGE_REGISTRY which
|
||||
- # means any build directories exported by the user are ignored, and thus
|
||||
- # installed directories are preferred. If this fails to find the package
|
||||
- # we then research again, but without NO_CMAKE_PACKAGE_REGISTRY, so any
|
||||
- # exported build directories will now be detected.
|
||||
- #
|
||||
- # To prevent confusion on Windows, we also pass NO_CMAKE_BUILDS_PATH (which
|
||||
- # is item 5) in [1]), to not preferentially use projects that were built
|
||||
- # recently with the CMake GUI to ensure that we always prefer an installed
|
||||
- # version if available.
|
||||
- #
|
||||
- # [1] http://www.cmake.org/cmake/help/v2.8.11/cmake.html#command:find_package
|
||||
- find_package(gflags QUIET
|
||||
- NO_MODULE
|
||||
- NO_CMAKE_PACKAGE_REGISTRY
|
||||
- NO_CMAKE_BUILDS_PATH)
|
||||
- if (gflags_FOUND)
|
||||
- message(STATUS "Found installed version of gflags: ${gflags_DIR}")
|
||||
- else(gflags_FOUND)
|
||||
- # Failed to find an installed version of gflags, repeat search allowing
|
||||
- # exported build directories.
|
||||
- message(STATUS "Failed to find installed gflags CMake configuration, "
|
||||
- "searching for gflags build directories exported with CMake.")
|
||||
- # Again pass NO_CMAKE_BUILDS_PATH, as we know that gflags is exported and
|
||||
- # do not want to treat projects built with the CMake GUI preferentially.
|
||||
- find_package(gflags QUIET
|
||||
- NO_MODULE
|
||||
- NO_CMAKE_BUILDS_PATH)
|
||||
- if (gflags_FOUND)
|
||||
- message(STATUS "Found exported gflags build directory: ${gflags_DIR}")
|
||||
- endif(gflags_FOUND)
|
||||
- endif(gflags_FOUND)
|
||||
-
|
||||
- set(FOUND_INSTALLED_GFLAGS_CMAKE_CONFIGURATION ${gflags_FOUND})
|
||||
-
|
||||
- # gflags v2.1 - 2.1.2 shipped with a bug in their gflags-config.cmake [1]
|
||||
- # whereby gflags_LIBRARIES = "gflags", but there was no imported target
|
||||
- # called "gflags", they were called: gflags[_nothreads]-[static/shared].
|
||||
- # As this causes linker errors when gflags is not installed in a location
|
||||
- # on the current library paths, detect if this problem is present and
|
||||
- # fix it.
|
||||
- #
|
||||
- # [1] https://github.com/gflags/gflags/issues/110
|
||||
- if (gflags_FOUND)
|
||||
- # NOTE: This is not written as additional conditions in the outer
|
||||
- # if (gflags_FOUND) as the NOT TARGET "${gflags_LIBRARIES}"
|
||||
- # condition causes problems if gflags is not found.
|
||||
- if (${gflags_VERSION} VERSION_LESS 2.1.3 AND
|
||||
- NOT TARGET "${gflags_LIBRARIES}")
|
||||
- message(STATUS "Detected broken gflags install in: ${gflags_DIR}, "
|
||||
- "version: ${gflags_VERSION} <= 2.1.2 which defines gflags_LIBRARIES = "
|
||||
- "${gflags_LIBRARIES} which is not an imported CMake target, see: "
|
||||
- "https://github.com/gflags/gflags/issues/110. Attempting to fix by "
|
||||
- "detecting correct gflags target.")
|
||||
- # Ordering here expresses preference for detection, specifically we do not
|
||||
- # want to use the _nothreads variants if the full library is available.
|
||||
- list(APPEND CHECK_GFLAGS_IMPORTED_TARGET_NAMES
|
||||
- gflags-shared gflags-static
|
||||
- gflags_nothreads-shared gflags_nothreads-static)
|
||||
- foreach(CHECK_GFLAGS_TARGET ${CHECK_GFLAGS_IMPORTED_TARGET_NAMES})
|
||||
- if (TARGET ${CHECK_GFLAGS_TARGET})
|
||||
- message(STATUS "Found valid gflags target: ${CHECK_GFLAGS_TARGET}, "
|
||||
- "updating gflags_LIBRARIES.")
|
||||
- set(gflags_LIBRARIES ${CHECK_GFLAGS_TARGET})
|
||||
- break()
|
||||
- endif()
|
||||
- endforeach()
|
||||
- if (NOT TARGET ${gflags_LIBRARIES})
|
||||
- message(STATUS "Failed to fix detected broken gflags install in: "
|
||||
- "${gflags_DIR}, version: ${gflags_VERSION} <= 2.1.2, none of the "
|
||||
- "imported targets for gflags: ${CHECK_GFLAGS_IMPORTED_TARGET_NAMES} "
|
||||
- "are defined. Will continue with a manual search for gflags "
|
||||
- "components. We recommend you build/install a version of gflags > "
|
||||
- "2.1.2 (or master).")
|
||||
- set(FOUND_INSTALLED_GFLAGS_CMAKE_CONFIGURATION FALSE)
|
||||
- endif()
|
||||
- endif()
|
||||
- endif()
|
||||
-
|
||||
- if (FOUND_INSTALLED_GFLAGS_CMAKE_CONFIGURATION)
|
||||
- message(STATUS "Detected gflags version: ${gflags_VERSION}")
|
||||
- set(GFLAGS_FOUND ${gflags_FOUND})
|
||||
- set(GFLAGS_INCLUDE_DIR ${gflags_INCLUDE_DIR})
|
||||
- set(GFLAGS_LIBRARY ${gflags_LIBRARIES})
|
||||
-
|
||||
- # gflags does not export the namespace in their CMake configuration, so
|
||||
- # use our function to determine what it should be, as it can be either
|
||||
- # gflags or google dependent upon version & configuration.
|
||||
- #
|
||||
- # NOTE: We use the regex method to determine the namespace here, as
|
||||
- # check_cxx_source_compiles() will not use imported targets, which
|
||||
- # is what gflags will be in this case.
|
||||
- gflags_check_gflags_namespace_using_regex()
|
||||
-
|
||||
- if (NOT GFLAGS_NAMESPACE)
|
||||
- gflags_report_not_found(
|
||||
- "Failed to determine gflags namespace using regex for gflags "
|
||||
- "version: ${gflags_VERSION} exported here: ${gflags_DIR} using CMake.")
|
||||
- endif (NOT GFLAGS_NAMESPACE)
|
||||
- else (FOUND_INSTALLED_GFLAGS_CMAKE_CONFIGURATION)
|
||||
- message(STATUS "Failed to find an installed/exported CMake configuration "
|
||||
- "for gflags, will perform search for installed gflags components.")
|
||||
- endif (FOUND_INSTALLED_GFLAGS_CMAKE_CONFIGURATION)
|
||||
-endif(GFLAGS_PREFER_EXPORTED_GFLAGS_CMAKE_CONFIGURATION)
|
||||
-
|
||||
-if (NOT GFLAGS_FOUND)
|
||||
- # Either failed to find an exported gflags CMake configuration, or user
|
||||
- # told us not to use one. Perform a manual search for all gflags components.
|
||||
-
|
||||
- # Handle possible presence of lib prefix for libraries on MSVC, see
|
||||
- # also GFLAGS_RESET_FIND_LIBRARY_PREFIX().
|
||||
- if (MSVC)
|
||||
- # Preserve the caller's original values for CMAKE_FIND_LIBRARY_PREFIXES
|
||||
- # s/t we can set it back before returning.
|
||||
- set(CALLERS_CMAKE_FIND_LIBRARY_PREFIXES "${CMAKE_FIND_LIBRARY_PREFIXES}")
|
||||
- # The empty string in this list is important, it represents the case when
|
||||
- # the libraries have no prefix (shared libraries / DLLs).
|
||||
- set(CMAKE_FIND_LIBRARY_PREFIXES "lib" "" "${CMAKE_FIND_LIBRARY_PREFIXES}")
|
||||
- endif (MSVC)
|
||||
-
|
||||
- # Search user-installed locations first, so that we prefer user installs
|
||||
- # to system installs where both exist.
|
||||
- list(APPEND GFLAGS_CHECK_INCLUDE_DIRS
|
||||
- /usr/local/include
|
||||
- /usr/local/homebrew/include # Mac OS X
|
||||
- /opt/local/var/macports/software # Mac OS X.
|
||||
- /opt/local/include
|
||||
- /usr/include)
|
||||
- list(APPEND GFLAGS_CHECK_PATH_SUFFIXES
|
||||
- gflags/include # Windows (for C:/Program Files prefix).
|
||||
- gflags/Include ) # Windows (for C:/Program Files prefix).
|
||||
-
|
||||
- list(APPEND GFLAGS_CHECK_LIBRARY_DIRS
|
||||
- /usr/local/lib
|
||||
- /usr/local/homebrew/lib # Mac OS X.
|
||||
- /opt/local/lib
|
||||
- /usr/lib)
|
||||
- list(APPEND GFLAGS_CHECK_LIBRARY_SUFFIXES
|
||||
- gflags/lib # Windows (for C:/Program Files prefix).
|
||||
- gflags/Lib ) # Windows (for C:/Program Files prefix).
|
||||
-
|
||||
- # Search supplied hint directories first if supplied.
|
||||
- find_path(GFLAGS_INCLUDE_DIR
|
||||
- NAMES gflags/gflags.h
|
||||
- HINTS ${GFLAGS_INCLUDE_DIR_HINTS}
|
||||
- PATHS ${GFLAGS_CHECK_INCLUDE_DIRS}
|
||||
- PATH_SUFFIXES ${GFLAGS_CHECK_PATH_SUFFIXES})
|
||||
- if (NOT GFLAGS_INCLUDE_DIR OR
|
||||
- NOT EXISTS ${GFLAGS_INCLUDE_DIR})
|
||||
- gflags_report_not_found(
|
||||
- "Could not find gflags include directory, set GFLAGS_INCLUDE_DIR "
|
||||
- "to directory containing gflags/gflags.h")
|
||||
- endif (NOT GFLAGS_INCLUDE_DIR OR
|
||||
- NOT EXISTS ${GFLAGS_INCLUDE_DIR})
|
||||
-
|
||||
- find_library(GFLAGS_LIBRARY NAMES gflags
|
||||
- HINTS ${GFLAGS_LIBRARY_DIR_HINTS}
|
||||
- PATHS ${GFLAGS_CHECK_LIBRARY_DIRS}
|
||||
- PATH_SUFFIXES ${GFLAGS_CHECK_LIBRARY_SUFFIXES})
|
||||
- if (NOT GFLAGS_LIBRARY OR
|
||||
- NOT EXISTS ${GFLAGS_LIBRARY})
|
||||
- gflags_report_not_found(
|
||||
- "Could not find gflags library, set GFLAGS_LIBRARY "
|
||||
- "to full path to libgflags.")
|
||||
- endif (NOT GFLAGS_LIBRARY OR
|
||||
- NOT EXISTS ${GFLAGS_LIBRARY})
|
||||
-
|
||||
- # gflags typically requires a threading library (which is OS dependent), note
|
||||
- # that this defines the CMAKE_THREAD_LIBS_INIT variable. If we are able to
|
||||
- # detect threads, we assume that gflags requires it.
|
||||
- find_package(Threads QUIET)
|
||||
- set(GFLAGS_LINK_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
|
||||
- # On Windows (including MinGW), the Shlwapi library is used by gflags if
|
||||
- # available.
|
||||
- if (WIN32)
|
||||
- include(CheckIncludeFileCXX)
|
||||
- check_include_file_cxx("shlwapi.h" HAVE_SHLWAPI)
|
||||
- if (HAVE_SHLWAPI)
|
||||
- list(APPEND GFLAGS_LINK_LIBRARIES shlwapi.lib)
|
||||
- endif(HAVE_SHLWAPI)
|
||||
- endif (WIN32)
|
||||
-
|
||||
- # Mark internally as found, then verify. GFLAGS_REPORT_NOT_FOUND() unsets
|
||||
- # if called.
|
||||
- set(GFLAGS_FOUND TRUE)
|
||||
-
|
||||
- # Identify what namespace gflags was built with.
|
||||
- if (GFLAGS_INCLUDE_DIR AND NOT GFLAGS_NAMESPACE)
|
||||
- # To handle Windows peculiarities / CMake bugs on MSVC we try two approaches
|
||||
- # to detect the gflags namespace:
|
||||
- #
|
||||
- # 1) Try to use check_cxx_source_compiles() to compile a trivial program
|
||||
- # with the two choices for the gflags namespace.
|
||||
- #
|
||||
- # 2) [In the event 1) fails] Use regex on the gflags headers to try to
|
||||
- # determine the gflags namespace. Whilst this is less robust than 1),
|
||||
- # it does avoid any interaction with msbuild.
|
||||
- gflags_check_gflags_namespace_using_try_compile()
|
||||
-
|
||||
- if (NOT GFLAGS_NAMESPACE)
|
||||
- # Failed to determine gflags namespace using check_cxx_source_compiles()
|
||||
- # method, try and obtain it using regex on the gflags headers instead.
|
||||
- message(STATUS "Failed to find gflags namespace using using "
|
||||
- "check_cxx_source_compiles(), trying namespace regex instead, "
|
||||
- "this is expected on Windows.")
|
||||
- gflags_check_gflags_namespace_using_regex()
|
||||
-
|
||||
- if (NOT GFLAGS_NAMESPACE)
|
||||
- gflags_report_not_found(
|
||||
- "Failed to determine gflags namespace either by "
|
||||
- "check_cxx_source_compiles(), or namespace regex.")
|
||||
- endif (NOT GFLAGS_NAMESPACE)
|
||||
- endif (NOT GFLAGS_NAMESPACE)
|
||||
- endif (GFLAGS_INCLUDE_DIR AND NOT GFLAGS_NAMESPACE)
|
||||
-
|
||||
- # Make the GFLAGS_NAMESPACE a cache variable s/t the user can view it, and could
|
||||
- # overwrite it in the CMake GUI.
|
||||
- set(GFLAGS_NAMESPACE "${GFLAGS_NAMESPACE}" CACHE STRING
|
||||
- "gflags namespace (google or gflags)" FORCE)
|
||||
-
|
||||
- # gflags does not seem to provide any record of the version in its
|
||||
- # source tree, thus cannot extract version.
|
||||
-
|
||||
- # Catch case when caller has set GFLAGS_NAMESPACE in the cache / GUI
|
||||
- # with an invalid value.
|
||||
- if (GFLAGS_NAMESPACE AND
|
||||
- NOT GFLAGS_NAMESPACE STREQUAL "google" AND
|
||||
- NOT GFLAGS_NAMESPACE STREQUAL "gflags")
|
||||
- gflags_report_not_found(
|
||||
- "Caller defined GFLAGS_NAMESPACE:"
|
||||
- " ${GFLAGS_NAMESPACE} is not valid, not google or gflags.")
|
||||
- endif ()
|
||||
- # Catch case when caller has set GFLAGS_INCLUDE_DIR in the cache / GUI and
|
||||
- # thus FIND_[PATH/LIBRARY] are not called, but specified locations are
|
||||
- # invalid, otherwise we would report the library as found.
|
||||
- if (GFLAGS_INCLUDE_DIR AND
|
||||
- NOT EXISTS ${GFLAGS_INCLUDE_DIR}/gflags/gflags.h)
|
||||
- gflags_report_not_found(
|
||||
- "Caller defined GFLAGS_INCLUDE_DIR:"
|
||||
- " ${GFLAGS_INCLUDE_DIR} does not contain gflags/gflags.h header.")
|
||||
- endif (GFLAGS_INCLUDE_DIR AND
|
||||
- NOT EXISTS ${GFLAGS_INCLUDE_DIR}/gflags/gflags.h)
|
||||
- # TODO: This regex for gflags library is pretty primitive, we use lowercase
|
||||
- # for comparison to handle Windows using CamelCase library names, could
|
||||
- # this check be better?
|
||||
- string(TOLOWER "${GFLAGS_LIBRARY}" LOWERCASE_GFLAGS_LIBRARY)
|
||||
- if (GFLAGS_LIBRARY AND
|
||||
- NOT "${LOWERCASE_GFLAGS_LIBRARY}" MATCHES ".*gflags[^/]*")
|
||||
- gflags_report_not_found(
|
||||
- "Caller defined GFLAGS_LIBRARY: "
|
||||
- "${GFLAGS_LIBRARY} does not match gflags.")
|
||||
- endif (GFLAGS_LIBRARY AND
|
||||
- NOT "${LOWERCASE_GFLAGS_LIBRARY}" MATCHES ".*gflags[^/]*")
|
||||
-
|
||||
- gflags_reset_find_library_prefix()
|
||||
-
|
||||
-endif(NOT GFLAGS_FOUND)
|
||||
-
|
||||
-# Set standard CMake FindPackage variables if found.
|
||||
-if (GFLAGS_FOUND)
|
||||
- set(GFLAGS_INCLUDE_DIRS ${GFLAGS_INCLUDE_DIR})
|
||||
- set(GFLAGS_LIBRARIES ${GFLAGS_LIBRARY} ${GFLAGS_LINK_LIBRARIES})
|
||||
-endif (GFLAGS_FOUND)
|
||||
-
|
||||
-# Handle REQUIRED / QUIET optional arguments.
|
||||
-include(FindPackageHandleStandardArgs)
|
||||
-find_package_handle_standard_args(Gflags DEFAULT_MSG
|
||||
- GFLAGS_INCLUDE_DIRS GFLAGS_LIBRARIES GFLAGS_NAMESPACE)
|
||||
-
|
||||
-# Only mark internal variables as advanced if we found gflags, otherwise
|
||||
-# leave them visible in the standard GUI for the user to set manually.
|
||||
-if (GFLAGS_FOUND)
|
||||
- mark_as_advanced(FORCE GFLAGS_INCLUDE_DIR
|
||||
- GFLAGS_LIBRARY
|
||||
- GFLAGS_NAMESPACE
|
||||
- gflags_DIR) # Autogenerated by find_package(gflags)
|
||||
-endif (GFLAGS_FOUND)
|
||||
diff --git a/cmake/FindGlog.cmake b/cmake/FindGlog.cmake
|
||||
deleted file mode 100644
|
||||
index 979dced..0000000
|
||||
--- a/cmake/FindGlog.cmake
|
||||
+++ /dev/null
|
||||
@@ -1,346 +0,0 @@
|
||||
-# Ceres Solver - A fast non-linear least squares minimizer
|
||||
-# Copyright 2015 Google Inc. All rights reserved.
|
||||
-# http://ceres-solver.org/
|
||||
-#
|
||||
-# Redistribution and use in source and binary forms, with or without
|
||||
-# modification, are permitted provided that the following conditions are met:
|
||||
-#
|
||||
-# * Redistributions of source code must retain the above copyright notice,
|
||||
-# this list of conditions and the following disclaimer.
|
||||
-# * Redistributions in binary form must reproduce the above copyright notice,
|
||||
-# this list of conditions and the following disclaimer in the documentation
|
||||
-# and/or other materials provided with the distribution.
|
||||
-# * Neither the name of Google Inc. nor the names of its contributors may be
|
||||
-# used to endorse or promote products derived from this software without
|
||||
-# specific prior written permission.
|
||||
-#
|
||||
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
-# POSSIBILITY OF SUCH DAMAGE.
|
||||
-#
|
||||
-# Author: alexs.mac@gmail.com (Alex Stewart)
|
||||
-#
|
||||
-
|
||||
-# FindGlog.cmake - Find Google glog logging library.
|
||||
-#
|
||||
-# This module defines the following variables:
|
||||
-#
|
||||
-# GLOG_FOUND: TRUE iff glog is found.
|
||||
-# GLOG_INCLUDE_DIRS: Include directories for glog.
|
||||
-# GLOG_LIBRARIES: Libraries required to link glog.
|
||||
-# FOUND_INSTALLED_GLOG_CMAKE_CONFIGURATION: True iff the version of glog found
|
||||
-# was built & installed / exported
|
||||
-# as a CMake package.
|
||||
-#
|
||||
-# The following variables control the behaviour of this module:
|
||||
-#
|
||||
-# GLOG_PREFER_EXPORTED_GLOG_CMAKE_CONFIGURATION: TRUE/FALSE, iff TRUE then
|
||||
-# then prefer using an exported CMake configuration
|
||||
-# generated by glog > 0.3.4 over searching for the
|
||||
-# glog components manually. Otherwise (FALSE)
|
||||
-# ignore any exported glog CMake configurations and
|
||||
-# always perform a manual search for the components.
|
||||
-# Default: TRUE iff user does not define this variable
|
||||
-# before we are called, and does NOT specify either
|
||||
-# GLOG_INCLUDE_DIR_HINTS or GLOG_LIBRARY_DIR_HINTS
|
||||
-# otherwise FALSE.
|
||||
-# GLOG_INCLUDE_DIR_HINTS: List of additional directories in which to
|
||||
-# search for glog includes, e.g: /timbuktu/include.
|
||||
-# GLOG_LIBRARY_DIR_HINTS: List of additional directories in which to
|
||||
-# search for glog libraries, e.g: /timbuktu/lib.
|
||||
-#
|
||||
-# The following variables are also defined by this module, but in line with
|
||||
-# CMake recommended FindPackage() module style should NOT be referenced directly
|
||||
-# by callers (use the plural variables detailed above instead). These variables
|
||||
-# do however affect the behaviour of the module via FIND_[PATH/LIBRARY]() which
|
||||
-# are NOT re-called (i.e. search for library is not repeated) if these variables
|
||||
-# are set with valid values _in the CMake cache_. This means that if these
|
||||
-# variables are set directly in the cache, either by the user in the CMake GUI,
|
||||
-# or by the user passing -DVAR=VALUE directives to CMake when called (which
|
||||
-# explicitly defines a cache variable), then they will be used verbatim,
|
||||
-# bypassing the HINTS variables and other hard-coded search locations.
|
||||
-#
|
||||
-# GLOG_INCLUDE_DIR: Include directory for glog, not including the
|
||||
-# include directory of any dependencies.
|
||||
-# GLOG_LIBRARY: glog library, not including the libraries of any
|
||||
-# dependencies.
|
||||
-
|
||||
-# Reset CALLERS_CMAKE_FIND_LIBRARY_PREFIXES to its value when
|
||||
-# FindGlog was invoked.
|
||||
-macro(GLOG_RESET_FIND_LIBRARY_PREFIX)
|
||||
- if (MSVC AND CALLERS_CMAKE_FIND_LIBRARY_PREFIXES)
|
||||
- set(CMAKE_FIND_LIBRARY_PREFIXES "${CALLERS_CMAKE_FIND_LIBRARY_PREFIXES}")
|
||||
- endif()
|
||||
-endmacro(GLOG_RESET_FIND_LIBRARY_PREFIX)
|
||||
-
|
||||
-# Called if we failed to find glog or any of it's required dependencies,
|
||||
-# unsets all public (designed to be used externally) variables and reports
|
||||
-# error message at priority depending upon [REQUIRED/QUIET/<NONE>] argument.
|
||||
-macro(GLOG_REPORT_NOT_FOUND REASON_MSG)
|
||||
- unset(GLOG_FOUND)
|
||||
- unset(GLOG_INCLUDE_DIRS)
|
||||
- unset(GLOG_LIBRARIES)
|
||||
- # Make results of search visible in the CMake GUI if glog has not
|
||||
- # been found so that user does not have to toggle to advanced view.
|
||||
- mark_as_advanced(CLEAR GLOG_INCLUDE_DIR
|
||||
- GLOG_LIBRARY)
|
||||
-
|
||||
- glog_reset_find_library_prefix()
|
||||
-
|
||||
- # Note <package>_FIND_[REQUIRED/QUIETLY] variables defined by FindPackage()
|
||||
- # use the camelcase library name, not uppercase.
|
||||
- if (Glog_FIND_QUIETLY)
|
||||
- message(STATUS "Failed to find glog - " ${REASON_MSG} ${ARGN})
|
||||
- elseif (Glog_FIND_REQUIRED)
|
||||
- message(FATAL_ERROR "Failed to find glog - " ${REASON_MSG} ${ARGN})
|
||||
- else()
|
||||
- # Neither QUIETLY nor REQUIRED, use no priority which emits a message
|
||||
- # but continues configuration and allows generation.
|
||||
- message("-- Failed to find glog - " ${REASON_MSG} ${ARGN})
|
||||
- endif ()
|
||||
- return()
|
||||
-endmacro(GLOG_REPORT_NOT_FOUND)
|
||||
-
|
||||
-# Protect against any alternative find_package scripts for this library having
|
||||
-# been called previously (in a client project) which set GLOG_FOUND, but not
|
||||
-# the other variables we require / set here which could cause the search logic
|
||||
-# here to fail.
|
||||
-unset(GLOG_FOUND)
|
||||
-
|
||||
-# -----------------------------------------------------------------
|
||||
-# By default, if the user has expressed no preference for using an exported
|
||||
-# glog CMake configuration over performing a search for the installed
|
||||
-# components, and has not specified any hints for the search locations, then
|
||||
-# prefer a glog exported configuration if available.
|
||||
-if (NOT DEFINED GLOG_PREFER_EXPORTED_GLOG_CMAKE_CONFIGURATION
|
||||
- AND NOT GLOG_INCLUDE_DIR_HINTS
|
||||
- AND NOT GLOG_LIBRARY_DIR_HINTS)
|
||||
- message(STATUS "No preference for use of exported glog CMake configuration "
|
||||
- "set, and no hints for include/library directories provided. "
|
||||
- "Defaulting to preferring an installed/exported glog CMake configuration "
|
||||
- "if available.")
|
||||
- set(GLOG_PREFER_EXPORTED_GLOG_CMAKE_CONFIGURATION TRUE)
|
||||
-endif()
|
||||
-
|
||||
-if (GLOG_PREFER_EXPORTED_GLOG_CMAKE_CONFIGURATION)
|
||||
- # Try to find an exported CMake configuration for glog, as generated by
|
||||
- # glog versions > 0.3.4
|
||||
- #
|
||||
- # We search twice, s/t we can invert the ordering of precedence used by
|
||||
- # find_package() for exported package build directories, and installed
|
||||
- # packages (found via CMAKE_SYSTEM_PREFIX_PATH), listed as items 6) and 7)
|
||||
- # respectively in [1].
|
||||
- #
|
||||
- # By default, exported build directories are (in theory) detected first, and
|
||||
- # this is usually the case on Windows. However, on OS X & Linux, the install
|
||||
- # path (/usr/local) is typically present in the PATH environment variable
|
||||
- # which is checked in item 4) in [1] (i.e. before both of the above, unless
|
||||
- # NO_SYSTEM_ENVIRONMENT_PATH is passed). As such on those OSs installed
|
||||
- # packages are usually detected in preference to exported package build
|
||||
- # directories.
|
||||
- #
|
||||
- # To ensure a more consistent response across all OSs, and as users usually
|
||||
- # want to prefer an installed version of a package over a locally built one
|
||||
- # where both exist (esp. as the exported build directory might be removed
|
||||
- # after installation), we first search with NO_CMAKE_PACKAGE_REGISTRY which
|
||||
- # means any build directories exported by the user are ignored, and thus
|
||||
- # installed directories are preferred. If this fails to find the package
|
||||
- # we then research again, but without NO_CMAKE_PACKAGE_REGISTRY, so any
|
||||
- # exported build directories will now be detected.
|
||||
- #
|
||||
- # To prevent confusion on Windows, we also pass NO_CMAKE_BUILDS_PATH (which
|
||||
- # is item 5) in [1]), to not preferentially use projects that were built
|
||||
- # recently with the CMake GUI to ensure that we always prefer an installed
|
||||
- # version if available.
|
||||
- #
|
||||
- # NOTE: We use the NAMES option as glog erroneously uses 'google-glog' as its
|
||||
- # project name when built with CMake, but exports itself as just 'glog'.
|
||||
- # On Linux/OS X this does not break detection as the project name is
|
||||
- # not used as part of the install path for the CMake package files,
|
||||
- # e.g. /usr/local/lib/cmake/glog, where the <glog> suffix is hardcoded
|
||||
- # in glog's CMakeLists. However, on Windows the project name *is*
|
||||
- # part of the install prefix: C:/Program Files/google-glog/[include,lib].
|
||||
- # However, by default CMake checks:
|
||||
- # C:/Program Files/<FIND_PACKAGE_ARGUMENT_NAME='glog'> which does not
|
||||
- # exist and thus detection fails. Thus we use the NAMES to force the
|
||||
- # search to use both google-glog & glog.
|
||||
- #
|
||||
- # [1] http://www.cmake.org/cmake/help/v2.8.11/cmake.html#command:find_package
|
||||
- find_package(glog QUIET
|
||||
- NAMES google-glog glog
|
||||
- NO_MODULE
|
||||
- NO_CMAKE_PACKAGE_REGISTRY
|
||||
- NO_CMAKE_BUILDS_PATH)
|
||||
- if (glog_FOUND)
|
||||
- message(STATUS "Found installed version of glog: ${glog_DIR}")
|
||||
- else()
|
||||
- # Failed to find an installed version of glog, repeat search allowing
|
||||
- # exported build directories.
|
||||
- message(STATUS "Failed to find installed glog CMake configuration, "
|
||||
- "searching for glog build directories exported with CMake.")
|
||||
- # Again pass NO_CMAKE_BUILDS_PATH, as we know that glog is exported and
|
||||
- # do not want to treat projects built with the CMake GUI preferentially.
|
||||
- find_package(glog QUIET
|
||||
- NAMES google-glog glog
|
||||
- NO_MODULE
|
||||
- NO_CMAKE_BUILDS_PATH)
|
||||
- if (glog_FOUND)
|
||||
- message(STATUS "Found exported glog build directory: ${glog_DIR}")
|
||||
- endif(glog_FOUND)
|
||||
- endif(glog_FOUND)
|
||||
-
|
||||
- set(FOUND_INSTALLED_GLOG_CMAKE_CONFIGURATION ${glog_FOUND})
|
||||
-
|
||||
- if (FOUND_INSTALLED_GLOG_CMAKE_CONFIGURATION)
|
||||
- message(STATUS "Detected glog version: ${glog_VERSION}")
|
||||
- set(GLOG_FOUND ${glog_FOUND})
|
||||
- # glog wraps the include directories into the exported glog::glog target.
|
||||
- set(GLOG_INCLUDE_DIR "")
|
||||
- set(GLOG_LIBRARY glog::glog)
|
||||
- else (FOUND_INSTALLED_GLOG_CMAKE_CONFIGURATION)
|
||||
- message(STATUS "Failed to find an installed/exported CMake configuration "
|
||||
- "for glog, will perform search for installed glog components.")
|
||||
- endif (FOUND_INSTALLED_GLOG_CMAKE_CONFIGURATION)
|
||||
-endif(GLOG_PREFER_EXPORTED_GLOG_CMAKE_CONFIGURATION)
|
||||
-
|
||||
-if (NOT GLOG_FOUND)
|
||||
- # Either failed to find an exported glog CMake configuration, or user
|
||||
- # told us not to use one. Perform a manual search for all glog components.
|
||||
-
|
||||
- # Handle possible presence of lib prefix for libraries on MSVC, see
|
||||
- # also GLOG_RESET_FIND_LIBRARY_PREFIX().
|
||||
- if (MSVC)
|
||||
- # Preserve the caller's original values for CMAKE_FIND_LIBRARY_PREFIXES
|
||||
- # s/t we can set it back before returning.
|
||||
- set(CALLERS_CMAKE_FIND_LIBRARY_PREFIXES "${CMAKE_FIND_LIBRARY_PREFIXES}")
|
||||
- # The empty string in this list is important, it represents the case when
|
||||
- # the libraries have no prefix (shared libraries / DLLs).
|
||||
- set(CMAKE_FIND_LIBRARY_PREFIXES "lib" "" "${CMAKE_FIND_LIBRARY_PREFIXES}")
|
||||
- endif (MSVC)
|
||||
-
|
||||
- # Search user-installed locations first, so that we prefer user installs
|
||||
- # to system installs where both exist.
|
||||
- list(APPEND GLOG_CHECK_INCLUDE_DIRS
|
||||
- /usr/local/include
|
||||
- /usr/local/homebrew/include # Mac OS X
|
||||
- /opt/local/var/macports/software # Mac OS X.
|
||||
- /opt/local/include
|
||||
- /usr/include)
|
||||
- # Windows (for C:/Program Files prefix).
|
||||
- list(APPEND GLOG_CHECK_PATH_SUFFIXES
|
||||
- glog/include
|
||||
- glog/Include
|
||||
- Glog/include
|
||||
- Glog/Include
|
||||
- google-glog/include # CMake installs with project name prefix.
|
||||
- google-glog/Include)
|
||||
-
|
||||
- list(APPEND GLOG_CHECK_LIBRARY_DIRS
|
||||
- /usr/local/lib
|
||||
- /usr/local/homebrew/lib # Mac OS X.
|
||||
- /opt/local/lib
|
||||
- /usr/lib)
|
||||
- # Windows (for C:/Program Files prefix).
|
||||
- list(APPEND GLOG_CHECK_LIBRARY_SUFFIXES
|
||||
- glog/lib
|
||||
- glog/Lib
|
||||
- Glog/lib
|
||||
- Glog/Lib
|
||||
- google-glog/lib # CMake installs with project name prefix.
|
||||
- google-glog/Lib)
|
||||
-
|
||||
- # Search supplied hint directories first if supplied.
|
||||
- find_path(GLOG_INCLUDE_DIR
|
||||
- NAMES glog/logging.h
|
||||
- HINTS ${GLOG_INCLUDE_DIR_HINTS}
|
||||
- PATHS ${GLOG_CHECK_INCLUDE_DIRS}
|
||||
- PATH_SUFFIXES ${GLOG_CHECK_PATH_SUFFIXES})
|
||||
- if (NOT GLOG_INCLUDE_DIR OR
|
||||
- NOT EXISTS ${GLOG_INCLUDE_DIR})
|
||||
- glog_report_not_found(
|
||||
- "Could not find glog include directory, set GLOG_INCLUDE_DIR "
|
||||
- "to directory containing glog/logging.h")
|
||||
- endif (NOT GLOG_INCLUDE_DIR OR
|
||||
- NOT EXISTS ${GLOG_INCLUDE_DIR})
|
||||
-
|
||||
- find_library(GLOG_LIBRARY NAMES glog
|
||||
- HINTS ${GLOG_LIBRARY_DIR_HINTS}
|
||||
- PATHS ${GLOG_CHECK_LIBRARY_DIRS}
|
||||
- PATH_SUFFIXES ${GLOG_CHECK_LIBRARY_SUFFIXES})
|
||||
- if (NOT GLOG_LIBRARY OR
|
||||
- NOT EXISTS ${GLOG_LIBRARY})
|
||||
- glog_report_not_found(
|
||||
- "Could not find glog library, set GLOG_LIBRARY "
|
||||
- "to full path to libglog.")
|
||||
- endif (NOT GLOG_LIBRARY OR
|
||||
- NOT EXISTS ${GLOG_LIBRARY})
|
||||
-
|
||||
- # Mark internally as found, then verify. GLOG_REPORT_NOT_FOUND() unsets
|
||||
- # if called.
|
||||
- set(GLOG_FOUND TRUE)
|
||||
-
|
||||
- # Glog does not seem to provide any record of the version in its
|
||||
- # source tree, thus cannot extract version.
|
||||
-
|
||||
- # Catch case when caller has set GLOG_INCLUDE_DIR in the cache / GUI and
|
||||
- # thus FIND_[PATH/LIBRARY] are not called, but specified locations are
|
||||
- # invalid, otherwise we would report the library as found.
|
||||
- if (GLOG_INCLUDE_DIR AND
|
||||
- NOT EXISTS ${GLOG_INCLUDE_DIR}/glog/logging.h)
|
||||
- glog_report_not_found(
|
||||
- "Caller defined GLOG_INCLUDE_DIR:"
|
||||
- " ${GLOG_INCLUDE_DIR} does not contain glog/logging.h header.")
|
||||
- endif (GLOG_INCLUDE_DIR AND
|
||||
- NOT EXISTS ${GLOG_INCLUDE_DIR}/glog/logging.h)
|
||||
- # TODO: This regex for glog library is pretty primitive, we use lowercase
|
||||
- # for comparison to handle Windows using CamelCase library names, could
|
||||
- # this check be better?
|
||||
- string(TOLOWER "${GLOG_LIBRARY}" LOWERCASE_GLOG_LIBRARY)
|
||||
- if (GLOG_LIBRARY AND
|
||||
- NOT "${LOWERCASE_GLOG_LIBRARY}" MATCHES ".*glog[^/]*")
|
||||
- glog_report_not_found(
|
||||
- "Caller defined GLOG_LIBRARY: "
|
||||
- "${GLOG_LIBRARY} does not match glog.")
|
||||
- endif (GLOG_LIBRARY AND
|
||||
- NOT "${LOWERCASE_GLOG_LIBRARY}" MATCHES ".*glog[^/]*")
|
||||
-
|
||||
- glog_reset_find_library_prefix()
|
||||
-
|
||||
-endif(NOT GLOG_FOUND)
|
||||
-
|
||||
-# Set standard CMake FindPackage variables if found.
|
||||
-if (GLOG_FOUND)
|
||||
- set(GLOG_INCLUDE_DIRS ${GLOG_INCLUDE_DIR})
|
||||
- set(GLOG_LIBRARIES ${GLOG_LIBRARY})
|
||||
-endif (GLOG_FOUND)
|
||||
-
|
||||
-# If we are using an exported CMake glog target, the include directories are
|
||||
-# wrapped into the target itself, and do not have to be (and are not)
|
||||
-# separately specified. In which case, we should not add GLOG_INCLUDE_DIRS
|
||||
-# to the list of required variables in order that glog be reported as found.
|
||||
-if (FOUND_INSTALLED_GLOG_CMAKE_CONFIGURATION)
|
||||
- set(GLOG_REQUIRED_VARIABLES GLOG_LIBRARIES)
|
||||
-else()
|
||||
- set(GLOG_REQUIRED_VARIABLES GLOG_INCLUDE_DIRS GLOG_LIBRARIES)
|
||||
-endif()
|
||||
-
|
||||
-# Handle REQUIRED / QUIET optional arguments.
|
||||
-include(FindPackageHandleStandardArgs)
|
||||
-find_package_handle_standard_args(Glog DEFAULT_MSG
|
||||
- ${GLOG_REQUIRED_VARIABLES})
|
||||
-
|
||||
-# Only mark internal variables as advanced if we found glog, otherwise
|
||||
-# leave them visible in the standard GUI for the user to set manually.
|
||||
-if (GLOG_FOUND)
|
||||
- mark_as_advanced(FORCE GLOG_INCLUDE_DIR
|
||||
- GLOG_LIBRARY
|
||||
- glog_DIR) # Autogenerated by find_package(glog)
|
||||
-endif (GLOG_FOUND)
|
@ -1,11 +1,10 @@
|
||||
Source: ceres
|
||||
Version: 1.14.0-3
|
||||
# eigen is always required by CMake, even if it isn't used.
|
||||
Version: 1.14.0-4
|
||||
Build-Depends: glog, eigen3
|
||||
Description: non-linear optimization package
|
||||
|
||||
Feature: lapack
|
||||
Build-Depends: clapack
|
||||
Build-Depends: clapack (!osx)
|
||||
Description: Use Lapack in Ceres
|
||||
|
||||
Feature: suitesparse
|
||||
|
@ -17,11 +17,16 @@ vcpkg_from_github(
|
||||
PATCHES
|
||||
0001_add_missing_include_path.patch
|
||||
0002_cmakelists_fixes.patch
|
||||
0003_remove_unnecessary_cmake_modules.patch
|
||||
0004_use_glog_target.patch
|
||||
0005_fix_exported_ceres_config.patch
|
||||
0003_use_glog_target.patch
|
||||
0004_fix_exported_ceres_config.patch
|
||||
)
|
||||
|
||||
file(REMOVE ${SOURCE_PATH}/cmake/FindGflags.cmake)
|
||||
file(REMOVE ${SOURCE_PATH}/cmake/FindGlog.cmake)
|
||||
#file(REMOVE ${SOURCE_PATH}/cmake/FindEigen.cmake)
|
||||
file(REMOVE ${SOURCE_PATH}/cmake/FindSuiteSparse.cmake)
|
||||
#file(REMOVE ${SOURCE_PATH}/cmake/FindTBB.cmake)
|
||||
|
||||
set(SUITESPARSE OFF)
|
||||
if("suitesparse" IN_LIST FEATURES)
|
||||
set(SUITESPARSE ON)
|
||||
@ -59,14 +64,12 @@ vcpkg_configure_cmake(
|
||||
-DEIGENSPARSE=${EIGENSPARSE}
|
||||
-DLAPACK=${LAPACK}
|
||||
-DSUITESPARSE=${SUITESPARSE}
|
||||
-DGFLAGS_PREFER_EXPORTED_GFLAGS_CMAKE_CONFIGURATION=ON
|
||||
-DGLOG_PREFER_EXPORTED_GLOG_CMAKE_CONFIGURATION=OFF # TheiaSfm doesn't work well with this.
|
||||
-DMSVC_USE_STATIC_CRT=${MSVC_USE_STATIC_CRT_VALUE}
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
|
||||
if(WIN32)
|
||||
if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
||||
vcpkg_fixup_cmake_targets(CONFIG_PATH "CMake")
|
||||
else()
|
||||
vcpkg_fixup_cmake_targets(CONFIG_PATH "lib${LIB_SUFFIX}/cmake/Ceres")
|
||||
@ -75,7 +78,7 @@ endif()
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
# Changes target search path
|
||||
if(WIN32)
|
||||
if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
||||
file(READ ${CURRENT_PACKAGES_DIR}/share/ceres/CeresConfig.cmake CERES_TARGETS)
|
||||
string(REPLACE "get_filename_component(CURRENT_ROOT_INSTALL_DIR\n \${CERES_CURRENT_CONFIG_DIR}/../"
|
||||
"get_filename_component(CURRENT_ROOT_INSTALL_DIR\n \${CERES_CURRENT_CONFIG_DIR}/../../" CERES_TARGETS "${CERES_TARGETS}")
|
||||
|
@ -1,4 +1,4 @@
|
||||
Source: clapack
|
||||
Version: 3.2.1-4
|
||||
Version: 3.2.1-6
|
||||
Description: CLAPACK (f2c'ed version of LAPACK)
|
||||
Build-Depends: openblas (!osx)
|
||||
|
198
ports/clapack/FindLAPACK.cmake
Normal file
198
ports/clapack/FindLAPACK.cmake
Normal file
@ -0,0 +1,198 @@
|
||||
#.rst:
|
||||
# clapack config for vcpkg
|
||||
# ------------
|
||||
#
|
||||
# Find the clapack includes and library.
|
||||
#
|
||||
# Result Variables
|
||||
# ^^^^^^^^^^^^^^^^
|
||||
#
|
||||
# This script defines the following variables:
|
||||
#
|
||||
# ``CLAPACK_FOUND``
|
||||
# True if clapack library found
|
||||
#
|
||||
# ``CLAPACK_VERSION``
|
||||
# Containing the clapack version tag (manually defined)
|
||||
#
|
||||
# ``CLAPACK_INCLUDE_DIR``
|
||||
# Location of clapack headers
|
||||
#
|
||||
# ``CLAPACK_LIBRARY``
|
||||
# List of libraries to link with when using clapack
|
||||
#
|
||||
# Result Targets
|
||||
# ^^^^^^^^^^^^^^
|
||||
#
|
||||
# This script defines the following targets:
|
||||
#
|
||||
# ``clapack::clapack``
|
||||
# Target to use clapack
|
||||
#
|
||||
# Compatibility Variables
|
||||
# ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
#
|
||||
# This script defines the following variables for compatibility reasons:
|
||||
#
|
||||
# ``F2C_FOUND``
|
||||
# True if f2c (fortran-to-c wrap layer) library found
|
||||
#
|
||||
# ``F2C_INCLUDE_DIR``
|
||||
# Location of clapack headers
|
||||
#
|
||||
# ``F2C_LIBRARY``
|
||||
# Library containing the fortran-to-c wrap layer, necessary for clapack and automatically included when used
|
||||
#
|
||||
# ``LAPACK_FOUND``
|
||||
# True if clapack library found
|
||||
#
|
||||
# ``LAPACK_VERSION``
|
||||
# Containing the clapack version tag (manually defined)
|
||||
#
|
||||
# ``LAPACK_INCLUDE_DIR``
|
||||
# Location of clapack headers
|
||||
#
|
||||
# ``LAPACK_LIBRARY``
|
||||
# List of libraries to link with when using clapack
|
||||
#
|
||||
# Compatibility Targets
|
||||
# ^^^^^^^^^^^^^^
|
||||
#
|
||||
# This script defines the following targets for compatibility reasons:
|
||||
#
|
||||
# ``lapack``
|
||||
# Target to use lapack
|
||||
|
||||
include(${CMAKE_ROOT}/Modules/SelectLibraryConfigurations.cmake)
|
||||
include(${CMAKE_ROOT}/Modules/CheckSymbolExists.cmake)
|
||||
include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
|
||||
|
||||
set(CLAPACK_VERSION "3.2.1")
|
||||
|
||||
if(UNIX)
|
||||
find_library(ADDITIONAL_LAPACK_LIBRARY m)
|
||||
endif()
|
||||
|
||||
if(NOT F2C_LIBRARY)
|
||||
find_library(F2C_LIBRARY_RELEASE NAMES f2c libf2c)
|
||||
find_library(F2C_LIBRARY_DEBUG NAMES f2cd libf2cd)
|
||||
list(APPEND F2C_LIBRARY_RELEASE ${ADDITIONAL_LAPACK_LIBRARY})
|
||||
list(APPEND F2C_LIBRARY_DEBUG ${ADDITIONAL_LAPACK_LIBRARY})
|
||||
select_library_configurations(F2C)
|
||||
endif()
|
||||
|
||||
find_package(BLAS)
|
||||
|
||||
if(NOT LAPACK_LIBRARY)
|
||||
find_library(LAPACK_LIBRARY_RELEASE NAMES lapack)
|
||||
find_library(LAPACK_LIBRARY_DEBUG NAMES lapackd)
|
||||
list(APPEND LAPACK_LIBRARY_RELEASE ${F2C_LIBRARY_RELEASE})
|
||||
list(APPEND LAPACK_LIBRARY_DEBUG ${F2C_LIBRARY_DEBUG})
|
||||
select_library_configurations(LAPACK)
|
||||
endif()
|
||||
|
||||
list(APPEND LAPACK_LIBRARY ${BLAS_LIBRARIES})
|
||||
|
||||
set(F2C_LIBRARIES "${F2C_LIBRARY}" CACHE STRING "" FORCE)
|
||||
set(LAPACK_VERSION "${CLAPACK_VERSION}" CACHE STRING "" FORCE)
|
||||
set(LAPACK_LIBRARIES "${LAPACK_LIBRARY}" CACHE STRING "" FORCE)
|
||||
set(CLAPACK_LIBRARY "${LAPACK_LIBRARY}" CACHE STRING "" FORCE)
|
||||
set(CLAPACK_LIBRARIES "${LAPACK_LIBRARY}" CACHE STRING "" FORCE)
|
||||
|
||||
if(NOT F2C_INCLUDE_DIR)
|
||||
find_path(F2C_INCLUDE_DIR NAMES f2c.h)
|
||||
endif()
|
||||
|
||||
if(NOT LAPACK_INCLUDE_DIR)
|
||||
find_path(LAPACK_INCLUDE_DIR NAMES clapack.h)
|
||||
endif()
|
||||
|
||||
list(APPEND LAPACK_INCLUDE_DIR ${F2C_INCLUDE_DIR})
|
||||
set(LAPACK_INCLUDE_DIRS "${LAPACK_INCLUDE_DIR}" CACHE PATH "" FORCE)
|
||||
set(CLAPACK_INCLUDE_DIR "${LAPACK_INCLUDE_DIR}" CACHE PATH "" FORCE)
|
||||
set(CLAPACK_INCLUDE_DIRS "${LAPACK_INCLUDE_DIR}" CACHE PATH "" FORCE)
|
||||
set(F2C_INCLUDE_DIRS "${F2C_INCLUDE_DIR}" CACHE PATH "" FORCE)
|
||||
|
||||
if(WIN32)
|
||||
string( REPLACE ".lib" ".dll" LAPACK_LIBRARY_RELEASE_DLL "${LAPACK_LIBRARY_RELEASE}" )
|
||||
string( REPLACE ".lib" ".dll" LAPACK_LIBRARY_DEBUG_DLL "${LAPACK_LIBRARY_DEBUG}" )
|
||||
string( REPLACE ".lib" ".dll" F2C_LIBRARY_RELEASE_DLL "${F2C_LIBRARY_RELEASE}" )
|
||||
string( REPLACE ".lib" ".dll" F2C_LIBRARY_DEBUG_DLL "${F2C_LIBRARY_DEBUG}" )
|
||||
endif()
|
||||
|
||||
find_package_handle_standard_args(CLAPACK DEFAULT_MSG CLAPACK_LIBRARY CLAPACK_INCLUDE_DIR)
|
||||
mark_as_advanced(CLAPACK_INCLUDE_DIR CLAPACK_LIBRARY)
|
||||
|
||||
find_package_handle_standard_args(LAPACK DEFAULT_MSG LAPACK_LIBRARY LAPACK_INCLUDE_DIR)
|
||||
mark_as_advanced(LAPACK_INCLUDE_DIR LAPACK_LIBRARY)
|
||||
|
||||
find_package_handle_standard_args(F2C DEFAULT_MSG F2C_LIBRARY F2C_INCLUDE_DIR)
|
||||
mark_as_advanced(F2C_INCLUDE_DIR F2C_LIBRARY)
|
||||
|
||||
#TARGETS
|
||||
if( CLAPACK_FOUND AND NOT TARGET clapack::clapack )
|
||||
if( EXISTS "${LAPACK_LIBRARY_RELEASE_DLL}" )
|
||||
add_library( clapack::clapack SHARED IMPORTED )
|
||||
set_target_properties( clapack::clapack PROPERTIES
|
||||
IMPORTED_LOCATION_RELEASE "${LAPACK_LIBRARY_RELEASE_DLL}"
|
||||
IMPORTED_IMPLIB "${LAPACK_LIBRARY_RELEASE}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${LAPACK_INCLUDE_DIR}"
|
||||
IMPORTED_CONFIGURATIONS Release
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES "C" )
|
||||
if( EXISTS "${LAPACK_LIBRARY_DEBUG_DLL}" )
|
||||
set_property( TARGET clapack::clapack APPEND PROPERTY IMPORTED_CONFIGURATIONS Debug )
|
||||
set_target_properties( clapack::clapack PROPERTIES
|
||||
IMPORTED_LOCATION_DEBUG "${LAPACK_LIBRARY_DEBUG_DLL}"
|
||||
IMPORTED_IMPLIB_DEBUG "${LAPACK_LIBRARY_DEBUG}" )
|
||||
endif()
|
||||
else()
|
||||
add_library( clapack::clapack UNKNOWN IMPORTED )
|
||||
set_target_properties( clapack::clapack PROPERTIES
|
||||
IMPORTED_LOCATION_RELEASE "${LAPACK_LIBRARY_RELEASE}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${LAPACK_INCLUDE_DIR}"
|
||||
IMPORTED_CONFIGURATIONS Release
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES "C" )
|
||||
if( EXISTS "${LAPACK_LIBRARY_DEBUG}" )
|
||||
set_property( TARGET clapack::clapack APPEND PROPERTY IMPORTED_CONFIGURATIONS Debug )
|
||||
set_target_properties( clapack::clapack PROPERTIES
|
||||
IMPORTED_LOCATION_DEBUG "${LAPACK_LIBRARY_DEBUG}" )
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if( CLAPACK_FOUND AND NOT TARGET lapack )
|
||||
if( EXISTS "${LAPACK_LIBRARY_RELEASE_DLL}" )
|
||||
add_library( lapack SHARED IMPORTED )
|
||||
set_target_properties( lapack PROPERTIES
|
||||
IMPORTED_LOCATION_RELEASE "${LAPACK_LIBRARY_RELEASE_DLL}"
|
||||
IMPORTED_IMPLIB "${LAPACK_LIBRARY_RELEASE}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${LAPACK_INCLUDE_DIR}"
|
||||
IMPORTED_CONFIGURATIONS Release
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES "C" )
|
||||
if( EXISTS "${LAPACK_LIBRARY_DEBUG_DLL}" )
|
||||
set_property( TARGET lapack APPEND PROPERTY IMPORTED_CONFIGURATIONS Debug )
|
||||
set_target_properties( lapack PROPERTIES
|
||||
IMPORTED_LOCATION_DEBUG "${LAPACK_LIBRARY_DEBUG_DLL}"
|
||||
IMPORTED_IMPLIB_DEBUG "${LAPACK_LIBRARY_DEBUG}" )
|
||||
endif()
|
||||
else()
|
||||
add_library( lapack UNKNOWN IMPORTED )
|
||||
set_target_properties( lapack PROPERTIES
|
||||
IMPORTED_LOCATION_RELEASE "${LAPACK_LIBRARY_RELEASE}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${LAPACK_INCLUDE_DIR}"
|
||||
IMPORTED_CONFIGURATIONS Release
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES "C" )
|
||||
if( EXISTS "${LAPACK_LIBRARY_DEBUG}" )
|
||||
set_property( TARGET lapack APPEND PROPERTY IMPORTED_CONFIGURATIONS Debug )
|
||||
set_target_properties( lapack PROPERTIES
|
||||
IMPORTED_LOCATION_DEBUG "${LAPACK_LIBRARY_DEBUG}" )
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(LAPACK_LIBRARY "${LAPACK_LIBRARY}" CACHE STRING "" FORCE)
|
||||
set(F2C_LIBRARY "${F2C_LIBRARY}" CACHE STRING "" FORCE)
|
||||
set(LAPACK_LIBRARY_RELEASE "${LAPACK_LIBRARY_RELEASE}" CACHE STRING "" FORCE)
|
||||
set(LAPACK_LIBRARY_DEBUG "${LAPACK_LIBRARY_DEBUG}" CACHE STRING "" FORCE)
|
||||
set(F2C_LIBRARY_RELEASE "${F2C_LIBRARY_RELEASE}" CACHE STRING "" FORCE)
|
||||
set(F2C_LIBRARY_DEBUG "${F2C_LIBRARY_DEBUG}" CACHE STRING "" FORCE)
|
@ -1,18 +0,0 @@
|
||||
diff --git a/F2CLIBS/libf2c/CMakeLists.txt b/F2CLIBS/libf2c/CMakeLists.txt
|
||||
index ca1473f..fa54e94 100644
|
||||
--- a/F2CLIBS/libf2c/CMakeLists.txt
|
||||
+++ b/F2CLIBS/libf2c/CMakeLists.txt
|
||||
@@ -63,3 +63,13 @@ if(UNIX)
|
||||
target_link_libraries(f2c m)
|
||||
endif()
|
||||
set_property(TARGET f2c PROPERTY PREFIX lib)
|
||||
+install(TARGETS f2c
|
||||
+ RUNTIME DESTINATION bin
|
||||
+ LIBRARY DESTINATION lib
|
||||
+ ARCHIVE DESTINATION lib)
|
||||
+
|
||||
+install(TARGETS arithchk
|
||||
+ RUNTIME DESTINATION tools
|
||||
+ LIBRARY DESTINATION lib
|
||||
+ ARCHIVE DESTINATION lib)
|
||||
+
|
@ -1,46 +0,0 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 8c53def..9e0e398 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -1,10 +1,10 @@
|
||||
cmake_minimum_required(VERSION 2.6)
|
||||
project(CLAPACK C)
|
||||
-enable_testing()
|
||||
+#enable_testing()
|
||||
include(CTest)
|
||||
|
||||
# BLAS_LIBRARIES
|
||||
-find_package(BLAS REQUIRED)
|
||||
+find_package(OpenBLAS REQUIRED)
|
||||
|
||||
if(WIN32 AND NOT CYGWIN)
|
||||
set(SECOND_SRC ${CLAPACK_SOURCE_DIR}/INSTALL/winsecond.c)
|
||||
@@ -14,7 +14,7 @@ else()
|
||||
set(SECOND_SRC ${CLAPACK_SOURCE_DIR}/INSTALL/second.c)
|
||||
set(DSECOND_SRC ${CLAPACK_SOURCE_DIR}/INSTALL/dsecnd.c)
|
||||
endif()
|
||||
-enable_testing()
|
||||
+#enable_testing()
|
||||
option(USE_BLAS_WRAP "pre-pend f2c_ to each function in blas" OFF)
|
||||
if(NOT USE_BLAS_WRAP)
|
||||
# _zrotg_ seems to be missing in the wrap header
|
||||
@@ -25,7 +25,7 @@ add_subdirectory(F2CLIBS)
|
||||
|
||||
# add_subdirectory(BLAS)
|
||||
add_subdirectory(SRC)
|
||||
-add_subdirectory(TESTING)
|
||||
+#add_subdirectory(TESTING)
|
||||
set(CLAPACK_VERSION 3.2.1)
|
||||
set(CPACK_PACKAGE_VERSION_MAJOR 3)
|
||||
set(CPACK_PACKAGE_VERSION_MINOR 2)
|
||||
@@ -38,6 +38,6 @@ include(CPack)
|
||||
# ${CLAPACK_BINARY_DIR}/clapack-config.cmake @ONLY)
|
||||
|
||||
install(FILES
|
||||
- ${CMAKE_CURRENT_LIST_DIR}/include/clapack.h
|
||||
- ${CMAKE_CURRENT_LIST_DIR}/include/f2c.h
|
||||
- DESTINATION include)
|
||||
\ No newline at end of file
|
||||
+ ${CMAKE_CURRENT_LIST_DIR}/INCLUDE/clapack.h
|
||||
+ ${CMAKE_CURRENT_LIST_DIR}/INCLUDE/f2c.h
|
||||
+ DESTINATION include)
|
File diff suppressed because it is too large
Load Diff
@ -1,12 +0,0 @@
|
||||
diff --git a/F2CLIBS/libf2c/CMakeLists.txt b/F2CLIBS/libf2c/CMakeLists.txt
|
||||
index 2bdbd05..ca1473f 100644
|
||||
--- a/F2CLIBS/libf2c/CMakeLists.txt
|
||||
+++ b/F2CLIBS/libf2c/CMakeLists.txt
|
||||
@@ -59,4 +59,7 @@ endif()
|
||||
include_directories(${CLAPACK_SOURCE_DIR}/F2CLIBS/libf2c)
|
||||
include_directories(${CLAPACK_BINARY_DIR}/F2CLIBS/libf2c)
|
||||
add_library(f2c STATIC ${OFILES} ${CMAKE_CURRENT_BINARY_DIR}/arith.h)
|
||||
+if(UNIX)
|
||||
+ target_link_libraries(f2c m)
|
||||
+endif()
|
||||
set_property(TARGET f2c PROPERTY PREFIX lib)
|
12
ports/clapack/openblas_linux.patch
Normal file
12
ports/clapack/openblas_linux.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index c729d95..2b15e31 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -1,6 +1,6 @@
|
||||
cmake_minimum_required(VERSION 2.6)
|
||||
project(CLAPACK C)
|
||||
-find_package(BLAS REQUIRED)
|
||||
+find_package(OpenBLAS REQUIRED)
|
||||
|
||||
if(WIN32 AND NOT CYGWIN)
|
||||
set(SECOND_SRC ${CLAPACK_SOURCE_DIR}/INSTALL/winsecond.c)
|
@ -1,45 +1,43 @@
|
||||
include(vcpkg_common_functions)
|
||||
|
||||
if(NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
|
||||
message(FATAL_ERROR "openblas can only be built for x64 currently")
|
||||
endif()
|
||||
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
||||
|
||||
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/clapack-3.2.1-CMAKE)
|
||||
vcpkg_download_distfile(ARCHIVE
|
||||
URLS "http://www.netlib.org/clapack/clapack-3.2.1-CMAKE.tgz"
|
||||
FILENAME "clapack-3.2.1.tgz"
|
||||
SHA512 cf19c710291ddff3f6ead7d86bdfdeaebca21291d9df094bf0a8ef599546b007757fb2dbb19b56511bb53ef7456eac0c73973b9627bf4d02982c856124428b49
|
||||
URLS "http://www.netlib.org/clapack/clapack-3.2.1-CMAKE.tgz"
|
||||
FILENAME "clapack-3.2.1.tgz"
|
||||
SHA512 cf19c710291ddff3f6ead7d86bdfdeaebca21291d9df094bf0a8ef599546b007757fb2dbb19b56511bb53ef7456eac0c73973b9627bf4d02982c856124428b49
|
||||
)
|
||||
|
||||
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
set(ADDITIONAL_PATCH "openblas_linux.patch")
|
||||
endif()
|
||||
|
||||
vcpkg_extract_source_archive_ex(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
ARCHIVE ${ARCHIVE}
|
||||
PATCHES
|
||||
use-other-blas-and-install-include.patch
|
||||
link-to-math-lib.patch
|
||||
remove_internal_blas.patch
|
||||
${ADDITIONAL_PATCH}
|
||||
)
|
||||
|
||||
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
vcpkg_apply_patches(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PATCHES "${CMAKE_CURRENT_LIST_DIR}/fix-linux-build.patch"
|
||||
)
|
||||
endif()
|
||||
|
||||
if(NOT VCPKG_CMAKE_SYSTEM_NAME)
|
||||
file(COPY ${CMAKE_CURRENT_LIST_DIR}/lapack.def DESTINATION ${SOURCE_PATH}/SRC)
|
||||
endif()
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
OPTIONS
|
||||
-DCMAKE_DEBUG_POSTFIX=d
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
#TODO: fix the official exported targets, since they are broken (luckily it seems that no-one uses them for now)
|
||||
vcpkg_fixup_cmake_targets(CONFIG_PATH share/clapack)
|
||||
|
||||
#we install a cmake wrapper since the official FindLAPACK module in cmake does find clapack easily, unfortunately...
|
||||
file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/lapack)
|
||||
file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/FindLAPACK.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/lapack)
|
||||
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
||||
|
||||
# Handle copyright
|
||||
file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/clapack)
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/share/clapack/COPYING ${CURRENT_PACKAGES_DIR}/share/clapack/copyright)
|
||||
|
||||
vcpkg_copy_pdbs()
|
||||
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/clapack RENAME copyright)
|
||||
|
84
ports/clapack/remove_internal_blas.patch
Normal file
84
ports/clapack/remove_internal_blas.patch
Normal file
@ -0,0 +1,84 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 320ccc6..284e9d3 100755
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -1,7 +1,6 @@
|
||||
cmake_minimum_required(VERSION 2.6)
|
||||
project(CLAPACK C)
|
||||
-enable_testing()
|
||||
-include(CTest)
|
||||
+find_package(BLAS REQUIRED)
|
||||
|
||||
if(WIN32 AND NOT CYGWIN)
|
||||
set(SECOND_SRC ${CLAPACK_SOURCE_DIR}/INSTALL/winsecond.c)
|
||||
@@ -11,7 +10,6 @@ else()
|
||||
set(SECOND_SRC ${CLAPACK_SOURCE_DIR}/INSTALL/second.c)
|
||||
set(DSECOND_SRC ${CLAPACK_SOURCE_DIR}/INSTALL/dsecnd.c)
|
||||
endif()
|
||||
-enable_testing()
|
||||
option(USE_BLAS_WRAP "pre-pend f2c_ to each function in blas" OFF)
|
||||
if(NOT USE_BLAS_WRAP)
|
||||
# _zrotg_ seems to be missing in the wrap header
|
||||
@@ -19,16 +17,15 @@ if(NOT USE_BLAS_WRAP)
|
||||
endif()
|
||||
include_directories(${CLAPACK_SOURCE_DIR}/INCLUDE)
|
||||
add_subdirectory(F2CLIBS)
|
||||
-add_subdirectory(BLAS)
|
||||
add_subdirectory(SRC)
|
||||
-add_subdirectory(TESTING)
|
||||
set(CLAPACK_VERSION 3.2.1)
|
||||
-set(CPACK_PACKAGE_VERSION_MAJOR 3)
|
||||
-set(CPACK_PACKAGE_VERSION_MINOR 2)
|
||||
-set(CPACK_PACKAGE_VERSION_PATCH 1)
|
||||
-include(CPack)
|
||||
-export(TARGETS f2c blas lapack FILE clapack-targets.cmake)
|
||||
+export(TARGETS f2c lapack FILE ${CMAKE_INSTALL_PREFIX}/share/clapack/clapack-targets.cmake)
|
||||
configure_file(${CLAPACK_SOURCE_DIR}/clapack-config-version.cmake.in
|
||||
- ${CLAPACK_BINARY_DIR}/clapack-config-version.cmake @ONLY)
|
||||
+ ${CMAKE_INSTALL_PREFIX}/share/clapack/clapack-config-version.cmake @ONLY)
|
||||
configure_file(${CLAPACK_SOURCE_DIR}/clapack-config.cmake.in
|
||||
- ${CLAPACK_BINARY_DIR}/clapack-config.cmake @ONLY)
|
||||
+ ${CMAKE_INSTALL_PREFIX}/share/clapack/clapack-config.cmake @ONLY)
|
||||
+install(FILES
|
||||
+ ${CMAKE_CURRENT_LIST_DIR}/INCLUDE/clapack.h
|
||||
+ ${CMAKE_CURRENT_LIST_DIR}/INCLUDE/f2c.h
|
||||
+ DESTINATION include)
|
||||
+
|
||||
diff --git a/F2CLIBS/libf2c/CMakeLists.txt b/F2CLIBS/libf2c/CMakeLists.txt
|
||||
index 43d7b3f..6fa3598 100755
|
||||
--- a/F2CLIBS/libf2c/CMakeLists.txt
|
||||
+++ b/F2CLIBS/libf2c/CMakeLists.txt
|
||||
@@ -60,3 +60,11 @@ include_directories(${CLAPACK_SOURCE_DIR}/F2CLIBS/libf2c)
|
||||
include_directories(${CLAPACK_BINARY_DIR}/F2CLIBS/libf2c)
|
||||
add_library(f2c ${OFILES} ${CMAKE_CURRENT_BINARY_DIR}/arith.h)
|
||||
set_property(TARGET f2c PROPERTY PREFIX lib)
|
||||
+if(UNIX)
|
||||
+ target_link_libraries(f2c m)
|
||||
+endif()
|
||||
+install(TARGETS f2c
|
||||
+ RUNTIME DESTINATION bin
|
||||
+ LIBRARY DESTINATION lib
|
||||
+ ARCHIVE DESTINATION lib)
|
||||
+
|
||||
diff --git a/SRC/CMakeLists.txt b/SRC/CMakeLists.txt
|
||||
index ac4cce3..07dc8c7 100755
|
||||
--- a/SRC/CMakeLists.txt
|
||||
+++ b/SRC/CMakeLists.txt
|
||||
@@ -376,5 +376,9 @@ if(BUILD_COMPLEX16)
|
||||
set(ALLOBJ ${ZLASRC} ${ALLAUX} ${DZLAUX})
|
||||
endif()
|
||||
add_library(lapack ${ALLOBJ} ${ALLXOBJ})
|
||||
-target_link_libraries(lapack blas)
|
||||
+target_link_libraries(lapack ${BLAS_LIBRARIES} f2c)
|
||||
+install(TARGETS lapack
|
||||
+ RUNTIME DESTINATION bin
|
||||
+ LIBRARY DESTINATION lib
|
||||
+ ARCHIVE DESTINATION lib)
|
||||
|
||||
diff --git a/clapack-config.cmake.in b/clapack-config.cmake.in
|
||||
index cd19f1d..597f474 100755
|
||||
--- a/clapack-config.cmake.in
|
||||
+++ b/clapack-config.cmake.in
|
||||
@@ -1 +1 @@
|
||||
-include("@CLAPACK_BINARY_DIR@/clapack-targets.cmake")
|
||||
+include("@CLAPACK_BINARY_DIR@/clapack-targets.cmake")
|
@ -1,103 +0,0 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 320ccc6..8c53def 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -3,6 +3,9 @@ project(CLAPACK C)
|
||||
enable_testing()
|
||||
include(CTest)
|
||||
|
||||
+# BLAS_LIBRARIES
|
||||
+find_package(BLAS REQUIRED)
|
||||
+
|
||||
if(WIN32 AND NOT CYGWIN)
|
||||
set(SECOND_SRC ${CLAPACK_SOURCE_DIR}/INSTALL/winsecond.c)
|
||||
set(DSECOND_SRC ${CLAPACK_SOURCE_DIR}/INSTALL/windsecnd.c)
|
||||
@@ -19,7 +22,8 @@ if(NOT USE_BLAS_WRAP)
|
||||
endif()
|
||||
include_directories(${CLAPACK_SOURCE_DIR}/INCLUDE)
|
||||
add_subdirectory(F2CLIBS)
|
||||
-add_subdirectory(BLAS)
|
||||
+
|
||||
+# add_subdirectory(BLAS)
|
||||
add_subdirectory(SRC)
|
||||
add_subdirectory(TESTING)
|
||||
set(CLAPACK_VERSION 3.2.1)
|
||||
@@ -27,8 +31,13 @@ set(CPACK_PACKAGE_VERSION_MAJOR 3)
|
||||
set(CPACK_PACKAGE_VERSION_MINOR 2)
|
||||
set(CPACK_PACKAGE_VERSION_PATCH 1)
|
||||
include(CPack)
|
||||
-export(TARGETS f2c blas lapack FILE clapack-targets.cmake)
|
||||
-configure_file(${CLAPACK_SOURCE_DIR}/clapack-config-version.cmake.in
|
||||
- ${CLAPACK_BINARY_DIR}/clapack-config-version.cmake @ONLY)
|
||||
-configure_file(${CLAPACK_SOURCE_DIR}/clapack-config.cmake.in
|
||||
- ${CLAPACK_BINARY_DIR}/clapack-config.cmake @ONLY)
|
||||
+# export(TARGETS f2c blas lapack FILE clapack-targets.cmake)
|
||||
+# configure_file(${CLAPACK_SOURCE_DIR}/clapack-config-version.cmake.in
|
||||
+# ${CLAPACK_BINARY_DIR}/clapack-config-version.cmake @ONLY)
|
||||
+# configure_file(${CLAPACK_SOURCE_DIR}/clapack-config.cmake.in
|
||||
+# ${CLAPACK_BINARY_DIR}/clapack-config.cmake @ONLY)
|
||||
+
|
||||
+install(FILES
|
||||
+ ${CMAKE_CURRENT_LIST_DIR}/include/clapack.h
|
||||
+ ${CMAKE_CURRENT_LIST_DIR}/include/f2c.h
|
||||
+ DESTINATION include)
|
||||
\ No newline at end of file
|
||||
diff --git a/F2CLIBS/libf2c/CMakeLists.txt b/F2CLIBS/libf2c/CMakeLists.txt
|
||||
index 43d7b3f..2bdbd05 100644
|
||||
--- a/F2CLIBS/libf2c/CMakeLists.txt
|
||||
+++ b/F2CLIBS/libf2c/CMakeLists.txt
|
||||
@@ -58,5 +58,5 @@ if(WIN32)
|
||||
endif()
|
||||
include_directories(${CLAPACK_SOURCE_DIR}/F2CLIBS/libf2c)
|
||||
include_directories(${CLAPACK_BINARY_DIR}/F2CLIBS/libf2c)
|
||||
-add_library(f2c ${OFILES} ${CMAKE_CURRENT_BINARY_DIR}/arith.h)
|
||||
+add_library(f2c STATIC ${OFILES} ${CMAKE_CURRENT_BINARY_DIR}/arith.h)
|
||||
set_property(TARGET f2c PROPERTY PREFIX lib)
|
||||
diff --git a/INCLUDE/clapack.h b/INCLUDE/clapack.h
|
||||
index d22da98..5ef0a5b 100644
|
||||
--- a/INCLUDE/clapack.h
|
||||
+++ b/INCLUDE/clapack.h
|
||||
@@ -3,6 +3,8 @@
|
||||
#ifndef __CLAPACK_H
|
||||
#define __CLAPACK_H
|
||||
|
||||
+#include "f2c.h"
|
||||
+
|
||||
/* Subroutine */ int caxpy_(integer *n, complex *ca, complex *cx, integer *
|
||||
incx, complex *cy, integer *incy);
|
||||
|
||||
diff --git a/SRC/CMakeLists.txt b/SRC/CMakeLists.txt
|
||||
index ac4cce3..0548c8d 100644
|
||||
--- a/SRC/CMakeLists.txt
|
||||
+++ b/SRC/CMakeLists.txt
|
||||
@@ -375,6 +375,17 @@ endif()
|
||||
if(BUILD_COMPLEX16)
|
||||
set(ALLOBJ ${ZLASRC} ${ALLAUX} ${DZLAUX})
|
||||
endif()
|
||||
-add_library(lapack ${ALLOBJ} ${ALLXOBJ})
|
||||
-target_link_libraries(lapack blas)
|
||||
+if(BUILD_SHARED_LIBS AND MSVC)
|
||||
+ add_library(lapack SHARED ${ALLOBJ} ${ALLXOBJ} ${CMAKE_CURRENT_LIST_DIR}/lapack.def)
|
||||
+else()
|
||||
+ add_library(lapack ${ALLOBJ} ${ALLXOBJ})
|
||||
+endif(BUILD_SHARED_LIBS AND MSVC)
|
||||
+
|
||||
+
|
||||
+target_link_libraries(lapack ${BLAS_LIBRARIES} f2c)
|
||||
+
|
||||
+install(TARGETS lapack
|
||||
+ RUNTIME DESTINATION bin
|
||||
+ LIBRARY DESTINATION lib
|
||||
+ ARCHIVE DESTINATION lib)
|
||||
|
||||
diff --git a/TESTING/MATGEN/CMakeLists.txt b/TESTING/MATGEN/CMakeLists.txt
|
||||
index b2cb47a..54fa7a8 100644
|
||||
--- a/TESTING/MATGEN/CMakeLists.txt
|
||||
+++ b/TESTING/MATGEN/CMakeLists.txt
|
||||
@@ -65,5 +65,5 @@ endif()
|
||||
if(BUILD_COMPLEX16)
|
||||
set(ALLOBJ $(ZMATGEN) $(DZATGEN))
|
||||
endif()
|
||||
-add_library(tmglib ${ALLOBJ} )
|
||||
+add_library(tmglib STATIC ${ALLOBJ} )
|
||||
|
4
ports/clapack/vcpkg-cmake-wrapper.cmake
Normal file
4
ports/clapack/vcpkg-cmake-wrapper.cmake
Normal file
@ -0,0 +1,4 @@
|
||||
set(LAPACK_PREV_MODULE_PATH ${CMAKE_MODULE_PATH})
|
||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
|
||||
_find_package(${ARGS})
|
||||
set(CMAKE_MODULE_PATH ${LAPACK_PREV_MODULE_PATH})
|
@ -1,139 +1,121 @@
|
||||
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(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)
|
||||
|
||||
#
|
||||
# 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}")
|
||||
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(INSTALL_BIN_DIR "bin" CACHE PATH "Path where exe and dll will be installed")
|
||||
set(INSTALL_LIB_DIR "lib" CACHE PATH "Path where lib will be installed")
|
||||
set(INSTALL_INCLUDE_DIR "include/Coin" CACHE PATH "Path where headers will be installed")
|
||||
set(INSTALL_CMAKE_DIR "share/${PROJECT_NAME}" CACHE PATH "Path where cmake configs will be installed")
|
||||
|
||||
# Make relative paths absolute (needed later on)
|
||||
set(RELATIVE_INSTALL_INCLUDE_DIR ${INSTALL_INCLUDE_DIR})
|
||||
foreach(p LIB BIN INCLUDE CMAKE)
|
||||
set(var INSTALL_${p}_DIR)
|
||||
if(NOT IS_ABSOLUTE "${${var}}")
|
||||
set(${var} "${CMAKE_INSTALL_PREFIX}/${${var}}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if(MSVC)
|
||||
set(
|
||||
CMAKE_CXX_FLAGS
|
||||
"${CMAKE_CXX_FLAGS} /bigobj /MP /wd4996 /wd4819 /wd4251 /wd4267 /wd4244 /wd4275"
|
||||
)
|
||||
endif()
|
||||
|
||||
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()
|
||||
|
||||
find_package(CoinUtils REQUIRED)
|
||||
find_package(Osi REQUIRED)
|
||||
|
||||
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:${RELATIVE_INSTALL_INCLUDE_DIR}>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/Clp/src/>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/Clp/src/OsiClp>)
|
||||
|
||||
if(MSVC)
|
||||
target_compile_definitions(${PROJECT_NAME} PRIVATE _CRT_SECURE_NO_WARNINGS)
|
||||
endif()
|
||||
target_compile_definitions(${PROJECT_NAME} PRIVATE HAVE_CMATH)
|
||||
target_compile_definitions(${PROJECT_NAME} PUBLIC COIN_HAS_CLP)
|
||||
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE Coin::CoinUtils Coin::Osi)
|
||||
|
||||
install(DIRECTORY Clp/src/
|
||||
DESTINATION ${INSTALL_INCLUDE_DIR}
|
||||
FILES_MATCHING
|
||||
PATTERN "*.h"
|
||||
PATTERN "*.hpp"
|
||||
PATTERN "config_default.h" EXCLUDE)
|
||||
|
||||
install(DIRECTORY Clp/src/OsiClp/
|
||||
DESTINATION ${INSTALL_INCLUDE_DIR}
|
||||
FILES_MATCHING
|
||||
PATTERN "*.h"
|
||||
PATTERN "*.hpp"
|
||||
PATTERN "config_default.h" EXCLUDE)
|
||||
|
||||
install(TARGETS ${PROJECT_NAME}
|
||||
EXPORT "${PROJECT_NAME}Targets"
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
RUNTIME DESTINATION bin)
|
||||
|
||||
include(CMakePackageConfigHelpers)
|
||||
|
||||
set(version_config "${CMAKE_CURRENT_BINARY_DIR}/temp/${PROJECT_NAME}ConfigVersion.cmake")
|
||||
set(project_config "${CMAKE_CURRENT_BINARY_DIR}/temp/${PROJECT_NAME}Config.cmake")
|
||||
set(namespace "Coin::")
|
||||
|
||||
write_basic_package_version_file("${version_config}"
|
||||
COMPATIBILITY SameMajorVersion)
|
||||
|
||||
configure_package_config_file("Config.cmake.in"
|
||||
"${project_config}"
|
||||
INSTALL_DESTINATION
|
||||
"${INSTALL_CMAKE_DIR}")
|
||||
|
||||
install(FILES "${project_config}" "${version_config}"
|
||||
DESTINATION "${INSTALL_CMAKE_DIR}")
|
||||
|
||||
install(EXPORT "${PROJECT_NAME}Targets"
|
||||
NAMESPACE "${namespace}"
|
||||
DESTINATION "${INSTALL_CMAKE_DIR}")
|
||||
|
@ -1,4 +1,4 @@
|
||||
Source: clp
|
||||
Version: 1.17.2
|
||||
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
|
||||
Source: clp
|
||||
Version: 1.17.2-1
|
||||
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
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
@PACKAGE_INIT@
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake")
|
||||
check_required_components("@PROJECT_NAME@")
|
||||
|
||||
@PACKAGE_INIT@
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake")
|
||||
check_required_components("@PROJECT_NAME@")
|
||||
|
@ -19,8 +19,12 @@ vcpkg_configure_cmake(
|
||||
|
||||
vcpkg_install_cmake()
|
||||
vcpkg_copy_pdbs()
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
||||
vcpkg_fixup_cmake_targets(CONFIG_PATH "lib/cmake/Clp")
|
||||
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux") #on case-sensitive filesystems, it's necessary to rename and make it lowercase
|
||||
vcpkg_fixup_cmake_targets(CONFIG_PATH share/Clp)
|
||||
else()
|
||||
vcpkg_fixup_cmake_targets()
|
||||
endif()
|
||||
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
||||
|
||||
# Handle copyright
|
||||
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/clp RENAME copyright)
|
||||
|
@ -8,17 +8,28 @@ 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")
|
||||
|
||||
set(INSTALL_BIN_DIR "bin" CACHE PATH "Path where exe and dll will be installed")
|
||||
set(INSTALL_LIB_DIR "lib" CACHE PATH "Path where lib will be installed")
|
||||
set(INSTALL_INCLUDE_DIR "include/Coin" CACHE PATH "Path where headers will be installed")
|
||||
set(INSTALL_CMAKE_DIR "share/${PROJECT_NAME}" CACHE PATH "Path where cmake configs will be installed")
|
||||
|
||||
# Make relative paths absolute (needed later on)
|
||||
set(RELATIVE_INSTALL_INCLUDE_DIR ${INSTALL_INCLUDE_DIR})
|
||||
foreach(p LIB BIN INCLUDE CMAKE)
|
||||
set(var INSTALL_${p}_DIR)
|
||||
if(NOT IS_ABSOLUTE "${${var}}")
|
||||
set(${var} "${CMAKE_INSTALL_PREFIX}/${${var}}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if(MSVC)
|
||||
set(
|
||||
CMAKE_CXX_FLAGS
|
||||
"${CMAKE_CXX_FLAGS} /bigobj /MP /wd4996 /wd4819 /wd4251 /wd4267 /wd4244 /wd4275"
|
||||
)
|
||||
endif(MSVC)
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
set(
|
||||
CMAKE_CXX_FLAGS
|
||||
@ -26,84 +37,59 @@ if(APPLE)
|
||||
)
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9"
|
||||
CACHE STRING "Minimum OS X deployment version")
|
||||
endif(APPLE)
|
||||
endif()
|
||||
|
||||
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)
|
||||
include(CheckIncludeFileCXX)
|
||||
include(CheckIncludeFile)
|
||||
check_include_file_cxx("cmath" HAVE_CMATH)
|
||||
check_include_file_cxx("cfloat" HAVE_CFLOAT)
|
||||
if(NOT HAVE_CMATH OR NOT HAVE_CFLOAT)
|
||||
message(FATAL_ERROR "Missing necessary include files, like cmath or cfloat")
|
||||
endif()
|
||||
|
||||
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>)
|
||||
target_include_directories(${PROJECT_NAME} PUBLIC $<INSTALL_INTERFACE:${RELATIVE_INSTALL_INCLUDE_DIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/CoinUtils/src>)
|
||||
|
||||
install(TARGETS ${PROJECT_NAME}
|
||||
EXPORT "${TARGETS_EXPORT_NAME}"
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
RUNTIME DESTINATION bin
|
||||
INCLUDES
|
||||
DESTINATION include)
|
||||
if(MSVC)
|
||||
target_compile_definitions(${PROJECT_NAME} PRIVATE _CRT_SECURE_NO_WARNINGS)
|
||||
endif()
|
||||
target_compile_definitions(${PROJECT_NAME} PRIVATE HAVE_CMATH HAVE_CFLOAT)
|
||||
|
||||
install(DIRECTORY CoinUtils/src/
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/coin
|
||||
DESTINATION ${INSTALL_INCLUDE_DIR}
|
||||
FILES_MATCHING
|
||||
PATTERN "*.h"
|
||||
PATTERN "*.hpp")
|
||||
|
||||
#
|
||||
# Install Libraries
|
||||
#
|
||||
# Configure '<PROJECT-NAME>ConfigVersion.cmake' Use: * PROJECT_VERSION
|
||||
install(TARGETS ${PROJECT_NAME}
|
||||
EXPORT "${PROJECT_NAME}Targets"
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
RUNTIME DESTINATION bin)
|
||||
|
||||
include(CMakePackageConfigHelpers)
|
||||
|
||||
set(version_config "${CMAKE_CURRENT_BINARY_DIR}/temp/${PROJECT_NAME}ConfigVersion.cmake")
|
||||
set(project_config "${CMAKE_CURRENT_BINARY_DIR}/temp/${PROJECT_NAME}Config.cmake")
|
||||
set(namespace "Coin::")
|
||||
|
||||
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}")
|
||||
"${INSTALL_CMAKE_DIR}")
|
||||
|
||||
# Config * <prefix>/lib/cmake/Foo/FooConfig.cmake *
|
||||
# <prefix>/lib/cmake/Foo/FooConfigVersion.cmake
|
||||
install(FILES "${project_config}" "${version_config}"
|
||||
DESTINATION "${config_install_dir}")
|
||||
DESTINATION "${INSTALL_CMAKE_DIR}")
|
||||
|
||||
# Config * <prefix>/lib/cmake/Foo/FooTargets.cmake
|
||||
install(EXPORT "${TARGETS_EXPORT_NAME}"
|
||||
install(EXPORT "${PROJECT_NAME}Targets"
|
||||
NAMESPACE "${namespace}"
|
||||
DESTINATION "${config_install_dir}")
|
||||
DESTINATION "${INSTALL_CMAKE_DIR}")
|
||||
|
@ -1,3 +1,3 @@
|
||||
Source: coinutils
|
||||
Version: 2.11.2
|
||||
Version: 2.11.2-1
|
||||
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
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
@PACKAGE_INIT@
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake")
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake")
|
||||
check_required_components("@PROJECT_NAME@")
|
||||
|
@ -19,10 +19,12 @@ vcpkg_configure_cmake(
|
||||
|
||||
vcpkg_install_cmake()
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
vcpkg_fixup_cmake_targets(CONFIG_PATH "lib/cmake/CoinUtils")
|
||||
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux") #on case-sensitive filesystems, it's necessary to rename and make it lowercase
|
||||
vcpkg_fixup_cmake_targets(CONFIG_PATH share/CoinUtils)
|
||||
else()
|
||||
vcpkg_fixup_cmake_targets()
|
||||
endif()
|
||||
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
||||
|
||||
# Handle copyright
|
||||
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/coinutils RENAME copyright)
|
||||
|
@ -1,5 +1,5 @@
|
||||
Source: dlib
|
||||
Version: 19.17
|
||||
Version: 19.17-1
|
||||
Build-Depends: libjpeg-turbo, libpng, sqlite3, fftw3, openblas (!osx), clapack (!osx)
|
||||
Description: Modern C++ toolkit containing machine learning algorithms and tools for creating complex software in C++
|
||||
|
||||
|
@ -1,28 +1,28 @@
|
||||
include(vcpkg_common_functions)
|
||||
|
||||
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
||||
message(FATAL_ERROR "ebml does not currently support UWP")
|
||||
endif()
|
||||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO Matroska-Org/libebml
|
||||
REF release-1.3.9
|
||||
SHA512 3ae22ed491024b276edde9237df0e41a8e5a4e142ec6783c77d5286d7825fb59be62f336d07f7042baac8fc7ac004ad7cc4605754c5801d65547449ea04c287f
|
||||
HEAD_REF master
|
||||
)
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
OPTIONS -DDISABLE_PKGCONFIG=1
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
|
||||
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/EBML)
|
||||
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
||||
|
||||
# Handle copyright
|
||||
file(INSTALL ${SOURCE_PATH}/LICENSE.LGPL DESTINATION ${CURRENT_PACKAGES_DIR}/share/ebml RENAME copyright)
|
||||
include(vcpkg_common_functions)
|
||||
|
||||
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
||||
message(FATAL_ERROR "${PORT} does not currently support UWP")
|
||||
endif()
|
||||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO Matroska-Org/libebml
|
||||
REF release-1.3.9
|
||||
SHA512 3ae22ed491024b276edde9237df0e41a8e5a4e142ec6783c77d5286d7825fb59be62f336d07f7042baac8fc7ac004ad7cc4605754c5801d65547449ea04c287f
|
||||
HEAD_REF master
|
||||
)
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
OPTIONS -DDISABLE_PKGCONFIG=1
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
|
||||
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/EBML)
|
||||
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
||||
|
||||
# Handle copyright
|
||||
file(INSTALL ${SOURCE_PATH}/LICENSE.LGPL DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|
||||
|
@ -1,5 +1,4 @@
|
||||
Source: ensmallen
|
||||
Version: 1.15.0
|
||||
Description: A header-only C++ library for mathematical optimization.
|
||||
Build-Depends: openblas, clapack, armadillo
|
||||
|
||||
Source: ensmallen
|
||||
Version: 1.15.0-1
|
||||
Description: A header-only C++ library for mathematical optimization.
|
||||
Build-Depends: openblas (!osx), clapack (!osx), armadillo
|
||||
|
@ -10,7 +10,7 @@ vcpkg_from_github(
|
||||
iconv.patch
|
||||
)
|
||||
|
||||
if(WIN32 AND ("unicode" IN_LIST FEATURES))
|
||||
if((NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") AND ("unicode" IN_LIST FEATURES))
|
||||
set(enable_win_unicode TRUE)
|
||||
elseif()
|
||||
set(enable_win_unicode FALSE)
|
||||
@ -46,6 +46,6 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
|
||||
endif()
|
||||
|
||||
# Handle copyright
|
||||
# Handle copyright
|
||||
file(COPY ${SOURCE_PATH}/ABOUT-NLS DESTINATION ${CURRENT_PACKAGES_DIR}/share/exiv2)
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/share/exiv2/ABOUT-NLS ${CURRENT_PACKAGES_DIR}/share/exiv2/copyright)
|
||||
|
@ -26,7 +26,7 @@ endif()
|
||||
vcpkg_find_acquire_program(YASM)
|
||||
get_filename_component(YASM_EXE_PATH ${YASM} DIRECTORY)
|
||||
|
||||
if (WIN32)
|
||||
if (NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
||||
set(ENV{PATH} "$ENV{PATH};${YASM_EXE_PATH}")
|
||||
set(BUILD_SCRIPT ${CMAKE_CURRENT_LIST_DIR}\\build.sh)
|
||||
|
||||
@ -35,7 +35,7 @@ if (WIN32)
|
||||
else()
|
||||
vcpkg_acquire_msys(MSYS_ROOT PACKAGES diffutils make)
|
||||
endif()
|
||||
|
||||
|
||||
set(BASH ${MSYS_ROOT}/usr/bin/bash.exe)
|
||||
else()
|
||||
set(ENV{PATH} "$ENV{PATH}:${YASM_EXE_PATH}")
|
||||
@ -140,7 +140,7 @@ endif()
|
||||
|
||||
message(STATUS "Building Options: ${OPTIONS}")
|
||||
|
||||
if(WIN32)
|
||||
if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
||||
if(VCPKG_CRT_LINKAGE STREQUAL "dynamic")
|
||||
set(OPTIONS_DEBUG "${OPTIONS_DEBUG} --extra-cflags=-MDd --extra-cxxflags=-MDd")
|
||||
set(OPTIONS_RELEASE "${OPTIONS_RELEASE} --extra-cflags=-MD --extra-cxxflags=-MD")
|
||||
|
@ -23,9 +23,9 @@ vcpkg_extract_source_archive(${ARCHIVE})
|
||||
|
||||
# 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.
|
||||
if (WIN32 AND VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
||||
if ((NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") AND VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
||||
SET(FMILIB_BUILDING_LIBRARY ON)
|
||||
else()
|
||||
else()
|
||||
SET(FMILIB_BUILDING_LIBRARY OFF)
|
||||
endif()
|
||||
|
||||
@ -33,7 +33,7 @@ endif()
|
||||
# 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
|
||||
if (WIN32 AND VCPKG_CRT_LINKAGE STREQUAL static)
|
||||
if ((NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") AND VCPKG_CRT_LINKAGE STREQUAL static)
|
||||
SET(FMILIB_BUILD_WITH_STATIC_RTLIB ON)
|
||||
else()
|
||||
SET(FMILIB_BUILD_WITH_STATIC_RTLIB OFF)
|
||||
@ -42,9 +42,9 @@ 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
|
||||
if (UNIX AND VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
||||
if ((VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux" OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Darwin") AND VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
||||
SET(FMILIB_BUILD_FOR_SHARED_LIBS OFF)
|
||||
else()
|
||||
else()
|
||||
SET(FMILIB_BUILD_FOR_SHARED_LIBS ON)
|
||||
endif()
|
||||
|
||||
@ -59,17 +59,17 @@ endif()
|
||||
|
||||
SET(OPTIONS
|
||||
-DFMILIB_BUILD_TESTS=OFF
|
||||
-DFMILIB_BUILD_STATIC_LIB=${FMILIB_BUILD_STATIC_LIB}
|
||||
-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}
|
||||
-DFMILIB_BUILDING_LIBRARY=${FMILIB_BUILDING_LIBRARY}
|
||||
-DFMILIB_BUILD_WITH_STATIC_RTLIB=${FMILIB_BUILD_WITH_STATIC_RTLIB}
|
||||
)
|
||||
|
||||
# Reset package dir
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR})
|
||||
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR})
|
||||
|
||||
if (WIN32)
|
||||
if (NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
||||
|
||||
if(VCPKG_TARGET_ARCHITECTURE MATCHES "x86" AND VCPKG_PLATFORM_TOOLSET MATCHES "v120")
|
||||
set(GENERATOR "Visual Studio 12 2013")
|
||||
@ -109,30 +109,30 @@ foreach(BUILDTYPE "rel" "dbg")
|
||||
|
||||
# Reset working dir
|
||||
file(REMOVE_RECURSE ${BUILD_DIR})
|
||||
file(MAKE_DIRECTORY ${BUILD_DIR})
|
||||
file(MAKE_DIRECTORY ${BUILD_DIR})
|
||||
|
||||
SET(FMILIB_INSTALL_PREFIX ${CURRENT_PACKAGES_DIR})
|
||||
if(WIN32)
|
||||
if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
||||
SET(OPTIONS ${OPTIONS} -G ${GENERATOR})
|
||||
endif()
|
||||
endif()
|
||||
if(NOT RELEASE_BUILD)
|
||||
STRING(APPEND FMILIB_INSTALL_PREFIX "/debug")
|
||||
endif()
|
||||
|
||||
# Step 1: Configure
|
||||
vcpkg_execute_required_process(COMMAND
|
||||
cmake
|
||||
vcpkg_execute_required_process(COMMAND
|
||||
cmake
|
||||
-DFMILIB_INSTALL_PREFIX=${FMILIB_INSTALL_PREFIX}
|
||||
-DFMILIB_DEFAULT_BUILD_TYPE_RELEASE=${RELEASE_BUILD}
|
||||
-DFMILIB_DEFAULT_BUILD_TYPE_RELEASE=${RELEASE_BUILD}
|
||||
${OPTIONS}
|
||||
${SOURCE_PATH}
|
||||
WORKING_DIRECTORY
|
||||
WORKING_DIRECTORY
|
||||
${BUILD_DIR}
|
||||
)
|
||||
|
||||
# Step 2: Build
|
||||
# Custom build - becouse vcpkg_configure_cmake() + vcpkg_install_cmake() fails on Linux for some unknown reason
|
||||
if (UNIX)
|
||||
if (VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux" OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||
find_program(MAKE make)
|
||||
if(NOT MAKE)
|
||||
message(FATAL_ERROR "Could not find make. Please install it through your package manager.")
|
||||
@ -144,12 +144,12 @@ foreach(BUILDTYPE "rel" "dbg")
|
||||
else()
|
||||
SET(CONFIG "Debug")
|
||||
endif()
|
||||
vcpkg_execute_required_process(COMMAND
|
||||
cmake
|
||||
--build .
|
||||
--config ${CONFIG}
|
||||
--target "install"
|
||||
WORKING_DIRECTORY
|
||||
vcpkg_execute_required_process(COMMAND
|
||||
cmake
|
||||
--build .
|
||||
--config ${CONFIG}
|
||||
--target "install"
|
||||
WORKING_DIRECTORY
|
||||
${BUILD_DIR}
|
||||
)
|
||||
endif()
|
||||
@ -159,9 +159,9 @@ foreach(BUILDTYPE "rel" "dbg")
|
||||
# remove /doc folder
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/doc)
|
||||
|
||||
# Move .dll files (if any) from /lib to /bin
|
||||
# Move .dll files (if any) from /lib to /bin
|
||||
file(GLOB TMP ${CURRENT_PACKAGES_DIR}/lib/*.dll)
|
||||
if (TMP)
|
||||
if (TMP)
|
||||
file(COPY ${TMP} DESTINATION ${CURRENT_PACKAGES_DIR}/bin)
|
||||
file(REMOVE ${TMP})
|
||||
|
||||
@ -175,7 +175,7 @@ foreach(BUILDTYPE "rel" "dbg")
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/doc)
|
||||
|
||||
# Move .dll files (if any) from /lib to /bin
|
||||
# Move .dll files (if any) from /lib to /bin
|
||||
file(GLOB TMP ${CURRENT_PACKAGES_DIR}/debug/lib/*.dll)
|
||||
if (TMP)
|
||||
file(COPY ${TMP} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin)
|
||||
|
@ -1,4 +1,4 @@
|
||||
Source: fontconfig
|
||||
Version: 2.12.4-8
|
||||
Version: 2.12.4-9
|
||||
Description: Library for configuring and customizing font access.
|
||||
Build-Depends: freetype, expat, libiconv, dirent
|
||||
|
@ -36,7 +36,7 @@ vcpkg_copy_pdbs()
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
||||
foreach(HEADER fcfreetype.h fontconfig.h)
|
||||
file(READ ${CURRENT_PACKAGES_DIR}/include/fontconfig/${HEADER} FC_HEADER)
|
||||
if(WIN32)
|
||||
if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
||||
string(REPLACE "#define FcPublic" "#define FcPublic __declspec(dllimport)" FC_HEADER "${FC_HEADER}")
|
||||
else()
|
||||
string(REPLACE "#define FcPublic" "#define FcPublic __attribute__((visibility(\"default\")))" FC_HEADER "${FC_HEADER}")
|
||||
|
@ -1,4 +1,4 @@
|
||||
Source: g2o
|
||||
Version: 20170730_git-4
|
||||
Build-Depends: suitesparse, eigen3, clapack, ceres
|
||||
Build-Depends: suitesparse, eigen3, clapack (!osx), ceres
|
||||
Description: g2o: A General Framework for Graph Optimization http://openslam.org/g2o.html
|
||||
|
@ -54,24 +54,24 @@ foreach(BUILD_TYPE IN LISTS BUILD_TYPES)
|
||||
)
|
||||
endforeach()
|
||||
|
||||
if (WIN32) # Build in WINDOWS
|
||||
if (NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
||||
# Check build system first
|
||||
find_program(NMAKE nmake REQUIRED)
|
||||
|
||||
|
||||
file(TO_NATIVE_PATH "${CURRENT_PACKAGES_DIR}" NATIVE_PACKAGES_DIR)
|
||||
file(TO_NATIVE_PATH "${CURRENT_PACKAGES_DIR}/share/gdal" NATIVE_DATA_DIR)
|
||||
file(TO_NATIVE_PATH "${CURRENT_PACKAGES_DIR}/share/gdal/html" NATIVE_HTML_DIR)
|
||||
|
||||
|
||||
# Setup proj4 libraries + include path
|
||||
file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/include" PROJ_INCLUDE_DIR)
|
||||
file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/lib/proj.lib" PROJ_LIBRARY_REL)
|
||||
file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/debug/lib/projd.lib" PROJ_LIBRARY_DBG)
|
||||
|
||||
|
||||
# Setup libpng libraries + include path
|
||||
file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/include" PNG_INCLUDE_DIR)
|
||||
file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/lib/libpng16.lib" PNG_LIBRARY_REL)
|
||||
file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/debug/lib/libpng16d.lib" PNG_LIBRARY_DBG)
|
||||
|
||||
|
||||
# Setup zlib libraries + include path
|
||||
file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/include" ZLIB_INCLUDE_DIR)
|
||||
file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/lib/zlib.lib" ZLIB_LIBRARY_REL)
|
||||
@ -86,12 +86,12 @@ if (WIN32) # Build in WINDOWS
|
||||
file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/lib/geos_c.lib" GEOS_LIBRARY_REL)
|
||||
file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/debug/lib/geos_cd.lib" GEOS_LIBRARY_DBG)
|
||||
endif()
|
||||
|
||||
|
||||
# Setup expat libraries + include path
|
||||
file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/include" EXPAT_INCLUDE_DIR)
|
||||
file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/lib/expat.lib" EXPAT_LIBRARY_REL)
|
||||
file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/debug/lib/expat.lib" EXPAT_LIBRARY_DBG)
|
||||
|
||||
|
||||
# Setup curl libraries + include path
|
||||
file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/include" CURL_INCLUDE_DIR)
|
||||
if(EXISTS "${CURRENT_INSTALLED_DIR}/lib/libcurl.lib")
|
||||
@ -104,37 +104,37 @@ if (WIN32) # Build in WINDOWS
|
||||
elseif(EXISTS "${CURRENT_INSTALLED_DIR}/debug/lib/libcurl-d_imp.lib")
|
||||
file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/debug/lib/libcurl-d_imp.lib" CURL_LIBRARY_DBG)
|
||||
endif()
|
||||
|
||||
|
||||
# Setup sqlite3 libraries + include path
|
||||
file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/include" SQLITE_INCLUDE_DIR)
|
||||
file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/lib/sqlite3.lib" SQLITE_LIBRARY_REL)
|
||||
file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/debug/lib/sqlite3.lib" SQLITE_LIBRARY_DBG)
|
||||
|
||||
|
||||
# Setup PostgreSQL libraries + include path
|
||||
file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/include" PGSQL_INCLUDE_DIR)
|
||||
file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/lib/libpq.lib" PGSQL_LIBRARY_REL)
|
||||
file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/debug/lib/libpqd.lib" PGSQL_LIBRARY_DBG)
|
||||
|
||||
|
||||
# Setup OpenJPEG libraries + include path
|
||||
file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/include" OPENJPEG_INCLUDE_DIR)
|
||||
file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/lib/openjp2.lib" OPENJPEG_LIBRARY_REL)
|
||||
file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/debug/lib/openjp2.lib" OPENJPEG_LIBRARY_DBG)
|
||||
|
||||
|
||||
# Setup WebP libraries + include path
|
||||
file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/include" WEBP_INCLUDE_DIR)
|
||||
file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/lib/webp.lib" WEBP_LIBRARY_REL)
|
||||
file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/debug/lib/webpd.lib" WEBP_LIBRARY_DBG)
|
||||
|
||||
|
||||
# Setup libxml2 libraries + include path
|
||||
file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/include" XML2_INCLUDE_DIR)
|
||||
file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/lib/libxml2.lib" XML2_LIBRARY_REL)
|
||||
file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/debug/lib/libxml2.lib" XML2_LIBRARY_DBG)
|
||||
|
||||
|
||||
# Setup liblzma libraries + include path
|
||||
file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/include" LZMA_INCLUDE_DIR)
|
||||
file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/lib/lzma.lib" LZMA_LIBRARY_REL)
|
||||
file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/debug/lib/lzma.lib" LZMA_LIBRARY_DBG)
|
||||
|
||||
|
||||
if("mysql-libmysql" IN_LIST FEATURES OR "mysql-libmariadb" IN_LIST FEATURES)
|
||||
# Setup MySQL libraries + include path
|
||||
if("mysql-libmysql" IN_LIST FEATURES)
|
||||
@ -142,18 +142,18 @@ if (WIN32) # Build in WINDOWS
|
||||
file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/lib/libmysql.lib" MYSQL_LIBRARY_REL)
|
||||
file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/debug/lib/libmysql.lib" MYSQL_LIBRARY_DBG)
|
||||
endif()
|
||||
|
||||
|
||||
if("mysql-libmariadb" IN_LIST FEATURES)
|
||||
file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/include/mysql" MYSQL_INCLUDE_DIR)
|
||||
file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/lib/libmariadb.lib" MYSQL_LIBRARY_REL)
|
||||
file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/debug/lib/libmariadb.lib" MYSQL_LIBRARY_DBG)
|
||||
endif()
|
||||
|
||||
|
||||
list(APPEND NMAKE_OPTIONS MYSQL_INC_DIR=${MYSQL_INCLUDE_DIR})
|
||||
list(APPEND NMAKE_OPTIONS_REL MYSQL_LIB=${MYSQL_LIBRARY_REL})
|
||||
list(APPEND NMAKE_OPTIONS_DBG MYSQL_LIB=${MYSQL_LIBRARY_DBG})
|
||||
endif()
|
||||
|
||||
|
||||
if ("libspatialite" IN_LIST FEATURES)
|
||||
# Setup spatialite libraries + include path
|
||||
file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/include/spatialite" SPATIALITE_INCLUDE_DIR)
|
||||
@ -161,7 +161,7 @@ if (WIN32) # Build in WINDOWS
|
||||
file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/debug/lib/spatialite.lib" SPATIALITE_LIBRARY_DBG)
|
||||
set(HAVE_SPATIALITE "-DHAVE_SPATIALITE")
|
||||
endif()
|
||||
|
||||
|
||||
list(APPEND NMAKE_OPTIONS
|
||||
GDAL_HOME=${NATIVE_PACKAGES_DIR}
|
||||
DATADIR=${NATIVE_DATA_DIR}
|
||||
@ -186,11 +186,11 @@ if (WIN32) # Build in WINDOWS
|
||||
ZLIB_EXTERNAL_LIB=1
|
||||
MSVC_VER=1900
|
||||
)
|
||||
|
||||
|
||||
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
|
||||
list(APPEND NMAKE_OPTIONS WIN64=YES)
|
||||
endif()
|
||||
|
||||
|
||||
if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
||||
list(APPEND NMAKE_OPTIONS PROJ_FLAGS=-DPROJ_STATIC)
|
||||
list(APPEND NMAKE_OPTIONS CURL_CFLAGS=-DCURL_STATICLIB)
|
||||
@ -198,13 +198,13 @@ if (WIN32) # Build in WINDOWS
|
||||
# Enables PDBs for release and debug builds
|
||||
list(APPEND NMAKE_OPTIONS WITH_PDB=1)
|
||||
endif()
|
||||
|
||||
|
||||
if (VCPKG_CRT_LINKAGE STREQUAL static)
|
||||
set(LINKAGE_FLAGS "/MT")
|
||||
else()
|
||||
set(LINKAGE_FLAGS "/MD")
|
||||
endif()
|
||||
|
||||
|
||||
list(APPEND NMAKE_OPTIONS_REL
|
||||
${NMAKE_OPTIONS}
|
||||
CXX_CRT_FLAGS=${LINKAGE_FLAGS}
|
||||
@ -223,7 +223,7 @@ if (WIN32) # Build in WINDOWS
|
||||
# Static Build does not like PG_LIB
|
||||
list(APPEND NMAKE_OPTIONS_REL PG_LIB=${PGSQL_LIBRARY_REL})
|
||||
endif()
|
||||
|
||||
|
||||
list(APPEND NMAKE_OPTIONS_DBG
|
||||
${NMAKE_OPTIONS}
|
||||
CXX_CRT_FLAGS="${LINKAGE_FLAGS}d"
|
||||
@ -257,12 +257,12 @@ if (WIN32) # Build in WINDOWS
|
||||
)
|
||||
message(STATUS "Building ${TARGET_TRIPLET}-rel done")
|
||||
endif()
|
||||
|
||||
|
||||
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
|
||||
################
|
||||
# Debug build
|
||||
################
|
||||
|
||||
|
||||
message(STATUS "Building ${TARGET_TRIPLET}-dbg")
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND ${NMAKE} /G -f makefile.vc
|
||||
@ -272,9 +272,9 @@ if (WIN32) # Build in WINDOWS
|
||||
)
|
||||
message(STATUS "Building ${TARGET_TRIPLET}-dbg done")
|
||||
endif()
|
||||
|
||||
|
||||
message(STATUS "Packaging ${TARGET_TRIPLET}")
|
||||
|
||||
|
||||
if(NOT VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
||||
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share/gdal/html)
|
||||
endif()
|
||||
@ -287,31 +287,31 @@ if (WIN32) # Build in WINDOWS
|
||||
WORKING_DIRECTORY ${SOURCE_PATH_RELEASE}
|
||||
LOGNAME nmake-install-${TARGET_TRIPLET}
|
||||
)
|
||||
|
||||
|
||||
if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin)
|
||||
file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/gdal_i.lib)
|
||||
|
||||
|
||||
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
|
||||
file(COPY ${SOURCE_PATH_RELEASE}/gdal.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib)
|
||||
endif()
|
||||
|
||||
|
||||
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
|
||||
file(COPY ${SOURCE_PATH_DEBUG}/gdal.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib)
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/gdal.lib ${CURRENT_PACKAGES_DIR}/debug/lib/gdald.lib)
|
||||
endif()
|
||||
|
||||
|
||||
else()
|
||||
|
||||
|
||||
set(GDAL_TOOL_PATH ${CURRENT_PACKAGES_DIR}/tools/gdal)
|
||||
file(MAKE_DIRECTORY ${GDAL_TOOL_PATH})
|
||||
|
||||
|
||||
file(GLOB GDAL_TOOLS ${CURRENT_PACKAGES_DIR}/bin/*.exe)
|
||||
file(COPY ${GDAL_TOOLS} DESTINATION ${GDAL_TOOL_PATH})
|
||||
file(REMOVE_RECURSE ${GDAL_TOOLS})
|
||||
|
||||
|
||||
file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/gdal.lib)
|
||||
|
||||
|
||||
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/gdal_i.lib ${CURRENT_PACKAGES_DIR}/lib/gdal.lib)
|
||||
endif()
|
||||
@ -321,17 +321,17 @@ if (WIN32) # Build in WINDOWS
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/gdal_i.lib ${CURRENT_PACKAGES_DIR}/debug/lib/gdald.lib)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
# Copy over PDBs
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
elseif (UNIX) # Build in UNIX
|
||||
elseif (VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux" OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Darwin") # Build in UNIX
|
||||
# Check build system first
|
||||
find_program(MAKE make)
|
||||
if (NOT MAKE)
|
||||
message(FATAL_ERROR "MAKE not found")
|
||||
endif()
|
||||
|
||||
|
||||
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
|
||||
################
|
||||
# Release build
|
||||
@ -344,21 +344,21 @@ elseif (UNIX) # Build in UNIX
|
||||
WORKING_DIRECTORY ${SOURCE_PATH_RELEASE}
|
||||
LOGNAME config-${TARGET_TRIPLET}-rel
|
||||
)
|
||||
|
||||
|
||||
message(STATUS "Building ${TARGET_TRIPLET}-rel")
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND make
|
||||
WORKING_DIRECTORY ${SOURCE_PATH_RELEASE}
|
||||
LOGNAME make-build-${TARGET_TRIPLET}-release
|
||||
)
|
||||
|
||||
|
||||
message(STATUS "Installing ${TARGET_TRIPLET}-rel")
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND make install
|
||||
WORKING_DIRECTORY ${SOURCE_PATH_RELEASE}
|
||||
LOGNAME make-install-${TARGET_TRIPLET}-release
|
||||
)
|
||||
|
||||
|
||||
file(REMOVE_RECURSE ${OUT_PATH_RELEASE}/lib/gdalplugins)
|
||||
file(COPY ${OUT_PATH_RELEASE}/lib/pkgconfig DESTINATION ${OUT_PATH_RELEASE}/share/gdal)
|
||||
file(REMOVE_RECURSE ${OUT_PATH_RELEASE}/lib/pkgconfig)
|
||||
@ -380,21 +380,21 @@ elseif (UNIX) # Build in UNIX
|
||||
WORKING_DIRECTORY ${SOURCE_PATH_DEBUG}
|
||||
LOGNAME config-${TARGET_TRIPLET}-debug
|
||||
)
|
||||
|
||||
|
||||
message(STATUS "Building ${TARGET_TRIPLET}-dbg")
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND make
|
||||
WORKING_DIRECTORY ${SOURCE_PATH_DEBUG}
|
||||
LOGNAME make-build-${TARGET_TRIPLET}-debug
|
||||
)
|
||||
|
||||
|
||||
message(STATUS "Installing ${TARGET_TRIPLET}-dbg")
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND make -j install
|
||||
WORKING_DIRECTORY ${SOURCE_PATH_DEBUG}
|
||||
LOGNAME make-install-${TARGET_TRIPLET}-debug
|
||||
)
|
||||
|
||||
|
||||
file(REMOVE_RECURSE ${OUT_PATH_DEBUG}/lib/gdalplugins)
|
||||
file(REMOVE_RECURSE ${OUT_PATH_DEBUG}/lib/pkgconfig)
|
||||
file(COPY ${OUT_PATH_DEBUG}/lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug)
|
||||
|
@ -1,7 +1,7 @@
|
||||
Source: geogram
|
||||
Version: 1.6.9-3
|
||||
Description: Geogram is a programming library of geometric algorithms.
|
||||
Build-Depends: openblas (!osx), clapack
|
||||
Build-Depends: openblas (!osx), clapack (!osx)
|
||||
|
||||
Feature: graphics
|
||||
Description: Build viewers and geogram_gfx library.
|
||||
|
@ -11,12 +11,12 @@ vcpkg_from_github(
|
||||
static-compile-fix.patch
|
||||
)
|
||||
|
||||
if(UNIX)
|
||||
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux" OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
)
|
||||
elseif(WIN32)
|
||||
elseif(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
||||
vcpkg_find_acquire_program(PYTHON2)
|
||||
vcpkg_find_acquire_program(FLEX) #
|
||||
vcpkg_find_acquire_program(BISON)
|
||||
|
@ -26,7 +26,7 @@ endif()
|
||||
# Handle binary files and includes
|
||||
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/gsoap ${CURRENT_PACKAGES_DIR}/debug/tools)
|
||||
|
||||
if (WIN32)
|
||||
if (NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
||||
vcpkg_build_msbuild(
|
||||
USE_VCPKG_INTEGRATION
|
||||
PROJECT_PATH ${SOURCE_PATH}/gsoap/VisualStudio2005/soapcpp2/soapcpp2.sln
|
||||
@ -39,7 +39,7 @@ if (WIN32)
|
||||
PLATFORM ${BUILD_ARCH}
|
||||
TARGET Build
|
||||
)
|
||||
|
||||
|
||||
file(COPY ${SOURCE_PATH}/gsoap/VisualStudio2005/soapcpp2/release/soapcpp2.exe DESTINATION ${CURRENT_PACKAGES_DIR}/tools/gsoap/)
|
||||
file(COPY ${SOURCE_PATH}/gsoap/VisualStudio2005/wsdl2h/release/wsdl2h.exe DESTINATION ${CURRENT_PACKAGES_DIR}/tools/gsoap/)
|
||||
file(COPY ${SOURCE_PATH}/gsoap/VisualStudio2005/soapcpp2/debug/soapcpp2.exe DESTINATION ${CURRENT_PACKAGES_DIR}/debug/tools/gsoap/)
|
||||
@ -48,7 +48,7 @@ else()
|
||||
message(FATAL_ERROR "Sorry but gsoap only can be build in Windows temporary")
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/include)
|
||||
file(COPY ${SOURCE_PATH}/gsoap/stdsoap2.h ${SOURCE_PATH}/gsoap/stdsoap2.c ${SOURCE_PATH}/gsoap/stdsoap2.cpp ${SOURCE_PATH}/gsoap/dom.c ${SOURCE_PATH}/gsoap/dom.cpp DESTINATION ${CURRENT_PACKAGES_DIR}/include)
|
||||
|
||||
@ -62,6 +62,6 @@ file(COPY ${SOURCE_PATH}/gsoap/plugin DESTINATION ${CURRENT_PACKAGES_DIR}/share/
|
||||
file(COPY ${SOURCE_PATH}/LICENSE.txt ${SOURCE_PATH}/INSTALL.txt ${SOURCE_PATH}/README.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/gsoap)
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/share/gsoap/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/gsoap/copyright)
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/share/gsoap/INSTALL.txt ${CURRENT_PACKAGES_DIR}/share/gsoap/install)
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/share/gsoap/README.txt ${CURRENT_PACKAGES_DIR}/share/gsoap/readme)
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/share/gsoap/README.txt ${CURRENT_PACKAGES_DIR}/share/gsoap/readme)
|
||||
|
||||
vcpkg_copy_pdbs()
|
||||
vcpkg_copy_pdbs()
|
||||
|
@ -28,7 +28,7 @@ vcpkg_install_cmake()
|
||||
vcpkg_fixup_cmake_targets(CONFIG_PATH share/HighFive/CMake)
|
||||
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug)
|
||||
if(NOT WIN32 AND NOT APPLE)
|
||||
if(NOT (NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/HighFive)
|
||||
endif()
|
||||
|
||||
|
@ -5,23 +5,14 @@ include(vcpkg_common_functions)
|
||||
# For now, io2d is always a static library.
|
||||
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
||||
|
||||
# Optionally, uncomment and modify one of the 'set(...)' calls below
|
||||
# to use io2d sources from a local directory, rather than Github.
|
||||
# set(SOURCE_PATH "C:\\Path\\To\\P0267_RefImpl\\")
|
||||
# set(SOURCE_PATH "/Path/To/P0267_RefImpl")
|
||||
|
||||
# Retrieve and validate io2d source code, as-needed
|
||||
if ("${SOURCE_PATH}" STREQUAL "")
|
||||
# TODO: point at cpp-io2d/(whatever), if and as needed
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO cpp-io2d/P0267_RefImpl
|
||||
REF 21ae92c8be6916034e6e18f08aa57899a975dfb0
|
||||
SHA512 5b674f98ca7705d6901af339a4189d5ce4f2c3118bfb99430734f355159602f177bc8d1b345c3a2f17947a62547553f7b91747a1f16da063707a4da7f990391d
|
||||
HEAD_REF master
|
||||
PATCHES find-package.patch
|
||||
)
|
||||
endif()
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO cpp-io2d/P0267_RefImpl
|
||||
REF 21ae92c8be6916034e6e18f08aa57899a975dfb0
|
||||
SHA512 5b674f98ca7705d6901af339a4189d5ce4f2c3118bfb99430734f355159602f177bc8d1b345c3a2f17947a62547553f7b91747a1f16da063707a4da7f990391d
|
||||
HEAD_REF master
|
||||
PATCHES find-package.patch
|
||||
)
|
||||
|
||||
# Configure the library, using CMake
|
||||
if (VCPKG_CMAKE_SYSTEM_NAME STREQUAL Darwin)
|
||||
|
@ -14,7 +14,7 @@ vcpkg_from_github(
|
||||
001-enable-msvc.patch
|
||||
)
|
||||
|
||||
if (WIN32)
|
||||
if (NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND Powershell -Command "((Get-Content -Encoding Byte \"${SOURCE_PATH}/stdlib/std.jsonnet\") -join ',') + ',0' > \"${SOURCE_PATH}/core/std.jsonnet.h\""
|
||||
WORKING_DIRECTORY "${SOURCE_PATH}"
|
||||
|
@ -1,3 +1,3 @@
|
||||
Source: liblemon
|
||||
Version: 1.3.1-4
|
||||
Description: Library for Efficient Modeling and Optimization in Networks
|
||||
Source: liblemon
|
||||
Version: 1.3.1-5
|
||||
Description: Library for Efficient Modeling and Optimization in Networks
|
||||
|
@ -38,6 +38,7 @@ file(COPY ${EXE} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/liblemon/)
|
||||
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/liblemon)
|
||||
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
|
||||
|
||||
# Handle copyright
|
||||
|
@ -1,7 +1,7 @@
|
||||
Source: mlpack
|
||||
Version: 3.1.0-1
|
||||
Description: mlpack is a fast, flexible machine learning library, written in C++, that aims to provide fast, extensible implementations of cutting-edge machine learning algorithms.
|
||||
Build-Depends: openblas, clapack, boost, armadillo
|
||||
|
||||
Feature: tools
|
||||
Description: Build command-line executables and tests.
|
||||
Source: mlpack
|
||||
Version: 3.1.0-1
|
||||
Description: mlpack is a fast, flexible machine learning library, written in C++, that aims to provide fast, extensible implementations of cutting-edge machine learning algorithms.
|
||||
Build-Depends: openblas (!osx), clapack (!osx), boost, armadillo, ensmallen
|
||||
|
||||
Feature: tools
|
||||
Description: Build command-line executables and tests.
|
||||
|
@ -1,42 +1,54 @@
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -284,7 +284,7 @@
|
||||
# script Armadillo uses to find these.
|
||||
if (WIN32)
|
||||
find_library(LAPACK_LIBRARY
|
||||
- NAMES lapack liblapack lapack_win32_MT lapack_win32
|
||||
+ NAMES clapack lapack liblapack lapack_win32_MT lapack_win32
|
||||
PATHS "C:/Program Files/Armadillo"
|
||||
PATH_SUFFIXES "examples/lib_win32/")
|
||||
|
||||
@@ -293,7 +293,7 @@
|
||||
endif ()
|
||||
|
||||
find_library(BLAS_LIBRARY
|
||||
- NAMES blas libblas blas_win32_MT blas_win32
|
||||
+ NAMES openblas blas libblas blas_win32_MT blas_win32
|
||||
PATHS "C:/Program Files/Armadillo"
|
||||
PATH_SUFFIXES "examples/lib_win32/")
|
||||
|
||||
@@ -392,19 +392,11 @@
|
||||
REQUIRED
|
||||
)
|
||||
|
||||
-link_directories(${Boost_LIBRARY_DIRS})
|
||||
-
|
||||
-# In Visual Studio, automatic linking is performed, so we don't need to worry
|
||||
-# about it. Clear the list of libraries to link against and let Visual Studio
|
||||
-# handle it.
|
||||
-if (MSVC)
|
||||
- link_directories(${Boost_LIBRARY_DIRS})
|
||||
- set(Boost_LIBRARIES "")
|
||||
-endif ()
|
||||
+link_directories(${Boost_LIBRARIES})
|
||||
|
||||
set(MLPACK_INCLUDE_DIRS ${MLPACK_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})
|
||||
set(MLPACK_LIBRARIES ${MLPACK_LIBRARIES} ${Boost_LIBRARIES})
|
||||
-set(MLPACK_LIBRARY_DIRS ${MLPACK_LIBRARY_DIRS} ${Boost_LIBRARY_DIRS})
|
||||
+set(MLPACK_LIBRARY_DIRS ${MLPACK_LIBRARY_DIRS} ${Boost_LIBRARIES})
|
||||
|
||||
# For Boost testing framework (will have no effect on non-testing executables).
|
||||
# This specifies to Boost that we are dynamically linking to the Boost test
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 26dfd6e..5e287d8 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -283,25 +283,8 @@ endif()
|
||||
# and find LAPACK and BLAS ourselves, using a slightly modified variant of the
|
||||
# script Armadillo uses to find these.
|
||||
if (WIN32)
|
||||
- find_library(LAPACK_LIBRARY
|
||||
- NAMES lapack liblapack lapack_win32_MT lapack_win32
|
||||
- PATHS "C:/Program Files/Armadillo"
|
||||
- PATH_SUFFIXES "examples/lib_win32/")
|
||||
-
|
||||
- if (NOT LAPACK_LIBRARY)
|
||||
- message(FATAL_ERROR "Cannot find LAPACK library (.lib)!")
|
||||
- endif ()
|
||||
-
|
||||
- find_library(BLAS_LIBRARY
|
||||
- NAMES blas libblas blas_win32_MT blas_win32
|
||||
- PATHS "C:/Program Files/Armadillo"
|
||||
- PATH_SUFFIXES "examples/lib_win32/")
|
||||
-
|
||||
- if (NOT BLAS_LIBRARY)
|
||||
- message(FATAL_ERROR "Cannot find BLAS library (.lib)!")
|
||||
- endif ()
|
||||
-
|
||||
- # Piggyback LAPACK and BLAS linking into Armadillo link.
|
||||
+ find_package(LAPACK)
|
||||
+ find_package(BLAS)
|
||||
set(ARMADILLO_LIBRARIES
|
||||
${ARMADILLO_LIBRARIES} ${BLAS_LIBRARY} ${LAPACK_LIBRARY})
|
||||
endif ()
|
||||
@@ -392,19 +375,11 @@ find_package(Boost 1.49
|
||||
REQUIRED
|
||||
)
|
||||
|
||||
-link_directories(${Boost_LIBRARY_DIRS})
|
||||
-
|
||||
-# In Visual Studio, automatic linking is performed, so we don't need to worry
|
||||
-# about it. Clear the list of libraries to link against and let Visual Studio
|
||||
-# handle it.
|
||||
-if (MSVC)
|
||||
- link_directories(${Boost_LIBRARY_DIRS})
|
||||
- set(Boost_LIBRARIES "")
|
||||
-endif ()
|
||||
+link_directories(${Boost_LIBRARIES})
|
||||
|
||||
set(MLPACK_INCLUDE_DIRS ${MLPACK_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})
|
||||
set(MLPACK_LIBRARIES ${MLPACK_LIBRARIES} ${Boost_LIBRARIES})
|
||||
-set(MLPACK_LIBRARY_DIRS ${MLPACK_LIBRARY_DIRS} ${Boost_LIBRARY_DIRS})
|
||||
+set(MLPACK_LIBRARY_DIRS ${MLPACK_LIBRARY_DIRS} ${Boost_LIBRARIES})
|
||||
|
||||
# For Boost testing framework (will have no effect on non-testing executables).
|
||||
# This specifies to Boost that we are dynamically linking to the Boost test
|
||||
|
@ -6,11 +6,20 @@ vcpkg_from_github(
|
||||
REF mlpack-3.1.0
|
||||
SHA512 dc305a9a2f7232d3957206a346d0ac97ba13b933d5dbef45329002b8380ecc0982621c0b97f6c5ee82d0a26ad53b1cdd7a9b991fb749efc8546394988ac40a5b
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
cmakelists.patch
|
||||
PATCHES
|
||||
cmakelists.patch
|
||||
)
|
||||
|
||||
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" MLPACK_SHARED_LIBS)
|
||||
file(REMOVE ${SOURCE_PATH}/CMake/ARMA_FindACML.cmake)
|
||||
file(REMOVE ${SOURCE_PATH}/CMake/ARMA_FindACMLMP.cmake)
|
||||
file(REMOVE ${SOURCE_PATH}/CMake/ARMA_FindARPACK.cmake)
|
||||
file(REMOVE ${SOURCE_PATH}/CMake/ARMA_FindBLAS.cmake)
|
||||
file(REMOVE ${SOURCE_PATH}/CMake/ARMA_FindCBLAS.cmake)
|
||||
file(REMOVE ${SOURCE_PATH}/CMake/ARMA_FindCLAPACK.cmake)
|
||||
file(REMOVE ${SOURCE_PATH}/CMake/ARMA_FindLAPACK.cmake)
|
||||
file(REMOVE ${SOURCE_PATH}/CMake/ARMA_FindMKL.cmake)
|
||||
file(REMOVE ${SOURCE_PATH}/CMake/ARMA_FindOpenBLAS.cmake)
|
||||
file(REMOVE ${SOURCE_PATH}/CMake/FindArmadillo.cmake)
|
||||
|
||||
set(BUILD_TOOLS OFF)
|
||||
if("tools" IN_LIST FEATURES)
|
||||
@ -20,10 +29,9 @@ endif()
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
OPTIONS
|
||||
-DBUILD_TESTS=${BUILD_TOOLS}
|
||||
-DBUILD_CLI_EXECUTABLES=${BUILD_TOOLS}
|
||||
-DBUILD_SHARED_LIBS=${MLPACK_SHARED_LIBS}
|
||||
OPTIONS
|
||||
-DBUILD_TESTS=${BUILD_TOOLS}
|
||||
-DBUILD_CLI_EXECUTABLES=${BUILD_TOOLS}
|
||||
)
|
||||
vcpkg_install_cmake()
|
||||
vcpkg_copy_pdbs()
|
||||
@ -31,12 +39,12 @@ vcpkg_copy_pdbs()
|
||||
file(INSTALL ${SOURCE_PATH}/COPYRIGHT.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/mlpack RENAME copyright)
|
||||
|
||||
if(BUILD_TOOLS)
|
||||
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools)
|
||||
file(GLOB MLPACK_TOOLS ${CURRENT_PACKAGES_DIR}/bin/*.exe)
|
||||
file(COPY ${MLPACK_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT})
|
||||
file(REMOVE ${MLPACK_TOOLS})
|
||||
file(GLOB MLPACK_TOOLS_DEBUG ${CURRENT_PACKAGES_DIR}/debug/bin/*.exe)
|
||||
file(REMOVE ${MLPACK_TOOLS_DEBUG})
|
||||
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools)
|
||||
file(GLOB MLPACK_TOOLS ${CURRENT_PACKAGES_DIR}/bin/*.exe)
|
||||
file(COPY ${MLPACK_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT})
|
||||
file(REMOVE ${MLPACK_TOOLS})
|
||||
file(GLOB MLPACK_TOOLS_DEBUG ${CURRENT_PACKAGES_DIR}/debug/bin/*.exe)
|
||||
file(REMOVE ${MLPACK_TOOLS_DEBUG})
|
||||
endif()
|
||||
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
||||
|
@ -28,7 +28,7 @@ vcpkg_install_cmake()
|
||||
vcpkg_fixup_cmake_targets(CONFIG_PATH "lib/cmake/MOOS")
|
||||
|
||||
set(MOOS_EXEC_SUFFIX "")
|
||||
if (WIN32)
|
||||
if (NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
||||
set(MOOS_EXEC_SUFFIX ".exe")
|
||||
endif()
|
||||
|
||||
|
@ -26,7 +26,7 @@ vcpkg_install_cmake()
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
||||
|
||||
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/octomap)
|
||||
if(WIN32)
|
||||
if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/bin/binvox2bt.exe ${CURRENT_PACKAGES_DIR}/tools/octomap/binvox2bt.exe)
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/bin/bt2vrml.exe ${CURRENT_PACKAGES_DIR}/tools/octomap/bt2vrml.exe)
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/bin/compare_octrees.exe ${CURRENT_PACKAGES_DIR}/tools/octomap/compare_octrees.exe)
|
||||
|
@ -1,15 +1,3 @@
|
||||
# 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)
|
||||
|
||||
if(NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
|
||||
@ -94,6 +82,8 @@ endif()
|
||||
|
||||
|
||||
vcpkg_install_cmake()
|
||||
vcpkg_fixup_cmake_targets(CONFIG_PATH share/cmake/OpenBLAS TARGET_PATH share/openblas)
|
||||
#maybe we need also to write a wrapper inside share/blas to search implicitly for openblas, whenever we feel it's ready for its own -config.cmake file
|
||||
|
||||
# openblas do not make the config file , so I manually made this
|
||||
# but I think in most case, libraries will not include these files, they define their own used function prototypes
|
||||
|
13
ports/openexr/fix_clang_not_setting_modern_cplusplus.patch
Normal file
13
ports/openexr/fix_clang_not_setting_modern_cplusplus.patch
Normal file
@ -0,0 +1,13 @@
|
||||
diff --git a/IlmBase/CMakeLists.txt b/IlmBase/CMakeLists.txt
|
||||
index e13c768..95942c8 100644
|
||||
--- a/IlmBase/CMakeLists.txt
|
||||
+++ b/IlmBase/CMakeLists.txt
|
||||
@@ -110,7 +110,7 @@ ENDIF ()
|
||||
|
||||
IF (OPENEXR_FORCE_CXX03)
|
||||
FILE ( APPEND ${ILMBASE_TMP_CONFIG} "#define ILMBASE_FORCE_CXX03 1\n" )
|
||||
-ELSEIF (NOT WIN32)
|
||||
+ELSEIF (NOT WIN32 AND NOT APPLE)
|
||||
# really only care about c++11 right now for the threading bits, but this can be changed to 14
|
||||
# when needed...
|
||||
# Note that the __cplusplus check is not valid under MSVC
|
@ -13,7 +13,9 @@ vcpkg_from_github(
|
||||
REF v${OPENEXR_VERSION}
|
||||
SHA512 ${OPENEXR_HASH}
|
||||
HEAD_REF master
|
||||
PATCHES "fix_install_ilmimf.patch"
|
||||
PATCHES
|
||||
fix_clang_not_setting_modern_cplusplus.patch
|
||||
fix_install_ilmimf.patch
|
||||
)
|
||||
|
||||
vcpkg_configure_cmake(SOURCE_PATH ${SOURCE_PATH}
|
||||
@ -32,7 +34,7 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
|
||||
|
||||
# NOTE: Only use ".exe" extension on Windows executables.
|
||||
# Is there a cleaner way to do this?
|
||||
if(WIN32)
|
||||
if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
||||
set(EXECUTABLE_SUFFIX ".exe")
|
||||
else()
|
||||
set(EXECUTABLE_SUFFIX "")
|
||||
|
@ -7,10 +7,9 @@ vcpkg_from_github(
|
||||
SHA512 a919341df7d9625a869cad266d8434881b63a47f3da8daccf4bbab6675d45bd121ff780dd911a7447450fee44cd7bdd42d73aec59a99b667d6d98e79682db2c7
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
# fix_libraw: replace 'LibRaw_r_LIBRARIES' occurences by 'LibRaw_LIBRARIES'
|
||||
# since libraw port installs 'raw_r' library as 'raw'
|
||||
fix_libraw.patch
|
||||
use-webp.patch
|
||||
remove_wrong_dependency.patch
|
||||
)
|
||||
|
||||
file(REMOVE_RECURSE "${SOURCE_PATH}/ext")
|
||||
|
23
ports/openimageio/remove_wrong_dependency.patch
Normal file
23
ports/openimageio/remove_wrong_dependency.patch
Normal file
@ -0,0 +1,23 @@
|
||||
diff --git a/src/libOpenImageIO/CMakeLists.txt b/src/libOpenImageIO/CMakeLists.txt
|
||||
index c528adc..bc133b6 100644
|
||||
--- a/src/libOpenImageIO/CMakeLists.txt
|
||||
+++ b/src/libOpenImageIO/CMakeLists.txt
|
||||
@@ -162,9 +162,6 @@ if (WIN32)
|
||||
target_link_libraries (OpenImageIO psapi.lib)
|
||||
endif ()
|
||||
|
||||
-if (VISIBILITY_MAP_FILE)
|
||||
- add_dependencies (OpenImageIO "${VISIBILITY_MAP_FILE}")
|
||||
-endif ()
|
||||
|
||||
if (USE_EXTERNAL_PUGIXML)
|
||||
target_link_libraries (OpenImageIO ${PUGIXML_LIBRARIES})
|
||||
@@ -230,7 +227,7 @@ if (OIIO_BUILD_TESTS)
|
||||
set_target_properties (imagespec_test PROPERTIES FOLDER "Unit Tests")
|
||||
target_link_libraries (imagespec_test OpenImageIO ${Boost_LIBRARIES})
|
||||
add_test (unit_imagespec imagespec_test)
|
||||
-
|
||||
+
|
||||
add_executable (imagespeed_test imagespeed_test.cpp)
|
||||
set_target_properties (imagespeed_test PROPERTIES FOLDER "Unit Tests")
|
||||
target_link_libraries (imagespeed_test OpenImageIO ${Boost_LIBRARIES})
|
@ -1,7 +1,7 @@
|
||||
Source: openmvg
|
||||
Version: 1.4-2
|
||||
Version: 1.4-4
|
||||
Description: open Multiple View Geometry library. Basis for 3D computer vision and Structure from Motion.
|
||||
Build-Depends: coinutils, clp, osi, liblemon, flann, eigen3, ceres, cereal, libjpeg-turbo, tiff, libpng, zlib
|
||||
Build-Depends: coinutils, clp, osi, liblemon, flann, eigen3, ceres, cereal, libjpeg-turbo, tiff, libpng, zlib, suitesparse
|
||||
|
||||
Feature: opencv
|
||||
Build-Depends: opencv[contrib]
|
||||
|
@ -1,5 +1,5 @@
|
||||
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
|
||||
index 654bebd..5264bfc 100644
|
||||
index 654bebd..ab7dd90 100644
|
||||
--- a/src/CMakeLists.txt
|
||||
+++ b/src/CMakeLists.txt
|
||||
@@ -17,27 +17,16 @@ endif()
|
||||
@ -110,7 +110,7 @@ index 654bebd..5264bfc 100644
|
||||
-else()
|
||||
- set(EIGEN_INCLUDE_DIRS ${EIGEN3_INCLUDE_DIR})
|
||||
-endif()
|
||||
+find_package(eigen3 REQUIRED)
|
||||
+find_package(Eigen3 REQUIRED)
|
||||
+set(EIGEN_INCLUDE_DIRS ${EIGEN3_INCLUDE_DIR})
|
||||
|
||||
# ==============================================================================
|
||||
@ -218,11 +218,11 @@ index 654bebd..5264bfc 100644
|
||||
- ${PROJECT_BINARY_DIR}/third_party/lemon)
|
||||
- set(LEMON_LIBRARY openMVG_lemon)
|
||||
-endif()
|
||||
+find_package(Lemon REQUIRED)
|
||||
+find_package(LEMON REQUIRED)
|
||||
|
||||
# ==============================================================================
|
||||
# OpenCV
|
||||
@@ -369,12 +270,7 @@ endif()
|
||||
@@ -369,14 +270,13 @@ endif()
|
||||
# - only external and enabled only if OpenMVG_USE_OPENCV is set to ON
|
||||
# ==============================================================================
|
||||
if (OpenMVG_USE_OPENCV)
|
||||
@ -235,8 +235,14 @@ index 654bebd..5264bfc 100644
|
||||
+ find_package( OpenCV REQUIRED )
|
||||
endif()
|
||||
|
||||
+# ==============================================================================
|
||||
+# Suitesparse
|
||||
+# ==============================================================================
|
||||
+find_package(suitesparse REQUIRED)
|
||||
|
||||
@@ -469,67 +365,67 @@ message("** Use OpenCV SIFT features: " ${OpenMVG_USE_OCVSIFT})
|
||||
# ==============================================================================
|
||||
# Third-party libraries:
|
||||
@@ -469,67 +369,67 @@ message("** Use OpenCV SIFT features: " ${OpenMVG_USE_OCVSIFT})
|
||||
|
||||
message("\n")
|
||||
|
||||
|
@ -4,28 +4,27 @@ endif()
|
||||
|
||||
include(vcpkg_common_functions)
|
||||
set(OPENSSL_VERSION 1.0.2q)
|
||||
set(MASTER_COPY_SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/openssl-${OPENSSL_VERSION})
|
||||
|
||||
vcpkg_find_acquire_program(PERL)
|
||||
vcpkg_find_acquire_program(PERL)
|
||||
|
||||
get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY)
|
||||
set(ENV{PATH} "$ENV{PATH};${PERL_EXE_PATH}")
|
||||
|
||||
vcpkg_download_distfile(OPENSSL_SOURCE_ARCHIVE
|
||||
vcpkg_download_distfile(ARCHIVE
|
||||
URLS "https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz" "https://www.openssl.org/source/old/1.0.2/openssl-${OPENSSL_VERSION}.tar.gz"
|
||||
FILENAME "openssl-${OPENSSL_VERSION}.tar.gz"
|
||||
SHA512 403e6cad42db3ba860c3fa4fa81c1b7b02f0b873259e5c19a7fc8e42de0854602555f1b1ca74f4e3a7737a4cbd3aac063061e628ec86534586500819fae7fec0
|
||||
)
|
||||
|
||||
vcpkg_extract_source_archive(${OPENSSL_SOURCE_ARCHIVE})
|
||||
vcpkg_apply_patches(
|
||||
SOURCE_PATH ${MASTER_COPY_SOURCE_PATH}
|
||||
PATCHES
|
||||
ConfigureIncludeQuotesFix.patch
|
||||
STRINGIFYPatch.patch
|
||||
EnableWinARM32.patch
|
||||
EmbedSymbolsInStaticLibsZ7.patch
|
||||
EnableWinARM64.patch
|
||||
vcpkg_extract_source_archive_ex(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
ARCHIVE ${ARCHIVE}
|
||||
PATCHES
|
||||
ConfigureIncludeQuotesFix.patch
|
||||
STRINGIFYPatch.patch
|
||||
EnableWinARM32.patch
|
||||
EmbedSymbolsInStaticLibsZ7.patch
|
||||
EnableWinARM64.patch
|
||||
)
|
||||
|
||||
vcpkg_find_acquire_program(NASM)
|
||||
@ -75,8 +74,16 @@ file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel ${CURRENT_BU
|
||||
|
||||
|
||||
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
|
||||
file(COPY ${MASTER_COPY_SOURCE_PATH} DESTINATION ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel)
|
||||
set(SOURCE_PATH_RELEASE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/openssl-${OPENSSL_VERSION})
|
||||
|
||||
# Copy openssl sources.
|
||||
message(STATUS "Copying openssl release source files...")
|
||||
file(GLOB OPENSSL_SOURCE_FILES ${SOURCE_PATH}/*)
|
||||
foreach(SOURCE_FILE ${OPENSSL_SOURCE_FILES})
|
||||
file(COPY ${SOURCE_FILE} DESTINATION "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel")
|
||||
endforeach()
|
||||
message(STATUS "Copying openssl release source files... done")
|
||||
set(SOURCE_PATH_RELEASE "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel")
|
||||
|
||||
set(OPENSSLDIR_RELEASE ${CURRENT_PACKAGES_DIR})
|
||||
|
||||
message(STATUS "Configure ${TARGET_TRIPLET}-rel")
|
||||
@ -112,11 +119,18 @@ endif()
|
||||
|
||||
|
||||
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
|
||||
message(STATUS "Configure ${TARGET_TRIPLET}-dbg")
|
||||
file(COPY ${MASTER_COPY_SOURCE_PATH} DESTINATION ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg)
|
||||
set(SOURCE_PATH_DEBUG ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/openssl-${OPENSSL_VERSION})
|
||||
# Copy openssl sources.
|
||||
message(STATUS "Copying openssl debug source files...")
|
||||
file(GLOB OPENSSL_SOURCE_FILES ${SOURCE_PATH}/*)
|
||||
foreach(SOURCE_FILE ${OPENSSL_SOURCE_FILES})
|
||||
file(COPY ${SOURCE_FILE} DESTINATION "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg")
|
||||
endforeach()
|
||||
message(STATUS "Copying openssl debug source files... done")
|
||||
set(SOURCE_PATH_DEBUG "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg")
|
||||
|
||||
set(OPENSSLDIR_DEBUG ${CURRENT_PACKAGES_DIR}/debug)
|
||||
|
||||
message(STATUS "Configure ${TARGET_TRIPLET}-dbg")
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND ${CONFIGURE_COMMAND} debug-${OPENSSL_ARCH} "--prefix=${OPENSSLDIR_DEBUG}" "--openssldir=${OPENSSLDIR_DEBUG}" -FS
|
||||
WORKING_DIRECTORY ${SOURCE_PATH_DEBUG}
|
||||
@ -175,6 +189,6 @@ file(WRITE "${CURRENT_PACKAGES_DIR}/include/openssl/rand.h" "${_contents}")
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
|
||||
file(INSTALL ${MASTER_COPY_SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|
||||
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|
||||
|
||||
vcpkg_test_cmake(PACKAGE_NAME OpenSSL MODULE)
|
||||
|
@ -1,108 +1,89 @@
|
||||
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(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)
|
||||
|
||||
#
|
||||
# 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}")
|
||||
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(INSTALL_BIN_DIR "bin" CACHE PATH "Path where exe and dll will be installed")
|
||||
set(INSTALL_LIB_DIR "lib" CACHE PATH "Path where lib will be installed")
|
||||
set(INSTALL_INCLUDE_DIR "include/Coin" CACHE PATH "Path where headers will be installed")
|
||||
set(INSTALL_CMAKE_DIR "share/${PROJECT_NAME}" CACHE PATH "Path where cmake configs will be installed")
|
||||
|
||||
# Make relative paths absolute (needed later on)
|
||||
set(RELATIVE_INSTALL_INCLUDE_DIR ${INSTALL_INCLUDE_DIR})
|
||||
foreach(p LIB BIN INCLUDE CMAKE)
|
||||
set(var INSTALL_${p}_DIR)
|
||||
if(NOT IS_ABSOLUTE "${${var}}")
|
||||
set(${var} "${CMAKE_INSTALL_PREFIX}/${${var}}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if(MSVC)
|
||||
set(
|
||||
CMAKE_CXX_FLAGS
|
||||
"${CMAKE_CXX_FLAGS} /bigobj /MP /wd4996 /wd4819 /wd4251 /wd4267 /wd4244 /wd4275"
|
||||
)
|
||||
endif()
|
||||
|
||||
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()
|
||||
|
||||
find_package(CoinUtils REQUIRED)
|
||||
|
||||
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:${RELATIVE_INSTALL_INCLUDE_DIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/Osi/src/Osi>)
|
||||
|
||||
if(MSVC)
|
||||
target_compile_definitions(${PROJECT_NAME} PRIVATE _CRT_SECURE_NO_WARNINGS)
|
||||
endif()
|
||||
target_compile_definitions(${PROJECT_NAME} PRIVATE HAVE_CMATH)
|
||||
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE Coin::CoinUtils)
|
||||
|
||||
install(DIRECTORY Osi/src/Osi/
|
||||
DESTINATION ${INSTALL_INCLUDE_DIR}
|
||||
FILES_MATCHING
|
||||
PATTERN "*.h"
|
||||
PATTERN "*.hpp"
|
||||
PATTERN "config_default.h" EXCLUDE)
|
||||
|
||||
install(TARGETS ${PROJECT_NAME}
|
||||
EXPORT "${PROJECT_NAME}Targets"
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
RUNTIME DESTINATION bin)
|
||||
|
||||
include(CMakePackageConfigHelpers)
|
||||
|
||||
set(version_config "${CMAKE_CURRENT_BINARY_DIR}/temp/${PROJECT_NAME}ConfigVersion.cmake")
|
||||
set(project_config "${CMAKE_CURRENT_BINARY_DIR}/temp/${PROJECT_NAME}Config.cmake")
|
||||
set(namespace "Coin::")
|
||||
|
||||
write_basic_package_version_file("${version_config}"
|
||||
COMPATIBILITY SameMajorVersion)
|
||||
|
||||
configure_package_config_file("Config.cmake.in"
|
||||
"${project_config}"
|
||||
INSTALL_DESTINATION
|
||||
"${INSTALL_CMAKE_DIR}")
|
||||
|
||||
install(FILES "${project_config}" "${version_config}"
|
||||
DESTINATION "${INSTALL_CMAKE_DIR}")
|
||||
|
||||
install(EXPORT "${PROJECT_NAME}Targets"
|
||||
NAMESPACE "${namespace}"
|
||||
DESTINATION "${INSTALL_CMAKE_DIR}")
|
||||
|
@ -1,4 +1,4 @@
|
||||
Source: osi
|
||||
Version: 0.108.4
|
||||
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
|
||||
Source: osi
|
||||
Version: 0.108.4-1
|
||||
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
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
@PACKAGE_INIT@
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake")
|
||||
check_required_components("@PROJECT_NAME@")
|
||||
|
||||
@PACKAGE_INIT@
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake")
|
||||
check_required_components("@PROJECT_NAME@")
|
||||
|
@ -19,8 +19,13 @@ vcpkg_configure_cmake(
|
||||
|
||||
vcpkg_install_cmake()
|
||||
vcpkg_copy_pdbs()
|
||||
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux") #on case-sensitive filesystems, it's necessary to rename and make it lowercase
|
||||
vcpkg_fixup_cmake_targets(CONFIG_PATH "share/Osi")
|
||||
else()
|
||||
vcpkg_fixup_cmake_targets()
|
||||
endif()
|
||||
|
||||
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)
|
||||
|
@ -26,7 +26,7 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
||||
file(INSTALL ${TARGET_BUILD_PATH}-dbg/platform_folders.dll DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin/)
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
if (NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
||||
vcpkg_fixup_cmake_targets(CONFIG_PATH cmake/ TARGET_PATH /share/platform_folders)
|
||||
else()
|
||||
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/ TARGET_PATH /share/)
|
||||
|
@ -33,7 +33,7 @@ vcpkg_install_cmake()
|
||||
|
||||
# Remove static builds from dynamic builds and otherwise
|
||||
# Remove x86 and x64 from resulting files
|
||||
if (WIN32)
|
||||
if (NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
||||
if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
||||
file (REMOVE ${CURRENT_PACKAGES_DIR}/lib/portaudio_static_${VCPKG_TARGET_ARCHITECTURE}.lib)
|
||||
file (REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/portaudio_static_${VCPKG_TARGET_ARCHITECTURE}.lib)
|
||||
|
@ -23,9 +23,9 @@ vcpkg_configure_cmake(
|
||||
|
||||
vcpkg_install_cmake()
|
||||
|
||||
if(UNIX)
|
||||
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux" OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||
vcpkg_fixup_cmake_targets(CONFIG_PATH share/rttr/cmake)
|
||||
elseif(WIN32)
|
||||
elseif(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
||||
vcpkg_fixup_cmake_targets(CONFIG_PATH cmake)
|
||||
else()
|
||||
message(FATAL_ERROR "RTTR does not support this platform")
|
||||
|
@ -1,4 +1,4 @@
|
||||
Source: shogun
|
||||
Version: 6.1.3-1
|
||||
Build-Depends: bzip2, eigen3, liblzma, libxml2, openblas (x64), nlopt, rxcpp, snappy, zlib, protobuf, curl, lzo, dirent
|
||||
Description: Unified and efficient Machine Learning
|
||||
Source: shogun
|
||||
Version: 6.1.3-2
|
||||
Build-Depends: bzip2, eigen3, liblzma, libxml2, openblas (x64&!osx), nlopt, rxcpp, snappy, zlib, protobuf, curl, lzo, dirent
|
||||
Description: Unified and efficient Machine Learning
|
||||
|
@ -8,11 +8,9 @@ vcpkg_from_github(
|
||||
REF shogun_6.1.3
|
||||
SHA512 11aeed456b13720099ca820ab9742c90ce4af2dc049602a425f8c44d2fa155327c7f1d3af2ec840666f600a91e75902d914ffe784d76ed35810da4f3a5815673
|
||||
HEAD_REF master
|
||||
)
|
||||
|
||||
vcpkg_apply_patches(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PATCHES ${CMAKE_CURRENT_LIST_DIR}/cmake.patch
|
||||
PATCHES
|
||||
cmake.patch
|
||||
use_proper_cmake_symbol.patch
|
||||
)
|
||||
|
||||
file(REMOVE_RECURSE ${SOURCE_PATH}/cmake/external)
|
||||
@ -25,6 +23,14 @@ else()
|
||||
set(CMAKE_DISABLE_FIND_PACKAGE_BLAS 1)
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_SYSTEM_PROCESSOR)
|
||||
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
|
||||
set(CMAKE_SYSTEM_PROCESSOR "__x86_64__")
|
||||
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
|
||||
set(CMAKE_SYSTEM_PROCESSOR "__i386__")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
vcpkg_find_acquire_program(PYTHON3)
|
||||
get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY)
|
||||
set(ENV{PATH} "$ENV{PATH};${PYTHON3_DIR}")
|
||||
@ -38,6 +44,7 @@ vcpkg_configure_cmake(
|
||||
-DUSE_SVMLIGHT=OFF
|
||||
-DENABLE_TESTING=OFF
|
||||
-DLICENSE_GPL_SHOGUN=OFF
|
||||
-DLIBSHOGUN_BUILD_STATIC=ON
|
||||
# Conflicting definitions in OpenBLAS and Eigen
|
||||
-DENABLE_EIGEN_LAPACK=OFF
|
||||
|
||||
@ -57,6 +64,7 @@ vcpkg_configure_cmake(
|
||||
-DCMAKE_DISABLE_FIND_PACKAGE_BLAS=${CMAKE_DISABLE_FIND_PACKAGE_BLAS}
|
||||
|
||||
-DINSTALL_TARGETS=shogun-static
|
||||
-DCMAKE_SYSTEM_PROCESSOR=${CMAKE_SYSTEM_PROCESSOR}
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
|
22
ports/shogun/use_proper_cmake_symbol.patch
Normal file
22
ports/shogun/use_proper_cmake_symbol.patch
Normal file
@ -0,0 +1,22 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 6f97c8b..a10b599 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -145,7 +145,7 @@ ENDIF()
|
||||
DetectSystemName()
|
||||
|
||||
# Get processor type, sets MACHINE macro
|
||||
-SET(MACHINE ${CMAKE_SYSTEM_PROCESSOR})
|
||||
+add_definitions(-DMACHINE=${CMAKE_SYSTEM_PROCESSOR})
|
||||
|
||||
SET(EXT_LIB_SWIG_RUBY ".so")
|
||||
if(DARWIN)
|
||||
@@ -174,7 +174,7 @@ ENDIF()
|
||||
|
||||
IF(CMAKE_COMPILER_IS_GNUCXX)
|
||||
SET(RELEASE_COMPILER_FLAGS "-fexpensive-optimizations -frerun-cse-after-loop -fcse-follow-jumps -finline-functions -fschedule-insns2 -fthread-jumps -fforce-addr -fstrength-reduce -funroll-loops")
|
||||
- IF (${MACHINE} MATCHES "x86_64" OR ${MACHINE} MATCHES "i686")
|
||||
+ IF (CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64" OR CMAKE_SYSTEM_PROCESSOR MATCHES "i686")
|
||||
SET(RELEASE_COMPILER_FLAGS "${RELEASE_COMPILER_FLAGS} -mfpmath=sse")
|
||||
ENDIF()
|
||||
ELSEIF(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
|
@ -37,7 +37,7 @@ vcpkg_configure_cmake(
|
||||
|
||||
vcpkg_install_cmake()
|
||||
|
||||
if(WIN32)
|
||||
if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
||||
vcpkg_fixup_cmake_targets(CONFIG_PATH cmake)
|
||||
else()
|
||||
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/SndFile)
|
||||
|
@ -1,4 +1,4 @@
|
||||
Source: sophus
|
||||
Version: 1.0.0-1
|
||||
Build-Depends: eigen3, ceres
|
||||
Version: 1.0.0-3
|
||||
Build-Depends: eigen3, ceres, suitesparse
|
||||
Description: Lie group library for C++
|
||||
|
12
ports/sophus/fix_cmakelists.patch
Normal file
12
ports/sophus/fix_cmakelists.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index fa51e2c..3e07396 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -39,6 +39,7 @@ SET( Sophus_INCLUDE_DIR ${PROJECT_SOURCE_DIR} )
|
||||
|
||||
################################################################################
|
||||
FIND_PACKAGE( Eigen3 REQUIRED )
|
||||
+FIND_PACKAGE( suitesparse REQUIRED )
|
||||
LIST( APPEND Sophus_INCLUDE_DIR ${EIGEN3_INCLUDE_DIR} )
|
||||
|
||||
################################################################################
|
@ -3,9 +3,11 @@ include(vcpkg_common_functions)
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO strasdat/Sophus
|
||||
REF v1.0.0
|
||||
REF v1.0.0
|
||||
SHA512 569634a8be9237d2240cf30c01e2677ece75d55f1196030f1228baca62fa22460e8ceb2a63bd46afdf7f02d8eb79c59d6ed666228b852da78590de897b278fab
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
fix_cmakelists.patch
|
||||
)
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
@ -14,14 +16,10 @@ vcpkg_configure_cmake(
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
|
||||
vcpkg_fixup_cmake_targets(CONFIG_PATH "lib/cmake/Sophus")
|
||||
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug)
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib)
|
||||
|
||||
# Put the license file where vcpkg expects it
|
||||
file(COPY ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/Sophus/)
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/share/Sophus/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/Sophus/copyright)
|
||||
file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}/ RENAME copyright)
|
||||
|
@ -1,5 +1,5 @@
|
||||
Source: suitesparse
|
||||
Version: 5.1.2-2
|
||||
Version: 5.4.0-1
|
||||
Build-Depends: clapack (!osx)
|
||||
Description: algebra library
|
||||
|
||||
|
@ -1,29 +0,0 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 8227298..c0eb354 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -222,7 +222,7 @@ ELSE()
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
-IF(BUILD_METIS)
|
||||
+IF(BUILD_METIS OR USE_VCPKG_METIS)
|
||||
set(SuiteSparse_LINKER_METIS_LIBS "metis")
|
||||
else()
|
||||
set(SuiteSparse_LINKER_METIS_LIBS "")
|
||||
diff --git a/SuiteSparse/CMakeLists.txt b/SuiteSparse/CMakeLists.txt
|
||||
index 7361363..8a48cf3 100644
|
||||
--- a/SuiteSparse/CMakeLists.txt
|
||||
+++ b/SuiteSparse/CMakeLists.txt
|
||||
@@ -10,7 +10,11 @@ ENDIF(CMAKE_COMPILER_IS_GNUCXX AND NOT CMAKE_BUILD_TYPE MATCHES "Debug")
|
||||
IF (BUILD_METIS)
|
||||
INCLUDE_DIRECTORIES("${METIS_SOURCE_DIR}/include")
|
||||
ELSE (BUILD_METIS)
|
||||
+ IF(USE_VCPKG_METIS)
|
||||
+ INCLUDE_DIRECTORIES("${METIS_SOURCE_DIR}/include")
|
||||
+ ELSE (USE_VCPKG_METIS)
|
||||
ADD_DEFINITIONS(-DNPARTITION)
|
||||
+ ENDIF(USE_VCPKG_METIS)
|
||||
ENDIF ( BUILD_METIS)
|
||||
|
||||
# Disable COMPLEX numbers: disable it by default, since it causes problems in some platforms.
|
@ -2,83 +2,68 @@ include(vcpkg_common_functions)
|
||||
|
||||
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
||||
|
||||
set(SUITESPARSE_VER SuiteSparse-5.1.2) #if you change the version, becarefull of changing the SHA512 checksum accordingly
|
||||
set(SUITESPARSE_VER 5.4.0)
|
||||
set(SUITESPARSEWIN_VER 1.4.0)
|
||||
set(SUITESPARSEWIN_PATH ${CURRENT_BUILDTREES_DIR}/src/suitesparse-metis-for-windows-${SUITESPARSEWIN_VER})
|
||||
set(SUITESPARSE_PATH ${SUITESPARSEWIN_PATH}/SuiteSparse)
|
||||
|
||||
#download suitesparse libary
|
||||
vcpkg_download_distfile(SUITESPARSE
|
||||
URLS "http://faculty.cse.tamu.edu/davis/SuiteSparse/${SUITESPARSE_VER}.tar.gz"
|
||||
FILENAME "${SUITESPARSE_VER}.tar.gz"
|
||||
SHA512 38c7f9847cf161390f73de39ed3d9fd07f7bcec2d6d4e6f141af6a015826215843db9f2e16ca255eeb233c593ffc19ffa04816aa5b6ba200b55b9472ac33ba85
|
||||
URLS "http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-${SUITESPARSE_VER}.tar.gz"
|
||||
FILENAME "SuiteSparse-${SUITESPARSE_VER}.tar.gz"
|
||||
SHA512 8328bcc2ef5eb03febf91b9c71159f091ff405c1ba7522e53714120fcf857ceab2d2ecf8bf9a2e1fc45e1a934665a341e3a47f954f87b59934f4fce6164775d6
|
||||
)
|
||||
|
||||
#download suitesparse-metis-for-windows scripts, suitesparse does not have CMake build system, jlblancoc has made one for it
|
||||
vcpkg_download_distfile(SUITESPARSEWIN
|
||||
URLS "https://github.com/jlblancoc/suitesparse-metis-for-windows/archive/v${SUITESPARSEWIN_VER}.zip"
|
||||
FILENAME "suitesparse-metis-for-windows-${SUITESPARSEWIN_VER}.zip"
|
||||
SHA512 2859d534200ab9b76fca1530eae5de2f9328aa867c727dbc83a96c6f16e1f87e70123fb2decbb84531d75dac58b6f0ce7323e48c57aeede324fd9a1f77ba74c6
|
||||
vcpkg_extract_source_archive_ex(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
ARCHIVE ${SUITESPARSE}
|
||||
)
|
||||
|
||||
#extract suitesparse-metis-for-windows first and merge with suitesparse library
|
||||
vcpkg_extract_source_archive(${SUITESPARSEWIN})
|
||||
vcpkg_extract_source_archive(${SUITESPARSE} ${SUITESPARSEWIN_PATH})
|
||||
|
||||
vcpkg_apply_patches(
|
||||
SOURCE_PATH ${SUITESPARSEWIN_PATH}
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SUITESPARSEWIN_SOURCE_PATH
|
||||
REPO jlblancoc/suitesparse-metis-for-windows
|
||||
REF v${SUITESPARSEWIN_VER}
|
||||
SHA512 35a2563d6e33ebe8157f8d023167abd8d2512e2a627b8dbea798c59afefc56b8f01c7d10553529b03a7b4759e200ca82bb26ebce5cefce6983ffb057a8622162
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
remove-debug-postfix.patch
|
||||
suitesparse.patch
|
||||
)
|
||||
|
||||
# Copy suitesparse sources.
|
||||
message(STATUS "Copying SuiteSparse source files...")
|
||||
# Should probably remove everything but CMakeLists.txt files?
|
||||
file(GLOB SUITESPARSE_SOURCE_FILES ${SOURCE_PATH}/*)
|
||||
foreach(SOURCE_FILE ${SUITESPARSE_SOURCE_FILES})
|
||||
file(COPY ${SOURCE_FILE} DESTINATION "${SUITESPARSEWIN_SOURCE_PATH}/SuiteSparse")
|
||||
endforeach()
|
||||
message(STATUS "Copying SuiteSparse source files... done")
|
||||
|
||||
set(USE_VCPKG_METIS OFF)
|
||||
if("metis" IN_LIST FEATURES)
|
||||
set(USE_VCPKG_METIS ON)
|
||||
set(ADDITIONAL_BUILD_OPTIONS "-DMETIS_SOURCE_DIR=${CURRENT_INSTALLED_DIR}")
|
||||
endif()
|
||||
|
||||
if(VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
||||
set(LIB_EXT a)
|
||||
set(LIB_PREFIX lib)
|
||||
else()
|
||||
set(LIB_EXT lib)
|
||||
set(LIB_PREFIX)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
set(ENABLE_CUSTOM_BLAS_LAPACK_PATHS "-DSUITESPARSE_USE_CUSTOM_BLAS_LAPACK_LIBS=ON")
|
||||
set(SUITESPARSE_CUSTOM_BLAS_PATH "-DSUITESPARSE_CUSTOM_BLAS_LIB=${CURRENT_INSTALLED_DIR}/lib/openblas.lib")
|
||||
set(SUITESPARSE_CUSTOM_LAPACK_PATH "-DSUITESPARSE_CUSTOM_LAPACK_LIB=${CURRENT_INSTALLED_DIR}/lib/lapack.lib")
|
||||
endif()
|
||||
|
||||
message(STATUS "Use CMakeLists.txt in ${SUITESPARSEWIN_PATH}")
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SUITESPARSEWIN_PATH}
|
||||
SOURCE_PATH ${SUITESPARSEWIN_SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
OPTIONS
|
||||
-DBUILD_METIS=OFF
|
||||
-DUSE_VCPKG_METIS=${USE_VCPKG_METIS}
|
||||
-DMETIS_SOURCE_DIR=${CURRENT_INSTALLED_DIR}
|
||||
-DSUITESPARSE_USE_CUSTOM_BLAS_LAPACK_LIBS=ON
|
||||
${ADDITIONAL_BUILD_OPTIONS}
|
||||
OPTIONS_DEBUG
|
||||
-DSUITESPARSE_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR}/debug
|
||||
-DSUITESPARSE_CUSTOM_BLAS_LIB=${CURRENT_INSTALLED_DIR}/debug/lib/${LIB_PREFIX}openblas_d.${LIB_EXT}
|
||||
-DSUITESPARSE_CUSTOM_LAPACK_LIB=${CURRENT_INSTALLED_DIR}/debug/lib/${LIB_PREFIX}lapack.${LIB_EXT}
|
||||
-DSUITESPARSE_INSTALL_PREFIX="${CURRENT_PACKAGES_DIR}/debug"
|
||||
OPTIONS_RELEASE
|
||||
-DSUITESPARSE_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR}
|
||||
-DSUITESPARSE_CUSTOM_BLAS_LIB=${CURRENT_INSTALLED_DIR}/lib/${LIB_PREFIX}openblas.${LIB_EXT}
|
||||
-DSUITESPARSE_CUSTOM_LAPACK_LIB=${CURRENT_INSTALLED_DIR}/lib/${LIB_PREFIX}lapack.${LIB_EXT}
|
||||
-DSUITESPARSE_INSTALL_PREFIX="${CURRENT_PACKAGES_DIR}"
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
|
||||
vcpkg_fixup_cmake_targets(CONFIG_PATH "lib/cmake")
|
||||
vcpkg_fixup_cmake_targets(CONFIG_PATH "lib/cmake/suitesparse-${SUITESPARSE_VER}" TARGET_PATH "share/suitesparse")
|
||||
|
||||
#clean folders
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
||||
|
||||
# Handle copyright of suitesparse and suitesparse-metis-for-windows
|
||||
file(COPY ${SUITESPARSE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/suitesparse)
|
||||
file(COPY ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/suitesparse)
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/share/suitesparse/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/suitesparse/copyright)
|
||||
|
||||
file(COPY ${SUITESPARSEWIN_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/suitesparse)
|
||||
file(COPY ${SUITESPARSEWIN_SOURCE_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/suitesparse)
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/share/suitesparse/LICENSE.md ${CURRENT_PACKAGES_DIR}/share/suitesparse/copyright_suitesparse-metis-for-windows)
|
||||
|
@ -1,11 +0,0 @@
|
||||
--- CMakeLists.txt Mon Feb 22 22:18:25 2016
|
||||
+++ CMakeLists.txt Wed Jul 05 14:14:21 2017
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
# We want libraries to be named "libXXX" and "libXXXd" in all compilers:
|
||||
# ------------------------------------------------------------------------
|
||||
-set(CMAKE_DEBUG_POSTFIX "d")
|
||||
+#set(CMAKE_DEBUG_POSTFIX "d")
|
||||
IF(MSVC)
|
||||
set(SP_LIB_PREFIX "lib") # Libs are: "libXXX"
|
||||
ENDIF(MSVC)
|
73
ports/suitesparse/suitesparse.patch
Normal file
73
ports/suitesparse/suitesparse.patch
Normal file
@ -0,0 +1,73 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 3486f05..98badb6 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -252,7 +252,7 @@ if(SuiteSparse_LAPACK_BLAS_LIB_DIR) # "Export" the imported targets in config.cm
|
||||
set_property(TARGET lapack PROPERTY IMPORTED_IMPLIB \${_SuiteSparse_PREFIX}/${SuiteSparse_LAPACK_BLAS_LIB_DIR}/liblapack.lib)")
|
||||
endif()
|
||||
|
||||
-IF(BUILD_METIS)
|
||||
+IF(BUILD_METIS OR USE_VCPKG_METIS)
|
||||
set(SuiteSparse_LINKER_METIS_LIBS "metis")
|
||||
## namespaced library target for config
|
||||
set(SuiteSparse_EXPORTED_METIS_LIBS "SuiteSparse::metis")
|
||||
@@ -311,7 +311,7 @@ configure_file(cmake/SuiteSparse-config-install.cmake.in
|
||||
## do the EXPORT for allowing other project to easily use suitesparse with cmake
|
||||
install(EXPORT SuiteSparseTargets
|
||||
FILE
|
||||
- SuiteSparse-targets.cmake
|
||||
+ suitesparse-targets.cmake
|
||||
NAMESPACE
|
||||
SuiteSparse::
|
||||
DESTINATION
|
||||
diff --git a/SuiteSparse/CMakeLists.txt b/SuiteSparse/CMakeLists.txt
|
||||
index c6e2834..5ef08a6 100644
|
||||
--- a/SuiteSparse/CMakeLists.txt
|
||||
+++ b/SuiteSparse/CMakeLists.txt
|
||||
@@ -12,11 +12,11 @@ IF(CMAKE_COMPILER_IS_GNUCXX AND NOT CMAKE_BUILD_TYPE MATCHES "Debug")
|
||||
ENDIF(CMAKE_COMPILER_IS_GNUCXX AND NOT CMAKE_BUILD_TYPE MATCHES "Debug")
|
||||
|
||||
# Global flags:
|
||||
-IF (BUILD_METIS)
|
||||
+IF (BUILD_METIS OR USE_VCPKG_METIS)
|
||||
INCLUDE_DIRECTORIES("${METIS_SOURCE_DIR}/include")
|
||||
-ELSE (BUILD_METIS)
|
||||
+ELSE ()
|
||||
ADD_DEFINITIONS(-DNPARTITION)
|
||||
-ENDIF ( BUILD_METIS)
|
||||
+ENDIF ()
|
||||
|
||||
# Disable COMPLEX numbers: disable it by default, since it causes problems in some platforms.
|
||||
SET(HAVE_COMPLEX OFF CACHE BOOL "Enables building SuiteSparse with complex numbers (disabled by default to avoid problems in some platforms)")
|
||||
diff --git a/cmake/SuiteSparse-config-install.cmake.in b/cmake/SuiteSparse-config-install.cmake.in
|
||||
index cb1f51f..49387b8 100644
|
||||
--- a/cmake/SuiteSparse-config-install.cmake.in
|
||||
+++ b/cmake/SuiteSparse-config-install.cmake.in
|
||||
@@ -4,13 +4,10 @@ get_filename_component(_SuiteSparse_PREFIX "${_SuiteSparse_SELF_DIR}" PATH)
|
||||
get_filename_component(_SuiteSparse_PREFIX "${_SuiteSparse_PREFIX}" PATH)
|
||||
get_filename_component(_SuiteSparse_PREFIX "${_SuiteSparse_PREFIX}" PATH)
|
||||
|
||||
-find_package(LAPACK CONFIG)
|
||||
-if (NOT LAPACK_FOUND) # Load the LAPACK package with which we were built.
|
||||
- @ExternConfig@
|
||||
-endif ()
|
||||
+find_package(LAPACK REQUIRED)
|
||||
|
||||
# Load targets from the install tree.
|
||||
-include(${_SuiteSparse_SELF_DIR}/SuiteSparse-targets.cmake)
|
||||
+include(${_SuiteSparse_SELF_DIR}/suitesparse-targets.cmake)
|
||||
|
||||
# Report SuiteSparse header search locations.
|
||||
set(SuiteSparse_INCLUDE_DIRS ${_SuiteSparse_PREFIX}/include)
|
||||
@@ -31,6 +28,11 @@ set(SuiteSparse_LIBRARIES
|
||||
SuiteSparse::spqr
|
||||
@SuiteSparse_EXPORTED_METIS_LIBS@
|
||||
)
|
||||
+set(SUITESPARSE_LIBRARIES ${SuiteSparse_LIBRARIES})
|
||||
|
||||
unset(_SuiteSparse_PREFIX)
|
||||
unset(_SuiteSparse_SELF_DIR)
|
||||
+
|
||||
+set(SUITESPARSE_FOUND TRUE)
|
||||
+set(SuiteSparse_FOUND TRUE)
|
||||
+
|
@ -36,15 +36,15 @@ vcpkg_copy_pdbs()
|
||||
|
||||
if(BUILD_GUI_BUILDER)
|
||||
set(EXECUTABLE_SUFFIX "")
|
||||
if (WIN32)
|
||||
if (NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
||||
set(EXECUTABLE_SUFFIX ".exe")
|
||||
endif()
|
||||
|
||||
message(STATUS "Check for: ${TGUI_SHARE_PATH}/gui-builder/gui-builder${EXECUTABLE_SUFFIX}")
|
||||
if(EXISTS "${TGUI_SHARE_PATH}/gui-builder/gui-builder${EXECUTABLE_SUFFIX}")
|
||||
file(MAKE_DIRECTORY "${TGUI_TOOLS_PATH}")
|
||||
file(RENAME
|
||||
"${TGUI_SHARE_PATH}/gui-builder/gui-builder${EXECUTABLE_SUFFIX}"
|
||||
file(RENAME
|
||||
"${TGUI_SHARE_PATH}/gui-builder/gui-builder${EXECUTABLE_SUFFIX}"
|
||||
"${TGUI_TOOLS_PATH}/gui-builder${EXECUTABLE_SUFFIX}")
|
||||
# Need to copy `resources` and `themes` directories
|
||||
file(COPY "${TGUI_SHARE_PATH}/gui-builder/resources" DESTINATION "${TGUI_TOOLS_PATH}")
|
||||
|
@ -1,4 +1,4 @@
|
||||
Source: theia
|
||||
Version: 0.8
|
||||
Build-Depends: flann, cereal, ceres[suitesparse] (!x86&!uwp&!arm&!linux&!osx), openimageio, glew, freeglut
|
||||
Description: An open source library for multiview geometry and structure from motion
|
||||
Source: theia
|
||||
Version: 0.8-2
|
||||
Build-Depends: flann, cereal, ceres[suitesparse], openimageio, glew, freeglut (!osx)
|
||||
Description: An open source library for multiview geometry and structure from motion
|
||||
|
@ -1,310 +0,0 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 9c1b150..367fbbc 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -218,24 +218,71 @@ include_directories(
|
||||
# as system headers.
|
||||
include_directories(SYSTEM ${EIGEN_INCLUDE_DIRS})
|
||||
|
||||
+
|
||||
+set(THEIA_USE_EXTERNAL_CEREAL OFF CACHE BOOL "Use a system Cereal library")
|
||||
+set(THEIA_USE_EXTERNAL_FLANN OFF CACHE BOOL "Use a system Flann library")
|
||||
+
|
||||
# build Third party libraries included in distro.
|
||||
-add_subdirectory(libraries)
|
||||
-include_directories(
|
||||
- libraries
|
||||
- libraries/spectra
|
||||
- ${akaze_SOURCE_DIR}
|
||||
- ${akaze_INCLUDE_DIR}
|
||||
- ${cereal_SOURCE_DIR}
|
||||
- ${cereal_SOURCE_DIR}/include
|
||||
- ${flann_SOURCE_DIR}
|
||||
- ${flann_SOURCE_DIR}/src/cpp
|
||||
- ${gtest_SOURCE_DIR}/include
|
||||
- ${gtest_SOURCE_DIR}
|
||||
- ${optimo_SOURCE_DIR}
|
||||
- ${statx_SOURCE_DIR}
|
||||
- ${stlplus3_SOURCE_DIR}
|
||||
- ${vlfeat_SOURCE_DIR}
|
||||
- ${visual_sfm_SOURCE_DIR})
|
||||
+if (BUILD_TESTING)
|
||||
+ add_subdirectory(libraries/gtest)
|
||||
+endif (BUILD_TESTING)
|
||||
+
|
||||
+# AKAZE feature extractor.
|
||||
+add_subdirectory(libraries/akaze)
|
||||
+
|
||||
+include_directories(${akaze_SOURCE_DIR} ${akaze_INCLUDE_DIR})
|
||||
+
|
||||
+# Cereal for portable IO.
|
||||
+if(NOT THEIA_USE_EXTERNAL_CEREAL)
|
||||
+ add_subdirectory(libraries/cereal)
|
||||
+
|
||||
+ include_directories(${cereal_SOURCE_DIR} ${cereal_SOURCE_DIR}/include)
|
||||
+ set(THEIA_INTERNAL_CEREAL_LIB ${THEIA_INTERNAL_LIB_PREFIX}/cereal ${THEIA_INTERNAL_LIB_PREFIX}/cereal/include)
|
||||
+else()
|
||||
+ find_package(cereal REQUIRED)
|
||||
+
|
||||
+ set(_THEIA_CEREAL_LIBRARIES cereal)
|
||||
+endif()
|
||||
+
|
||||
+# Flann for fast approximate nearest neighbor searches.
|
||||
+if(NOT THEIA_USE_EXTERNAL_FLANN)
|
||||
+ add_subdirectory(libraries/flann)
|
||||
+
|
||||
+ include_directories(${flann_SOURCE_DIR} ${flann_SOURCE_DIR}/src/cpp)
|
||||
+ set(_THEIA_FLANN_LIBRARIES flann_cpp)
|
||||
+ set(THEIA_INTERNAL_FLANN_LIB ${THEIA_INTERNAL_LIB_PREFIX}/flann)
|
||||
+else()
|
||||
+ find_package(Flann REQUIRED)
|
||||
+
|
||||
+ include_directories(${FLANN_INCLUDE_DIR})
|
||||
+ set(_THEIA_FLANN_LIBRARIES ${FLANN_LIBRARY})
|
||||
+endif()
|
||||
+
|
||||
+# Add Optimo.
|
||||
+add_subdirectory(libraries/optimo)
|
||||
+include_directories(${optimo_SOURCE_DIR})
|
||||
+
|
||||
+# Add Spectra.
|
||||
+include_directories(libraries/spectra)
|
||||
+
|
||||
+# Add Statx.
|
||||
+add_subdirectory(libraries/statx)
|
||||
+include_directories(${statx_SOURCE_DIR})
|
||||
+
|
||||
+# STLPlus for filepath tools.
|
||||
+add_subdirectory(libraries/stlplus3)
|
||||
+include_directories(${stlplus3_SOURCE_DIR})
|
||||
+
|
||||
+# Add VLFeat.
|
||||
+add_subdirectory(libraries/vlfeat)
|
||||
+include_directories(${vlfeat_SOURCE_DIR})
|
||||
+
|
||||
+# Add VisualSfM files.
|
||||
+add_subdirectory(libraries/visual_sfm)
|
||||
+include_directories(${visual_sfm_SOURCE_DIR})
|
||||
+
|
||||
+include_directories(libraries)
|
||||
+
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
|
||||
include(OptimizeTheiaCompilerFlags)
|
||||
@@ -260,7 +307,19 @@ install(FILES ${THEIA_HDRS} DESTINATION include/theia)
|
||||
file(GLOB_RECURSE THEIA_INTERNAL_HDRS ${CMAKE_SOURCE_DIR}/src/theia/*.h)
|
||||
install(DIRECTORY src/theia/ DESTINATION include/theia FILES_MATCHING PATTERN "*.h")
|
||||
|
||||
-install(DIRECTORY libraries/ DESTINATION include/theia/libraries FILES_MATCHING PATTERN "*.h*")
|
||||
+install(DIRECTORY libraries/akaze/ DESTINATION include/theia/libraries/akaze FILES_MATCHING PATTERN "*.h*")
|
||||
+if(NOT THEIA_USE_EXTERNAL_CEREAL)
|
||||
+ install(DIRECTORY libraries/cereal/ DESTINATION include/theia/libraries/cereal FILES_MATCHING PATTERN "*.h*")
|
||||
+endif()
|
||||
+if(NOT THEIA_USE_EXTERNAL_FLANN)
|
||||
+ install(DIRECTORY libraries/flann/ DESTINATION include/theia/libraries/flann FILES_MATCHING PATTERN "*.h*")
|
||||
+endif()
|
||||
+install(DIRECTORY libraries/optimo/ DESTINATION include/theia/libraries/optimo FILES_MATCHING PATTERN "*.h*")
|
||||
+install(DIRECTORY libraries/spectra/ DESTINATION include/theia/libraries/spectra FILES_MATCHING PATTERN "*.h*")
|
||||
+install(DIRECTORY libraries/statx/ DESTINATION include/theia/libraries/statx FILES_MATCHING PATTERN "*.h*")
|
||||
+install(DIRECTORY libraries/stlplus3/ DESTINATION include/theia/libraries/stlplus3 FILES_MATCHING PATTERN "*.h*")
|
||||
+install(DIRECTORY libraries/visual_sfm/ DESTINATION include/theia/libraries/visual_sfm FILES_MATCHING PATTERN "*.h*")
|
||||
+install(DIRECTORY libraries/vlfeat/ DESTINATION include/theia/libraries/vlfeat FILES_MATCHING PATTERN "*.h*")
|
||||
|
||||
# Add an uninstall target to remove all installed files.
|
||||
configure_file("${CMAKE_SOURCE_DIR}/cmake/uninstall.cmake.in"
|
||||
@@ -320,8 +379,9 @@ configure_file("${CMAKE_SOURCE_DIR}/cmake/TheiaConfigVersion.cmake.in"
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/TheiaConfig.cmake"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/TheiaConfigVersion.cmake"
|
||||
"${CMAKE_SOURCE_DIR}/cmake/FindEigen.cmake"
|
||||
- "${CMAKE_SOURCE_DIR}/cmake/FindGlog.cmake"
|
||||
+ "${CMAKE_SOURCE_DIR}/cmake/FindFlann.cmake"
|
||||
"${CMAKE_SOURCE_DIR}/cmake/FindGflags.cmake"
|
||||
- "${CMAKE_SOURCE_DIR}/cmake/FindOpenImageIO.cmake"
|
||||
+ "${CMAKE_SOURCE_DIR}/cmake/FindGlog.cmake"
|
||||
+ "${CMAKE_SOURCE_DIR}/cmake/FindOpenImageIO.cmake"
|
||||
"${CMAKE_SOURCE_DIR}/cmake/FindSuiteSparse.cmake"
|
||||
DESTINATION ${CMAKECONFIG_INSTALL_DIR})
|
||||
diff --git a/cmake/FindFlann.cmake b/cmake/FindFlann.cmake
|
||||
new file mode 100644
|
||||
index 0000000..5d19ef7
|
||||
--- /dev/null
|
||||
+++ b/cmake/FindFlann.cmake
|
||||
@@ -0,0 +1,63 @@
|
||||
+###############################################################################
|
||||
+# Find FLANN
|
||||
+#
|
||||
+# This sets the following variables:
|
||||
+# FLANN_FOUND - True if FLANN was found.
|
||||
+# FLANN_INCLUDE_DIRS - Directories containing the FLANN include files.
|
||||
+# FLANN_LIBRARIES - Libraries needed to use FLANN.
|
||||
+# FLANN_DEFINITIONS - Compiler flags for FLANN.
|
||||
+# If FLANN_USE_STATIC is specified and then look for static libraries ONLY else
|
||||
+# look for shared ones
|
||||
+
|
||||
+if(FLANN_USE_STATIC)
|
||||
+ set(FLANN_RELEASE_NAME flann_cpp_s flann_cpp)
|
||||
+ set(FLANN_DEBUG_NAME flann_cpp_s-gd flann_cpp-gd)
|
||||
+else(FLANN_USE_STATIC)
|
||||
+ set(FLANN_RELEASE_NAME flann_cpp)
|
||||
+ set(FLANN_DEBUG_NAME flann_cpp-gd)
|
||||
+endif(FLANN_USE_STATIC)
|
||||
+
|
||||
+find_package(PkgConfig QUIET)
|
||||
+if (FLANN_FIND_VERSION)
|
||||
+ pkg_check_modules(PC_FLANN flann>=${FLANN_FIND_VERSION})
|
||||
+else(FLANN_FIND_VERSION)
|
||||
+ pkg_check_modules(PC_FLANN flann)
|
||||
+endif(FLANN_FIND_VERSION)
|
||||
+
|
||||
+set(FLANN_DEFINITIONS ${PC_FLANN_CFLAGS_OTHER})
|
||||
+
|
||||
+find_path(FLANN_INCLUDE_DIR flann/flann.hpp
|
||||
+ HINTS ${PC_FLANN_INCLUDEDIR} ${PC_FLANN_INCLUDE_DIRS} "${FLANN_ROOT}" "$ENV{FLANN_ROOT}"
|
||||
+ PATHS "$ENV{PROGRAMFILES}/Flann" "$ENV{PROGRAMW6432}/Flann"
|
||||
+ PATH_SUFFIXES include)
|
||||
+
|
||||
+find_library(FLANN_LIBRARY
|
||||
+ NAMES ${FLANN_RELEASE_NAME}
|
||||
+ HINTS ${PC_FLANN_LIBDIR} ${PC_FLANN_LIBRARY_DIRS} "${FLANN_ROOT}" "$ENV{FLANN_ROOT}"
|
||||
+ PATHS "$ENV{PROGRAMFILES}/Flann" "$ENV{PROGRAMW6432}/Flann"
|
||||
+ PATH_SUFFIXES lib)
|
||||
+
|
||||
+find_library(FLANN_LIBRARY_DEBUG
|
||||
+ NAMES ${FLANN_DEBUG_NAME} ${FLANN_RELEASE_NAME}
|
||||
+ HINTS ${PC_FLANN_LIBDIR} ${PC_FLANN_LIBRARY_DIRS} "${FLANN_ROOT}" "$ENV{FLANN_ROOT}"
|
||||
+ PATHS "$ENV{PROGRAMFILES}/Flann" "$ENV{PROGRAMW6432}/Flann"
|
||||
+ PATH_SUFFIXES lib)
|
||||
+
|
||||
+if(NOT FLANN_LIBRARY_DEBUG)
|
||||
+ set(FLANN_LIBRARY_DEBUG ${FLANN_LIBRARY})
|
||||
+endif(NOT FLANN_LIBRARY_DEBUG)
|
||||
+
|
||||
+set(FLANN_INCLUDE_DIRS ${FLANN_INCLUDE_DIR})
|
||||
+set(FLANN_LIBRARIES optimized ${FLANN_LIBRARY} debug ${FLANN_LIBRARY_DEBUG})
|
||||
+
|
||||
+include(FindPackageHandleStandardArgs)
|
||||
+find_package_handle_standard_args(FLANN DEFAULT_MSG FLANN_LIBRARY FLANN_INCLUDE_DIR)
|
||||
+
|
||||
+mark_as_advanced(FLANN_LIBRARY FLANN_LIBRARY_DEBUG FLANN_INCLUDE_DIR)
|
||||
+
|
||||
+if(FLANN_FOUND)
|
||||
+ message(STATUS "Flann found (include: ${FLANN_INCLUDE_DIRS}, lib: ${FLANN_LIBRARIES})")
|
||||
+ if(FLANN_USE_STATIC)
|
||||
+ add_definitions(-DFLANN_STATIC)
|
||||
+ endif(FLANN_USE_STATIC)
|
||||
+endif(FLANN_FOUND)
|
||||
diff --git a/cmake/TheiaConfig.cmake.in b/cmake/TheiaConfig.cmake.in
|
||||
index a3ea187..9195da1 100644
|
||||
--- a/cmake/TheiaConfig.cmake.in
|
||||
+++ b/cmake/TheiaConfig.cmake.in
|
||||
@@ -207,22 +207,47 @@ endif (NOT TARGET theia AND NOT Theia_BINARY_DIR)
|
||||
# Set the expected XX_LIBRARIES variable for FindPackage().
|
||||
set(THEIA_LIBRARIES theia)
|
||||
|
||||
+set(THEIA_USE_EXTERNAL_CEREAL @THEIA_USE_EXTERNAL_CEREAL@)
|
||||
+set(THEIA_USE_EXTERNAL_FLANN @THEIA_USE_EXTERNAL_FLANN@)
|
||||
+
|
||||
+# Cereal.
|
||||
+if (THEIA_USE_EXTERNAL_CEREAL)
|
||||
+ find_package(cereal QUIET)
|
||||
+ if (TARGET cereal)
|
||||
+ message(STATUS "Found required Theia dependency: Cereal")
|
||||
+ else (TARGET cereal)
|
||||
+ theia_report_not_found("Missing required Theia dependency: Cereal.")
|
||||
+ endif (TARGET cereal)
|
||||
+ list(APPEND THEIA_LIBRARIES cereal)
|
||||
+endif (THEIA_USE_EXTERNAL_CEREAL)
|
||||
+
|
||||
+# Flann.
|
||||
+if (THEIA_USE_EXTERNAL_FLANN)
|
||||
+ find_package(Flann QUIET)
|
||||
+ if (FLANN_FOUND)
|
||||
+ message(STATUS "Found required Theia dependency: Flann")
|
||||
+ else (FLANN_FOUND)
|
||||
+ theia_report_not_found("Missing required Theia dependency: Flann.")
|
||||
+ endif (FLANN_FOUND)
|
||||
+ list(APPEND THEIA_INCLUDE_DIRS ${FLANN_INCLUDE_DIR})
|
||||
+ list(APPEND THEIA_LIBRARIES ${FLANN_LIBRARY})
|
||||
+endif (THEIA_USE_EXTERNAL_FLANN)
|
||||
+
|
||||
# Add the libraries included with the distribution.
|
||||
set(THEIA_INTERNAL_LIB_PREFIX ${THEIA_INCLUDE_DIR}/theia/libraries)
|
||||
set(THEIA_INTERNAL_LIBS_INCLUDES
|
||||
${THEIA_INTERNAL_LIB_PREFIX}
|
||||
${THEIA_INTERNAL_LIB_PREFIX}/akaze
|
||||
- ${THEIA_INTERNAL_LIB_PREFIX}/cereal
|
||||
- ${THEIA_INTERNAL_LIB_PREFIX}/cereal/include
|
||||
- ${THEIA_INTERNAL_LIB_PREFIX}/flann
|
||||
+ @THEIA_INTERNAL_CEREAL_LIB@
|
||||
+ @THEIA_INTERNAL_FLANN_LIB@
|
||||
${THEIA_INTERNAL_LIB_PREFIX}/gtest
|
||||
${THEIA_INTERNAL_LIB_PREFIX}/gtest/include
|
||||
${THEIA_INTERNAL_LIB_PREFIX}/optimo
|
||||
${THEIA_INTERNAL_LIB_PREFIX}/spectra
|
||||
${THEIA_INTERNAL_LIB_PREFIX}/statx
|
||||
${THEIA_INTERNAL_LIB_PREFIX}/stlplus3
|
||||
- ${THEIA_INTERNAL_LIB_PREFIX}/vlfeat
|
||||
- ${THEIA_INTERNAL_LIB_PREFIX}/visual_sfm)
|
||||
+ ${THEIA_INTERNAL_LIB_PREFIX}/visual_sfm
|
||||
+ ${THEIA_INTERNAL_LIB_PREFIX}/vlfeat)
|
||||
|
||||
list(APPEND THEIA_INCLUDE_DIRS ${THEIA_INTERNAL_LIBS_INCLUDES})
|
||||
|
||||
diff --git a/libraries/CMakeLists.txt b/libraries/CMakeLists.txt
|
||||
deleted file mode 100644
|
||||
index 84f3829..0000000
|
||||
--- a/libraries/CMakeLists.txt
|
||||
+++ /dev/null
|
||||
@@ -1,27 +0,0 @@
|
||||
-if (${BUILD_TESTING})
|
||||
- add_subdirectory(gtest)
|
||||
-endif (${BUILD_TESTING})
|
||||
-
|
||||
-# AKAZE feature extractor.
|
||||
-add_subdirectory(akaze)
|
||||
-
|
||||
-# Cereal for portable IO.
|
||||
-add_subdirectory(cereal)
|
||||
-
|
||||
-# Flann for fast approximate nearest neighbor searches.
|
||||
-add_subdirectory(flann)
|
||||
-
|
||||
-# Add Optimo.
|
||||
-add_subdirectory(optimo)
|
||||
-
|
||||
-# Add Statx.
|
||||
-add_subdirectory(statx)
|
||||
-
|
||||
-# STLPlus for filepath tools.
|
||||
-add_subdirectory(stlplus3)
|
||||
-
|
||||
-# Add VLFeat.
|
||||
-add_subdirectory(vlfeat)
|
||||
-
|
||||
-# Add VisualSfM files.
|
||||
-add_subdirectory(visual_sfm)
|
||||
\ No newline at end of file
|
||||
diff --git a/src/theia/CMakeLists.txt b/src/theia/CMakeLists.txt
|
||||
index 65787eb..07c54a4 100644
|
||||
--- a/src/theia/CMakeLists.txt
|
||||
+++ b/src/theia/CMakeLists.txt
|
||||
@@ -174,14 +174,15 @@ set(THEIA_LIBRARY_DEPENDENCIES
|
||||
${CERES_LIBRARIES}
|
||||
${GFLAGS_LIBRARIES}
|
||||
${GLOG_LIBRARIES}
|
||||
- ${SUITESPARSE_LIBRARIES}
|
||||
${OPENIMAGEIO_LIBRARIES}
|
||||
+ ${SUITESPARSE_LIBRARIES}
|
||||
+ ${_THEIA_CEREAL_LIBRARIES}
|
||||
+ ${_THEIA_FLANN_LIBRARIES}
|
||||
akaze
|
||||
- flann_cpp
|
||||
statx
|
||||
stlplus3
|
||||
- vlfeat
|
||||
- visual_sfm)
|
||||
+ visual_sfm
|
||||
+ vlfeat)
|
||||
|
||||
set(THEIA_LIBRARY_SOURCE
|
||||
${THEIA_SRC}
|
405
ports/theia/fix-external-dependencies.patch
Normal file
405
ports/theia/fix-external-dependencies.patch
Normal file
@ -0,0 +1,405 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 9c1b150..5810156 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -129,70 +129,27 @@ endif ()
|
||||
|
||||
# GFlags. The namespace patch is borrow from Ceres Solver (see license in
|
||||
# FindGflags.cmake)
|
||||
+message("-- Check for Google Flags")
|
||||
find_package(Gflags REQUIRED)
|
||||
-if (GFLAGS_FOUND)
|
||||
- message("-- Found Google Flags: ${GFLAGS_INCLUDE_DIRS} in namespace: ${GFLAGS_NAMESPACE}")
|
||||
- add_definitions(-DTHEIA_GFLAGS_NAMESPACE=${GFLAGS_NAMESPACE})
|
||||
-else (GFLAGS_FOUND)
|
||||
- message(FATAL_ERROR "Can't find Google FLAGS.")
|
||||
-endif (GFLAGS_FOUND)
|
||||
|
||||
# Google Logging
|
||||
message("-- Check for Google Log")
|
||||
find_package(Glog REQUIRED)
|
||||
-if (GLOG_FOUND)
|
||||
- message("-- Found Google Logging: ${GLOG_INCLUDE_DIRS}")
|
||||
-else (GLOG_FOUND)
|
||||
- message(FATAL_ERROR "Can't find Google Logging. Please set GLOG_INCLUDE_DIR & "
|
||||
- "GLOG_LIBRARY")
|
||||
-endif (GLOG_FOUND)
|
||||
+
|
||||
+# Flann
|
||||
+message("-- Check for Flann")
|
||||
+find_package(Flann REQUIRED)
|
||||
|
||||
# Ceres
|
||||
message("-- Check for Ceres")
|
||||
find_package(Ceres REQUIRED SuiteSparse)
|
||||
-if (CERES_FOUND)
|
||||
- message("-- Found Ceres: ${CERES_INCLUDE_DIRS}")
|
||||
-else (CERES_FOUND)
|
||||
- message(FATAL_ERROR "Can't find Ceres. Please set CERES_INCLUDE_DIR & "
|
||||
- "CERES_LIBRARY")
|
||||
-endif (CERES_FOUND)
|
||||
|
||||
# OpenImageIO
|
||||
message("-- Check for OpenImageIO")
|
||||
find_package(OpenImageIO REQUIRED)
|
||||
-if (OPENIMAGEIO_FOUND)
|
||||
- message("-- Found OpenImageIO: ${OPENIMAGEIO_INCLUDE_DIRS}")
|
||||
-else (OPENIMAGEIO_FOUND)
|
||||
- message(FATAL_ERROR "Can't find OpenImageIO. Please set OPENIMAGEIO_INCLUDE_DIR & "
|
||||
- "OPENIMAGEIO_LIBRARY")
|
||||
-endif (OPENIMAGEIO_FOUND)
|
||||
|
||||
# Suitesparse
|
||||
find_package(SuiteSparse REQUIRED)
|
||||
-if (SUITESPARSE_FOUND)
|
||||
- # On Ubuntu the system install of SuiteSparse (v3.4.0) up to at least
|
||||
- # Ubuntu 13.10 cannot be used to link shared libraries.
|
||||
- if (BUILD_SHARED_LIBS AND
|
||||
- SUITESPARSE_IS_BROKEN_SHARED_LINKING_UBUNTU_SYSTEM_VERSION)
|
||||
- message(FATAL_ERROR "You are attempting to build Theia as a shared "
|
||||
- "library on Ubuntu using a system package install of SuiteSparse "
|
||||
- "3.4.0. This package is broken and does not support the "
|
||||
- "construction of shared libraries (you can still build Theia as "
|
||||
- "a static library). If you wish to build a shared version of Theia "
|
||||
- "you should uninstall the system install of SuiteSparse "
|
||||
- "(libsuitesparse-dev) and perform a source install of SuiteSparse "
|
||||
- "(we recommend that you use the latest version), "
|
||||
- "see http://theia-solver.org/building.html for more information.")
|
||||
- endif (BUILD_SHARED_LIBS AND
|
||||
- SUITESPARSE_IS_BROKEN_SHARED_LINKING_UBUNTU_SYSTEM_VERSION)
|
||||
- message("-- Found SuiteSparse ${SUITESPARSE_VERSION}")
|
||||
- add_definitions(-DTHEIA_SUITESPARSE_VERSION="${SUITESPARSE_VERSION}")
|
||||
-else (SUITESPARSE_FOUND)
|
||||
- # Disable use of SuiteSparse if it cannot be found and continue.
|
||||
- message(FATAL ERROR "Can't find SuiteSparse. This library is required "
|
||||
- "for bundle adjustment and for solving convex optimization problems. "
|
||||
- "Please set SUITESPARSE_INCLUDE_DIR & SUITESPARSE_LIBRARY")
|
||||
-endif (SUITESPARSE_FOUND)
|
||||
|
||||
include_directories(
|
||||
include
|
||||
@@ -225,24 +182,19 @@ include_directories(
|
||||
libraries/spectra
|
||||
${akaze_SOURCE_DIR}
|
||||
${akaze_INCLUDE_DIR}
|
||||
- ${cereal_SOURCE_DIR}
|
||||
- ${cereal_SOURCE_DIR}/include
|
||||
- ${flann_SOURCE_DIR}
|
||||
- ${flann_SOURCE_DIR}/src/cpp
|
||||
- ${gtest_SOURCE_DIR}/include
|
||||
- ${gtest_SOURCE_DIR}
|
||||
${optimo_SOURCE_DIR}
|
||||
${statx_SOURCE_DIR}
|
||||
${stlplus3_SOURCE_DIR}
|
||||
${vlfeat_SOURCE_DIR}
|
||||
- ${visual_sfm_SOURCE_DIR})
|
||||
+ ${visual_sfm_SOURCE_DIR}
|
||||
+)
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
|
||||
include(OptimizeTheiaCompilerFlags)
|
||||
optimizetheiacompilerflags()
|
||||
|
||||
add_subdirectory(src/theia)
|
||||
-add_subdirectory(applications)
|
||||
+#add_subdirectory(applications)
|
||||
|
||||
if (BUILD_DOCUMENTATION)
|
||||
message("-- Documentation building is enabled")
|
||||
@@ -260,7 +212,13 @@ install(FILES ${THEIA_HDRS} DESTINATION include/theia)
|
||||
file(GLOB_RECURSE THEIA_INTERNAL_HDRS ${CMAKE_SOURCE_DIR}/src/theia/*.h)
|
||||
install(DIRECTORY src/theia/ DESTINATION include/theia FILES_MATCHING PATTERN "*.h")
|
||||
|
||||
-install(DIRECTORY libraries/ DESTINATION include/theia/libraries FILES_MATCHING PATTERN "*.h*")
|
||||
+install(DIRECTORY libraries/akaze/ DESTINATION include/theia/libraries/akaze FILES_MATCHING PATTERN "*.h*")
|
||||
+install(DIRECTORY libraries/optimo/ DESTINATION include/theia/libraries/optimo FILES_MATCHING PATTERN "*.h*")
|
||||
+install(DIRECTORY libraries/spectra/ DESTINATION include/theia/libraries/spectra FILES_MATCHING PATTERN "*.h*")
|
||||
+install(DIRECTORY libraries/statx/ DESTINATION include/theia/libraries/statx FILES_MATCHING PATTERN "*.h*")
|
||||
+install(DIRECTORY libraries/stlplus3/ DESTINATION include/theia/libraries/stlplus3 FILES_MATCHING PATTERN "*.h*")
|
||||
+install(DIRECTORY libraries/visual_sfm/ DESTINATION include/theia/libraries/visual_sfm FILES_MATCHING PATTERN "*.h*")
|
||||
+install(DIRECTORY libraries/vlfeat/ DESTINATION include/theia/libraries/vlfeat FILES_MATCHING PATTERN "*.h*")
|
||||
|
||||
# Add an uninstall target to remove all installed files.
|
||||
configure_file("${CMAKE_SOURCE_DIR}/cmake/uninstall.cmake.in"
|
||||
@@ -272,17 +230,10 @@ add_custom_target(uninstall
|
||||
|
||||
# Set up install directories. INCLUDE_INSTALL_DIR, LIB_INSTALL_DIR and
|
||||
# CMAKECONFIG_INSTALL_DIR must not be absolute paths.
|
||||
-if (WIN32)
|
||||
- set(INCLUDE_INSTALL_DIR Include)
|
||||
- set(LIB_INSTALL_DIR Lib)
|
||||
- set(CMAKECONFIG_INSTALL_DIR CMake)
|
||||
- set(RELATIVE_CMAKECONFIG_INSTALL_DIR CMake)
|
||||
-else ()
|
||||
- set(INCLUDE_INSTALL_DIR include)
|
||||
- set(LIB_INSTALL_DIR lib)
|
||||
- set(CMAKECONFIG_INSTALL_DIR share/Theia)
|
||||
- set(RELATIVE_CMAKECONFIG_INSTALL_DIR share/Theia)
|
||||
-endif ()
|
||||
+set(INCLUDE_INSTALL_DIR include)
|
||||
+set(LIB_INSTALL_DIR lib)
|
||||
+set(CMAKECONFIG_INSTALL_DIR share/theia)
|
||||
+set(RELATIVE_CMAKECONFIG_INSTALL_DIR share/theia)
|
||||
|
||||
# This "exports" all targets which have been put into the export set
|
||||
# "TheiaExport". This means that CMake generates a file with the given
|
||||
@@ -319,9 +270,5 @@ configure_file("${CMAKE_SOURCE_DIR}/cmake/TheiaConfigVersion.cmake.in"
|
||||
# in the public API of Theia and should thus be present in THEIA_INCLUDE_DIRS.
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/TheiaConfig.cmake"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/TheiaConfigVersion.cmake"
|
||||
- "${CMAKE_SOURCE_DIR}/cmake/FindEigen.cmake"
|
||||
- "${CMAKE_SOURCE_DIR}/cmake/FindGlog.cmake"
|
||||
- "${CMAKE_SOURCE_DIR}/cmake/FindGflags.cmake"
|
||||
- "${CMAKE_SOURCE_DIR}/cmake/FindOpenImageIO.cmake"
|
||||
- "${CMAKE_SOURCE_DIR}/cmake/FindSuiteSparse.cmake"
|
||||
+ "${CMAKE_SOURCE_DIR}/cmake/FindOpenImageIO.cmake"
|
||||
DESTINATION ${CMAKECONFIG_INSTALL_DIR})
|
||||
diff --git a/cmake/TheiaConfig.cmake.in b/cmake/TheiaConfig.cmake.in
|
||||
index a3ea187..7e9d912 100644
|
||||
--- a/cmake/TheiaConfig.cmake.in
|
||||
+++ b/cmake/TheiaConfig.cmake.in
|
||||
@@ -124,14 +124,7 @@ list(APPEND CERES_INCLUDE_DIR_HINTS @CERES_INCLUDE_DIR@)
|
||||
get_filename_component(THEIA_BUILD_CERES_LIBRARY_DIR @CERES_LIBRARIES@ PATH)
|
||||
list(APPEND CERES_LIBRARY_DIR_HINTS ${THEIA_BUILD_CERES_LIBRARY_DIR})
|
||||
# Search quietly s/t we control the timing of the error message if not found.
|
||||
-find_package(Ceres QUIET)
|
||||
-if (CERES_FOUND)
|
||||
- message(STATUS "Found required Theia dependency: "
|
||||
- "Ceres in ${CERES_INCLUDE_DIRS}")
|
||||
-else (CERES_FOUND)
|
||||
- theia_report_not_found("Missing required Theia "
|
||||
- "dependency: Ceres, please set CERES_INCLUDE_DIR.")
|
||||
-endif (CERES_FOUND)
|
||||
+find_package(Ceres REQUIRED)
|
||||
list(APPEND THEIA_INCLUDE_DIRS ${CERES_INCLUDE_DIRS})
|
||||
|
||||
# Glog.
|
||||
@@ -140,64 +133,19 @@ list(APPEND GLOG_INCLUDE_DIR_HINTS @GLOG_INCLUDE_DIR@)
|
||||
get_filename_component(THEIA_BUILD_GLOG_LIBRARY_DIR @GLOG_LIBRARY@ PATH)
|
||||
list(APPEND GLOG_LIBRARY_DIR_HINTS ${THEIA_BUILD_GLOG_LIBRARY_DIR})
|
||||
# Search quietly s/t we control the timing of the error message if not found.
|
||||
-find_package(Glog QUIET)
|
||||
-if (GLOG_FOUND)
|
||||
- message(STATUS "Found required Theia dependency: "
|
||||
- "Glog in ${GLOG_INCLUDE_DIRS}")
|
||||
-else (GLOG_FOUND)
|
||||
- theia_report_not_found("Missing required Theia "
|
||||
- "dependency: Glog, please set GLOG_INCLUDE_DIR.")
|
||||
-endif (GLOG_FOUND)
|
||||
+find_package(Glog REQUIRED)
|
||||
list(APPEND THEIA_INCLUDE_DIRS ${GLOG_INCLUDE_DIRS})
|
||||
|
||||
# GFlags. The namespace patch is borrow from Ceres Solver (see license in
|
||||
# FindGflags.cmake)
|
||||
-find_package(Gflags QUIET)
|
||||
-if (GFLAGS_FOUND)
|
||||
- message(STATUS "Found required Theia dependency: Google Flags in "
|
||||
- "${GFLAGS_INCLUDE_DIRS} in namespace: ${GFLAGS_NAMESPACE}")
|
||||
- add_definitions(-DTHEIA_GFLAGS_NAMESPACE=${GFLAGS_NAMESPACE})
|
||||
-else (GFLAGS_FOUND)
|
||||
- theia_report_not_found("Missing required Theia dependency: Google Flags, please set "
|
||||
- "GFLAGS_INCLUDE_DIR.")
|
||||
-endif (GFLAGS_FOUND)
|
||||
+find_package(Gflags REQUIRED)
|
||||
list(APPEND THEIA_INCLUDE_DIRS ${GFLAGS_INCLUDE_DIRS})
|
||||
|
||||
# OpenImageIO
|
||||
-find_package(OpenImageIO QUIET)
|
||||
-if (OPENIMAGEIO_FOUND)
|
||||
- message(STATUS "Found Theia dependency: OpenImageIO in ${OPENIMAGEIO_INCLUDE_DIRS}")
|
||||
-else (OPENIMAGEIO_FOUND)
|
||||
- theia_report_not_found("Missing required Theia dependency: OpenImageIO. Please set "
|
||||
- "OPENIMAGEIO_INCLUDE_DIR & OPENIMAGEIO_LIBRARY")
|
||||
-endif (OPENIMAGEIO_FOUND)
|
||||
+find_package(OpenImageIO REQUIRED)
|
||||
list(APPEND THEIA_INCLUDE_DIRS ${OPENIMAGEIO_INCLUDE_DIRS})
|
||||
|
||||
-find_package(SuiteSparse QUIET)
|
||||
-if (SUITESPARSE_FOUND)
|
||||
- # On Ubuntu the system install of SuiteSparse (v3.4.0) up to at least
|
||||
- # Ubuntu 13.10 cannot be used to link shared libraries.
|
||||
- if (BUILD_SHARED_LIBS AND
|
||||
- SUITESPARSE_IS_BROKEN_SHARED_LINKING_UBUNTU_SYSTEM_VERSION)
|
||||
- theia_report_not_found("You are attempting to build Theia as a shared "
|
||||
- "library on Ubuntu using a system package install of SuiteSparse "
|
||||
- "3.4.0. This package is broken and does not support the "
|
||||
- "construction of shared libraries (you can still build Theia as "
|
||||
- "a static library). If you wish to build a shared version of Theia "
|
||||
- "you should uninstall the system install of SuiteSparse "
|
||||
- "(libsuitesparse-dev) and perform a source install of SuiteSparse "
|
||||
- "(we recommend that you use the latest version), "
|
||||
- "see http://theia-solver.org/building.html for more information.")
|
||||
- endif (BUILD_SHARED_LIBS AND
|
||||
- SUITESPARSE_IS_BROKEN_SHARED_LINKING_UBUNTU_SYSTEM_VERSION)
|
||||
- message("-- Found SuiteSparse ${SUITESPARSE_VERSION}")
|
||||
- add_definitions(-DTHEIA_SUITESPARSE_VERSION="${SUITESPARSE_VERSION}")
|
||||
-else (SUITESPARSE_FOUND)
|
||||
- # Disable use of SuiteSparse if it cannot be found and continue.
|
||||
- theia_report_not_found("Can't find SuiteSparse. This library is required "
|
||||
- "for bundle adjustment and for solving convex optimization problems. "
|
||||
- "Please set SUITESPARSE_INCLUDE_DIR & SUITESPARSE_LIBRARY")
|
||||
-endif (SUITESPARSE_FOUND)
|
||||
+find_package(SuiteSparse REQUIRED)
|
||||
list(APPEND THEIA_INCLUDE_DIRS ${SUITESPARSE_INCLUDE_DIRS})
|
||||
|
||||
# Import exported Theia targets.
|
||||
@@ -207,22 +155,24 @@ endif (NOT TARGET theia AND NOT Theia_BINARY_DIR)
|
||||
# Set the expected XX_LIBRARIES variable for FindPackage().
|
||||
set(THEIA_LIBRARIES theia)
|
||||
|
||||
+find_package(cereal REQUIRED)
|
||||
+list(APPEND THEIA_LIBRARIES cereal)
|
||||
+
|
||||
+find_package(Flann REQUIRED)
|
||||
+list(APPEND THEIA_INCLUDE_DIRS ${FLANN_INCLUDE_DIR})
|
||||
+list(APPEND THEIA_LIBRARIES ${FLANN_LIBRARY})
|
||||
+
|
||||
# Add the libraries included with the distribution.
|
||||
set(THEIA_INTERNAL_LIB_PREFIX ${THEIA_INCLUDE_DIR}/theia/libraries)
|
||||
set(THEIA_INTERNAL_LIBS_INCLUDES
|
||||
${THEIA_INTERNAL_LIB_PREFIX}
|
||||
${THEIA_INTERNAL_LIB_PREFIX}/akaze
|
||||
- ${THEIA_INTERNAL_LIB_PREFIX}/cereal
|
||||
- ${THEIA_INTERNAL_LIB_PREFIX}/cereal/include
|
||||
- ${THEIA_INTERNAL_LIB_PREFIX}/flann
|
||||
- ${THEIA_INTERNAL_LIB_PREFIX}/gtest
|
||||
- ${THEIA_INTERNAL_LIB_PREFIX}/gtest/include
|
||||
${THEIA_INTERNAL_LIB_PREFIX}/optimo
|
||||
${THEIA_INTERNAL_LIB_PREFIX}/spectra
|
||||
${THEIA_INTERNAL_LIB_PREFIX}/statx
|
||||
${THEIA_INTERNAL_LIB_PREFIX}/stlplus3
|
||||
- ${THEIA_INTERNAL_LIB_PREFIX}/vlfeat
|
||||
- ${THEIA_INTERNAL_LIB_PREFIX}/visual_sfm)
|
||||
+ ${THEIA_INTERNAL_LIB_PREFIX}/visual_sfm
|
||||
+ ${THEIA_INTERNAL_LIB_PREFIX}/vlfeat)
|
||||
|
||||
list(APPEND THEIA_INCLUDE_DIRS ${THEIA_INTERNAL_LIBS_INCLUDES})
|
||||
|
||||
diff --git a/libraries/CMakeLists.txt b/libraries/CMakeLists.txt
|
||||
index 84f3829..f88d75a 100644
|
||||
--- a/libraries/CMakeLists.txt
|
||||
+++ b/libraries/CMakeLists.txt
|
||||
@@ -5,12 +5,6 @@ endif (${BUILD_TESTING})
|
||||
# AKAZE feature extractor.
|
||||
add_subdirectory(akaze)
|
||||
|
||||
-# Cereal for portable IO.
|
||||
-add_subdirectory(cereal)
|
||||
-
|
||||
-# Flann for fast approximate nearest neighbor searches.
|
||||
-add_subdirectory(flann)
|
||||
-
|
||||
# Add Optimo.
|
||||
add_subdirectory(optimo)
|
||||
|
||||
@@ -24,4 +18,4 @@ add_subdirectory(stlplus3)
|
||||
add_subdirectory(vlfeat)
|
||||
|
||||
# Add VisualSfM files.
|
||||
-add_subdirectory(visual_sfm)
|
||||
\ No newline at end of file
|
||||
+add_subdirectory(visual_sfm)
|
||||
diff --git a/libraries/statx/CMakeLists.txt b/libraries/statx/CMakeLists.txt
|
||||
index 23b9e49..af236a3 100644
|
||||
--- a/libraries/statx/CMakeLists.txt
|
||||
+++ b/libraries/statx/CMakeLists.txt
|
||||
@@ -103,7 +103,11 @@ if(STATX_WITH_CERES)
|
||||
endif(CERES_FOUND)
|
||||
|
||||
# BLAS
|
||||
- find_package(BLAS REQUIRED)
|
||||
+ if(UNIX AND NOT APPLE)
|
||||
+ find_package(OpenBLAS REQUIRED)
|
||||
+ else()
|
||||
+ find_package(BLAS REQUIRED)
|
||||
+ endif()
|
||||
|
||||
# LAPACK
|
||||
find_package(LAPACK REQUIRED)
|
||||
@@ -129,7 +133,6 @@ set(XGAMMA_FILES ${XGAMMA_FUNCS}/asa121.cpp ${XGAMMA_FUNCS}/asa103.cpp)
|
||||
|
||||
# Setting CXX FLAGS appropriately. The code below was inspired from
|
||||
# Google CERES and modified for this library.
|
||||
-set (CMAKE_BUILD_TYPE Release)
|
||||
set (STATX_CXX_FLAGS)
|
||||
|
||||
if (CMAKE_BUILD_TYPE STREQUAL "Release")
|
||||
diff --git a/libraries/vlfeat/CMakeLists.txt b/libraries/vlfeat/CMakeLists.txt
|
||||
index 7f4ffc7..15bca12 100644
|
||||
--- a/libraries/vlfeat/CMakeLists.txt
|
||||
+++ b/libraries/vlfeat/CMakeLists.txt
|
||||
@@ -18,14 +18,19 @@ set(vl_sources
|
||||
vl/random.c
|
||||
vl/sift.c
|
||||
vl/vlad.c)
|
||||
+
|
||||
set_source_files_properties(${vl_sources} PROPERTIES LANGUAGE C)
|
||||
|
||||
+add_library(vlfeat ${vl_sources})
|
||||
+
|
||||
if (MSVC)
|
||||
- add_definitions(-DVL_BUILD_DLL)
|
||||
- add_definitions(-DVL_DISABLE_SSE2)
|
||||
+ if(BUILD_SHARED_LIBS)
|
||||
+ target_compile_definitions(vlfeat PRIVATE VL_BUILD_DLL)
|
||||
+ target_compile_definitions(vlfeat INTERFACE BUILD_DLL)
|
||||
+ endif()
|
||||
+ target_compile_definitions(vlfeat PUBLIC VL_DISABLE_SSE2)
|
||||
endif (MSVC)
|
||||
|
||||
-add_library(vlfeat SHARED ${vl_sources})
|
||||
install(TARGETS vlfeat
|
||||
EXPORT TheiaExport
|
||||
RUNTIME DESTINATION bin
|
||||
diff --git a/libraries/vlfeat/vl/host.h b/libraries/vlfeat/vl/host.h
|
||||
index 293fe1f..0ea3d42 100644
|
||||
--- a/libraries/vlfeat/vl/host.h
|
||||
+++ b/libraries/vlfeat/vl/host.h
|
||||
@@ -312,27 +312,31 @@ defined(__DOXYGEN__)
|
||||
#if defined(VL_COMPILER_MSC) & ! defined(__DOXYGEN__)
|
||||
# define VL_UNUSED
|
||||
# define VL_INLINE static __inline
|
||||
-# define snprintf _snprintf
|
||||
# define isnan _isnan
|
||||
-# ifdef VL_BUILD_DLL
|
||||
+# if defined(VL_BUILD_DLL)
|
||||
# ifdef __cplusplus
|
||||
# define VL_EXPORT extern "C" __declspec(dllexport)
|
||||
# else
|
||||
# define VL_EXPORT extern __declspec(dllexport)
|
||||
# endif
|
||||
-# else
|
||||
+# elif defined(VL_DLL)
|
||||
# ifdef __cplusplus
|
||||
# define VL_EXPORT extern "C" __declspec(dllimport)
|
||||
# else
|
||||
# define VL_EXPORT extern __declspec(dllimport)
|
||||
# endif
|
||||
+# else
|
||||
+# ifdef __cplusplus
|
||||
+# define VL_EXPORT extern "C"
|
||||
+# else
|
||||
+# define VL_EXPORT extern
|
||||
+# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(VL_COMPILER_LCC) & ! defined(__DOXYGEN__)
|
||||
# define VL_UNUSED
|
||||
# define VL_INLINE static __inline
|
||||
-# define snprintf _snprintf
|
||||
# define isnan _isnan
|
||||
VL_INLINE float fabsf(float x) { return (float) fabs((double) x) ; }
|
||||
# ifdef VL_BUILD_DLL
|
||||
diff --git a/src/theia/CMakeLists.txt b/src/theia/CMakeLists.txt
|
||||
index 6830f71..768586d 100644
|
||||
--- a/src/theia/CMakeLists.txt
|
||||
+++ b/src/theia/CMakeLists.txt
|
||||
@@ -209,7 +209,6 @@ set(THEIA_LIBRARY_DEPENDENCIES
|
||||
${SUITESPARSE_LIBRARIES}
|
||||
${OPENIMAGEIO_LIBRARIES}
|
||||
akaze
|
||||
- flann_cpp
|
||||
statx
|
||||
stlplus3
|
||||
vlfeat
|
@ -1,227 +0,0 @@
|
||||
--- a/cmake/FindSuiteSparse.cmake Mon Feb 06 18:05:05 2017
|
||||
+++ b/cmake/FindSuiteSparse.cmake Fri Jul 07 02:13:31 2017
|
||||
@@ -152,6 +152,12 @@
|
||||
# the first.
|
||||
endmacro(SUITESPARSE_REPORT_NOT_FOUND)
|
||||
|
||||
+# Protect against any alternative find_package scripts for this library having
|
||||
+# been called previously (in a client project) which set SUITESPARSE_FOUND, but
|
||||
+# not the other variables we require / set here which could cause the search
|
||||
+# logic here to fail.
|
||||
+unset(SUITESPARSE_FOUND)
|
||||
+
|
||||
# Handle possible presence of lib prefix for libraries on MSVC, see
|
||||
# also SUITESPARSE_RESET_FIND_LIBRARY_PREFIX().
|
||||
if (MSVC)
|
||||
@@ -173,8 +179,6 @@
|
||||
/opt/local/include/ufsparse # Mac OS X
|
||||
/usr/local/homebrew/include # Mac OS X
|
||||
/usr/local/include
|
||||
- /usr/local/include/suitesparse
|
||||
- /usr/include/suitesparse # Ubuntu
|
||||
/usr/include)
|
||||
list(APPEND SUITESPARSE_CHECK_LIBRARY_DIRS
|
||||
${SUITESPARSE_LIBRARY_DIR_HINTS}
|
||||
@@ -182,9 +186,10 @@
|
||||
/opt/local/lib/ufsparse # Mac OS X
|
||||
/usr/local/homebrew/lib # Mac OS X
|
||||
/usr/local/lib
|
||||
- /usr/local/lib/suitesparse
|
||||
- /usr/lib/suitesparse # Ubuntu
|
||||
/usr/lib)
|
||||
+# Additional suffixes to try appending to each search path.
|
||||
+list(APPEND SUITESPARSE_CHECK_PATH_SUFFIXES
|
||||
+ suitesparse) # Windows/Ubuntu
|
||||
|
||||
# Given the number of components of SuiteSparse, and to ensure that the
|
||||
# automatic failure message generated by FindPackageHandleStandardArgs()
|
||||
@@ -212,7 +217,8 @@
|
||||
set(AMD_FOUND TRUE)
|
||||
list(APPEND SUITESPARSE_FOUND_REQUIRED_VARS AMD_FOUND)
|
||||
find_library(AMD_LIBRARY NAMES amd
|
||||
- PATHS ${SUITESPARSE_CHECK_LIBRARY_DIRS})
|
||||
+ PATHS ${SUITESPARSE_CHECK_LIBRARY_DIRS}
|
||||
+ PATH_SUFFIXES ${SUITESPARSE_CHECK_PATH_SUFFIXES})
|
||||
if (EXISTS ${AMD_LIBRARY})
|
||||
message(STATUS "Found AMD library: ${AMD_LIBRARY}")
|
||||
else (EXISTS ${AMD_LIBRARY})
|
||||
@@ -223,7 +229,8 @@
|
||||
mark_as_advanced(AMD_LIBRARY)
|
||||
|
||||
find_path(AMD_INCLUDE_DIR NAMES amd.h
|
||||
- PATHS ${SUITESPARSE_CHECK_INCLUDE_DIRS})
|
||||
+ PATHS ${SUITESPARSE_CHECK_INCLUDE_DIRS}
|
||||
+ PATH_SUFFIXES ${SUITESPARSE_CHECK_PATH_SUFFIXES})
|
||||
if (EXISTS ${AMD_INCLUDE_DIR})
|
||||
message(STATUS "Found AMD header in: ${AMD_INCLUDE_DIR}")
|
||||
else (EXISTS ${AMD_INCLUDE_DIR})
|
||||
@@ -237,7 +244,8 @@
|
||||
set(CAMD_FOUND TRUE)
|
||||
list(APPEND SUITESPARSE_FOUND_REQUIRED_VARS CAMD_FOUND)
|
||||
find_library(CAMD_LIBRARY NAMES camd
|
||||
- PATHS ${SUITESPARSE_CHECK_LIBRARY_DIRS})
|
||||
+ PATHS ${SUITESPARSE_CHECK_LIBRARY_DIRS}
|
||||
+ PATH_SUFFIXES ${SUITESPARSE_CHECK_PATH_SUFFIXES})
|
||||
if (EXISTS ${CAMD_LIBRARY})
|
||||
message(STATUS "Found CAMD library: ${CAMD_LIBRARY}")
|
||||
else (EXISTS ${CAMD_LIBRARY})
|
||||
@@ -248,7 +256,8 @@
|
||||
mark_as_advanced(CAMD_LIBRARY)
|
||||
|
||||
find_path(CAMD_INCLUDE_DIR NAMES camd.h
|
||||
- PATHS ${SUITESPARSE_CHECK_INCLUDE_DIRS})
|
||||
+ PATHS ${SUITESPARSE_CHECK_INCLUDE_DIRS}
|
||||
+ PATH_SUFFIXES ${SUITESPARSE_CHECK_PATH_SUFFIXES})
|
||||
if (EXISTS ${CAMD_INCLUDE_DIR})
|
||||
message(STATUS "Found CAMD header in: ${CAMD_INCLUDE_DIR}")
|
||||
else (EXISTS ${CAMD_INCLUDE_DIR})
|
||||
@@ -262,7 +271,8 @@
|
||||
set(COLAMD_FOUND TRUE)
|
||||
list(APPEND SUITESPARSE_FOUND_REQUIRED_VARS COLAMD_FOUND)
|
||||
find_library(COLAMD_LIBRARY NAMES colamd
|
||||
- PATHS ${SUITESPARSE_CHECK_LIBRARY_DIRS})
|
||||
+ PATHS ${SUITESPARSE_CHECK_LIBRARY_DIRS}
|
||||
+ PATH_SUFFIXES ${SUITESPARSE_CHECK_PATH_SUFFIXES})
|
||||
if (EXISTS ${COLAMD_LIBRARY})
|
||||
message(STATUS "Found COLAMD library: ${COLAMD_LIBRARY}")
|
||||
else (EXISTS ${COLAMD_LIBRARY})
|
||||
@@ -273,7 +283,8 @@
|
||||
mark_as_advanced(COLAMD_LIBRARY)
|
||||
|
||||
find_path(COLAMD_INCLUDE_DIR NAMES colamd.h
|
||||
- PATHS ${SUITESPARSE_CHECK_INCLUDE_DIRS})
|
||||
+ PATHS ${SUITESPARSE_CHECK_INCLUDE_DIRS}
|
||||
+ PATH_SUFFIXES ${SUITESPARSE_CHECK_PATH_SUFFIXES})
|
||||
if (EXISTS ${COLAMD_INCLUDE_DIR})
|
||||
message(STATUS "Found COLAMD header in: ${COLAMD_INCLUDE_DIR}")
|
||||
else (EXISTS ${COLAMD_INCLUDE_DIR})
|
||||
@@ -287,7 +298,8 @@
|
||||
set(CCOLAMD_FOUND TRUE)
|
||||
list(APPEND SUITESPARSE_FOUND_REQUIRED_VARS CCOLAMD_FOUND)
|
||||
find_library(CCOLAMD_LIBRARY NAMES ccolamd
|
||||
- PATHS ${SUITESPARSE_CHECK_LIBRARY_DIRS})
|
||||
+ PATHS ${SUITESPARSE_CHECK_LIBRARY_DIRS}
|
||||
+ PATH_SUFFIXES ${SUITESPARSE_CHECK_PATH_SUFFIXES})
|
||||
if (EXISTS ${CCOLAMD_LIBRARY})
|
||||
message(STATUS "Found CCOLAMD library: ${CCOLAMD_LIBRARY}")
|
||||
else (EXISTS ${CCOLAMD_LIBRARY})
|
||||
@@ -298,7 +310,8 @@
|
||||
mark_as_advanced(CCOLAMD_LIBRARY)
|
||||
|
||||
find_path(CCOLAMD_INCLUDE_DIR NAMES ccolamd.h
|
||||
- PATHS ${SUITESPARSE_CHECK_INCLUDE_DIRS})
|
||||
+ PATHS ${SUITESPARSE_CHECK_INCLUDE_DIRS}
|
||||
+ PATH_SUFFIXES ${SUITESPARSE_CHECK_PATH_SUFFIXES})
|
||||
if (EXISTS ${CCOLAMD_INCLUDE_DIR})
|
||||
message(STATUS "Found CCOLAMD header in: ${CCOLAMD_INCLUDE_DIR}")
|
||||
else (EXISTS ${CCOLAMD_INCLUDE_DIR})
|
||||
@@ -312,7 +325,8 @@
|
||||
set(CHOLMOD_FOUND TRUE)
|
||||
list(APPEND SUITESPARSE_FOUND_REQUIRED_VARS CHOLMOD_FOUND)
|
||||
find_library(CHOLMOD_LIBRARY NAMES cholmod
|
||||
- PATHS ${SUITESPARSE_CHECK_LIBRARY_DIRS})
|
||||
+ PATHS ${SUITESPARSE_CHECK_LIBRARY_DIRS}
|
||||
+ PATH_SUFFIXES ${SUITESPARSE_CHECK_PATH_SUFFIXES})
|
||||
if (EXISTS ${CHOLMOD_LIBRARY})
|
||||
message(STATUS "Found CHOLMOD library: ${CHOLMOD_LIBRARY}")
|
||||
else (EXISTS ${CHOLMOD_LIBRARY})
|
||||
@@ -323,7 +337,8 @@
|
||||
mark_as_advanced(CHOLMOD_LIBRARY)
|
||||
|
||||
find_path(CHOLMOD_INCLUDE_DIR NAMES cholmod.h
|
||||
- PATHS ${SUITESPARSE_CHECK_INCLUDE_DIRS})
|
||||
+ PATHS ${SUITESPARSE_CHECK_INCLUDE_DIRS}
|
||||
+ PATH_SUFFIXES ${SUITESPARSE_CHECK_PATH_SUFFIXES})
|
||||
if (EXISTS ${CHOLMOD_INCLUDE_DIR})
|
||||
message(STATUS "Found CHOLMOD header in: ${CHOLMOD_INCLUDE_DIR}")
|
||||
else (EXISTS ${CHOLMOD_INCLUDE_DIR})
|
||||
@@ -337,7 +352,8 @@
|
||||
set(SUITESPARSEQR_FOUND TRUE)
|
||||
list(APPEND SUITESPARSE_FOUND_REQUIRED_VARS SUITESPARSEQR_FOUND)
|
||||
find_library(SUITESPARSEQR_LIBRARY NAMES spqr
|
||||
- PATHS ${SUITESPARSE_CHECK_LIBRARY_DIRS})
|
||||
+ PATHS ${SUITESPARSE_CHECK_LIBRARY_DIRS}
|
||||
+ PATH_SUFFIXES ${SUITESPARSE_CHECK_PATH_SUFFIXES})
|
||||
if (EXISTS ${SUITESPARSEQR_LIBRARY})
|
||||
message(STATUS "Found SuiteSparseQR library: ${SUITESPARSEQR_LIBRARY}")
|
||||
else (EXISTS ${SUITESPARSEQR_LIBRARY})
|
||||
@@ -348,7 +364,8 @@
|
||||
mark_as_advanced(SUITESPARSEQR_LIBRARY)
|
||||
|
||||
find_path(SUITESPARSEQR_INCLUDE_DIR NAMES SuiteSparseQR.hpp
|
||||
- PATHS ${SUITESPARSE_CHECK_INCLUDE_DIRS})
|
||||
+ PATHS ${SUITESPARSE_CHECK_INCLUDE_DIRS}
|
||||
+ PATH_SUFFIXES ${SUITESPARSE_CHECK_PATH_SUFFIXES})
|
||||
if (EXISTS ${SUITESPARSEQR_INCLUDE_DIR})
|
||||
message(STATUS "Found SuiteSparseQR header in: ${SUITESPARSEQR_INCLUDE_DIR}")
|
||||
else (EXISTS ${SUITESPARSEQR_INCLUDE_DIR})
|
||||
@@ -364,7 +381,8 @@
|
||||
# support for it, this will do no harm if it wasn't.
|
||||
set(TBB_FOUND TRUE)
|
||||
find_library(TBB_LIBRARIES NAMES tbb
|
||||
- PATHS ${SUITESPARSE_CHECK_LIBRARY_DIRS})
|
||||
+ PATHS ${SUITESPARSE_CHECK_LIBRARY_DIRS}
|
||||
+ PATH_SUFFIXES ${SUITESPARSE_CHECK_PATH_SUFFIXES})
|
||||
if (EXISTS ${TBB_LIBRARIES})
|
||||
message(STATUS "Found Intel Thread Building Blocks (TBB) library: "
|
||||
"${TBB_LIBRARIES}, assuming SuiteSparseQR was compiled with TBB.")
|
||||
@@ -377,7 +395,8 @@
|
||||
|
||||
if (TBB_FOUND)
|
||||
find_library(TBB_MALLOC_LIB NAMES tbbmalloc
|
||||
- PATHS ${SUITESPARSE_CHECK_LIBRARY_DIRS})
|
||||
+ PATHS ${SUITESPARSE_CHECK_LIBRARY_DIRS}
|
||||
+ PATH_SUFFIXES ${SUITESPARSE_CHECK_PATH_SUFFIXES})
|
||||
if (EXISTS ${TBB_MALLOC_LIB})
|
||||
message(STATUS "Found Intel Thread Building Blocks (TBB) Malloc library: "
|
||||
"${TBB_MALLOC_LIB}")
|
||||
@@ -407,7 +426,8 @@
|
||||
# If SuiteSparse version is >= 4 then SuiteSparse_config is required.
|
||||
# For SuiteSparse 3, UFconfig.h is required.
|
||||
find_library(SUITESPARSE_CONFIG_LIBRARY NAMES suitesparseconfig
|
||||
- PATHS ${SUITESPARSE_CHECK_LIBRARY_DIRS})
|
||||
+ PATHS ${SUITESPARSE_CHECK_LIBRARY_DIRS}
|
||||
+ PATH_SUFFIXES ${SUITESPARSE_CHECK_PATH_SUFFIXES})
|
||||
if (EXISTS ${SUITESPARSE_CONFIG_LIBRARY})
|
||||
message(STATUS "Found SuiteSparse_config library: "
|
||||
"${SUITESPARSE_CONFIG_LIBRARY}")
|
||||
@@ -415,7 +435,8 @@
|
||||
mark_as_advanced(SUITESPARSE_CONFIG_LIBRARY)
|
||||
|
||||
find_path(SUITESPARSE_CONFIG_INCLUDE_DIR NAMES SuiteSparse_config.h
|
||||
- PATHS ${SUITESPARSE_CHECK_INCLUDE_DIRS})
|
||||
+ PATHS ${SUITESPARSE_CHECK_INCLUDE_DIRS}
|
||||
+ PATH_SUFFIXES ${SUITESPARSE_CHECK_PATH_SUFFIXES})
|
||||
if (EXISTS ${SUITESPARSE_CONFIG_INCLUDE_DIR})
|
||||
message(STATUS "Found SuiteSparse_config header in: "
|
||||
"${SUITESPARSE_CONFIG_INCLUDE_DIR}")
|
||||
@@ -433,7 +454,8 @@
|
||||
# does not have librt).
|
||||
if (CMAKE_SYSTEM_NAME MATCHES "Linux" OR UNIX AND NOT APPLE)
|
||||
find_library(LIBRT_LIBRARY NAMES rt
|
||||
- PATHS ${SUITESPARSE_CHECK_LIBRARY_DIRS})
|
||||
+ PATHS ${SUITESPARSE_CHECK_LIBRARY_DIRS}
|
||||
+ PATH_SUFFIXES ${SUITESPARSE_CHECK_PATH_SUFFIXES})
|
||||
if (LIBRT_LIBRARY)
|
||||
message(STATUS "Adding librt: ${LIBRT_LIBRARY} to "
|
||||
"SuiteSparse_config libraries (required on Linux & Unix [not OSX] if "
|
||||
@@ -452,7 +474,8 @@
|
||||
# UFconfig header which should be present in < v4 installs.
|
||||
set(SUITESPARSE_CONFIG_FOUND FALSE)
|
||||
find_path(UFCONFIG_INCLUDE_DIR NAMES UFconfig.h
|
||||
- PATHS ${SUITESPARSE_CHECK_INCLUDE_DIRS})
|
||||
+ PATHS ${SUITESPARSE_CHECK_INCLUDE_DIRS}
|
||||
+ PATH_SUFFIXES ${SUITESPARSE_CHECK_PATH_SUFFIXES})
|
||||
if (EXISTS ${UFCONFIG_INCLUDE_DIR})
|
||||
message(STATUS "Found UFconfig header in: ${UFCONFIG_INCLUDE_DIR}")
|
||||
set(UFCONFIG_FOUND TRUE)
|
||||
@@ -543,7 +566,8 @@
|
||||
|
||||
# METIS (Optional dependency).
|
||||
find_library(METIS_LIBRARY NAMES metis
|
||||
- PATHS ${SUITESPARSE_CHECK_LIBRARY_DIRS})
|
||||
+ PATHS ${SUITESPARSE_CHECK_LIBRARY_DIRS}
|
||||
+ PATH_SUFFIXES ${SUITESPARSE_CHECK_PATH_SUFFIXES})
|
||||
if (EXISTS ${METIS_LIBRARY})
|
||||
message(STATUS "Found METIS library: ${METIS_LIBRARY}.")
|
||||
set(METIS_FOUND TRUE)
|
@ -1,12 +0,0 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 9c1b150..6518e6a 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -146,6 +146,7 @@ else (GLOG_FOUND)
|
||||
message(FATAL_ERROR "Can't find Google Logging. Please set GLOG_INCLUDE_DIR & "
|
||||
"GLOG_LIBRARY")
|
||||
endif (GLOG_FOUND)
|
||||
+add_definitions(-DGLOG_NO_ABBREVIATED_SEVERITIES)
|
||||
|
||||
# Ceres
|
||||
message("-- Check for Ceres")
|
@ -1,391 +0,0 @@
|
||||
diff --git a/src/theia/image/image.cc b/src/theia/image/image.cc
|
||||
index df6aba4..5e2b8dc 100644
|
||||
--- a/src/theia/image/image.cc
|
||||
+++ b/src/theia/image/image.cc
|
||||
@@ -60,18 +60,18 @@ FloatImage::FloatImage(const FloatImage& image_to_copy) {
|
||||
}
|
||||
|
||||
FloatImage::FloatImage(const int width, const int height, const int channels) {
|
||||
- OpenImageIO::ImageSpec image_spec(width, height, channels,
|
||||
- OpenImageIO::TypeDesc::FLOAT);
|
||||
+ OIIO_NAMESPACE::ImageSpec image_spec(width, height, channels,
|
||||
+ OIIO_NAMESPACE::TypeDesc::FLOAT);
|
||||
image_.reset(image_spec);
|
||||
}
|
||||
|
||||
FloatImage::FloatImage(const int width, const int height, const int channels,
|
||||
float* buffer)
|
||||
- : image_(OpenImageIO::ImageSpec(width, height, channels,
|
||||
- OpenImageIO::TypeDesc::FLOAT),
|
||||
+ : image_(OIIO_NAMESPACE::ImageSpec(width, height, channels,
|
||||
+ OIIO_NAMESPACE::TypeDesc::FLOAT),
|
||||
reinterpret_cast<void*>(buffer)) {}
|
||||
|
||||
-FloatImage::FloatImage(const OpenImageIO::ImageBuf& image) {
|
||||
+FloatImage::FloatImage(const OIIO_NAMESPACE::ImageBuf& image) {
|
||||
image_.copy(image);
|
||||
}
|
||||
|
||||
@@ -80,11 +80,11 @@ FloatImage& FloatImage::operator=(const FloatImage& image2) {
|
||||
return *this;
|
||||
}
|
||||
|
||||
-OpenImageIO::ImageBuf& FloatImage::GetOpenImageIOImageBuf() {
|
||||
+OIIO_NAMESPACE::ImageBuf& FloatImage::GetOpenImageIOImageBuf() {
|
||||
return image_;
|
||||
}
|
||||
|
||||
-const OpenImageIO::ImageBuf& FloatImage::GetOpenImageIOImageBuf() const {
|
||||
+const OIIO_NAMESPACE::ImageBuf& FloatImage::GetOpenImageIOImageBuf() const {
|
||||
return image_;
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ void FloatImage::SetXY(const int x,
|
||||
DCHECK_LT(c, Channels());
|
||||
|
||||
// Set the ROI to be the precise pixel location in the correct channel.
|
||||
- OpenImageIO::ImageBuf::Iterator<float> it(image_, x, y, 0);
|
||||
+ OIIO_NAMESPACE::ImageBuf::Iterator<float> it(image_, x, y, 0);
|
||||
it[c] = value;
|
||||
}
|
||||
|
||||
@@ -195,9 +195,9 @@ void FloatImage::ConvertToGrayscaleImage() {
|
||||
// Compute luminance via a weighted sum of R,G,B (assuming Rec709 primaries
|
||||
// and a linear scale)
|
||||
const float luma_weights[3] = {.2126, .7152, .0722};
|
||||
- OpenImageIO::ImageBuf source = image_;
|
||||
+ OIIO_NAMESPACE::ImageBuf source = image_;
|
||||
image_.clear();
|
||||
- OpenImageIO::ImageBufAlgo::channel_sum(image_, source, luma_weights);
|
||||
+ OIIO_NAMESPACE::ImageBufAlgo::channel_sum(image_, source, luma_weights);
|
||||
}
|
||||
|
||||
void FloatImage::ConvertToRGBImage() {
|
||||
@@ -207,13 +207,13 @@ void FloatImage::ConvertToRGBImage() {
|
||||
}
|
||||
|
||||
// Copy the single grayscale channel into r, g, and b.
|
||||
- const OpenImageIO::ImageBuf source(image_);
|
||||
- OpenImageIO::ImageSpec image_spec(Width(), Height(), 3,
|
||||
- OpenImageIO::TypeDesc::FLOAT);
|
||||
+ const OIIO_NAMESPACE::ImageBuf source(image_);
|
||||
+ OIIO_NAMESPACE::ImageSpec image_spec(Width(), Height(), 3,
|
||||
+ OIIO_NAMESPACE::TypeDesc::FLOAT);
|
||||
image_.reset(image_spec);
|
||||
- OpenImageIO::ImageBufAlgo::paste(image_, 0, 0, 0, 0, source);
|
||||
- OpenImageIO::ImageBufAlgo::paste(image_, 0, 0, 0, 1, source);
|
||||
- OpenImageIO::ImageBufAlgo::paste(image_, 0, 0, 0, 2, source);
|
||||
+ OIIO_NAMESPACE::ImageBufAlgo::paste(image_, 0, 0, 0, 0, source);
|
||||
+ OIIO_NAMESPACE::ImageBufAlgo::paste(image_, 0, 0, 0, 1, source);
|
||||
+ OIIO_NAMESPACE::ImageBufAlgo::paste(image_, 0, 0, 0, 2, source);
|
||||
}
|
||||
|
||||
FloatImage FloatImage::AsGrayscaleImage() const {
|
||||
@@ -238,12 +238,12 @@ FloatImage FloatImage::AsRGBImage() const {
|
||||
}
|
||||
|
||||
void FloatImage::ScalePixels(float scale) {
|
||||
- OpenImageIO::ImageBufAlgo::mul(image_, image_, scale);
|
||||
+ OIIO_NAMESPACE::ImageBufAlgo::mul(image_, image_, scale);
|
||||
}
|
||||
|
||||
void FloatImage::Read(const std::string& filename) {
|
||||
image_.reset(filename);
|
||||
- image_.read(0, 0, true, OpenImageIO::TypeDesc::FLOAT);
|
||||
+ image_.read(0, 0, true, OIIO_NAMESPACE::TypeDesc::FLOAT);
|
||||
}
|
||||
|
||||
void FloatImage::Write(const std::string& filename) const {
|
||||
@@ -259,19 +259,19 @@ const float* FloatImage::Data() const {
|
||||
|
||||
FloatImage FloatImage::ComputeGradientX() const {
|
||||
float sobel_filter_x[9] = {-.125, 0, .125, -.25, 0, .25, -.125, 0, .125};
|
||||
- OpenImageIO::ImageSpec spec(3, 3, 1, OpenImageIO::TypeDesc::FLOAT);
|
||||
- OpenImageIO::ImageBuf kernel_x(spec, sobel_filter_x);
|
||||
- OpenImageIO::ImageBuf gradient_x;
|
||||
- OpenImageIO::ImageBufAlgo::convolve(gradient_x, image_, kernel_x, false);
|
||||
+ OIIO_NAMESPACE::ImageSpec spec(3, 3, 1, OIIO_NAMESPACE::TypeDesc::FLOAT);
|
||||
+ OIIO_NAMESPACE::ImageBuf kernel_x(spec, sobel_filter_x);
|
||||
+ OIIO_NAMESPACE::ImageBuf gradient_x;
|
||||
+ OIIO_NAMESPACE::ImageBufAlgo::convolve(gradient_x, image_, kernel_x, false);
|
||||
return FloatImage(gradient_x);
|
||||
}
|
||||
|
||||
FloatImage FloatImage::ComputeGradientY() const {
|
||||
float sobel_filter_y[9] = {-.125, -.25, -.125, 0, 0, 0, .125, .25, .125};
|
||||
- OpenImageIO::ImageSpec spec(3, 3, 1, OpenImageIO::TypeDesc::FLOAT);
|
||||
- OpenImageIO::ImageBuf kernel_y(spec, sobel_filter_y);
|
||||
- OpenImageIO::ImageBuf gradient_y;
|
||||
- OpenImageIO::ImageBufAlgo::convolve(gradient_y, image_, kernel_y, false);
|
||||
+ OIIO_NAMESPACE::ImageSpec spec(3, 3, 1, OIIO_NAMESPACE::TypeDesc::FLOAT);
|
||||
+ OIIO_NAMESPACE::ImageBuf kernel_y(spec, sobel_filter_y);
|
||||
+ OIIO_NAMESPACE::ImageBuf gradient_y;
|
||||
+ OIIO_NAMESPACE::ImageBufAlgo::convolve(gradient_y, image_, kernel_y, false);
|
||||
return FloatImage(gradient_y);
|
||||
}
|
||||
|
||||
@@ -280,28 +280,28 @@ FloatImage FloatImage::ComputeGradient() const {
|
||||
float sobel_filter_x[9] = {-.125, 0, .125, -.25, 0, .25, -.125, 0, .125};
|
||||
float sobel_filter_y[9] = {-.125, -.25, -.125, 0, 0, 0, .125, .25, .125};
|
||||
|
||||
- OpenImageIO::ImageSpec spec(3, 3, 1, OpenImageIO::TypeDesc::FLOAT);
|
||||
- OpenImageIO::ImageBuf kernel_x(spec, sobel_filter_x);
|
||||
- OpenImageIO::ImageBuf kernel_y(spec, sobel_filter_y);
|
||||
+ OIIO_NAMESPACE::ImageSpec spec(3, 3, 1, OIIO_NAMESPACE::TypeDesc::FLOAT);
|
||||
+ OIIO_NAMESPACE::ImageBuf kernel_x(spec, sobel_filter_x);
|
||||
+ OIIO_NAMESPACE::ImageBuf kernel_y(spec, sobel_filter_y);
|
||||
|
||||
- OpenImageIO::ImageBuf gradient, gradient_x, gradient_y;
|
||||
- OpenImageIO::ImageBufAlgo::convolve(gradient_x, image_, kernel_x, false);
|
||||
- OpenImageIO::ImageBufAlgo::abs(gradient_x, gradient_x);
|
||||
- OpenImageIO::ImageBufAlgo::convolve(gradient_y, image_, kernel_y, false);
|
||||
- OpenImageIO::ImageBufAlgo::abs(gradient_y, gradient_y);
|
||||
- OpenImageIO::ImageBufAlgo::add(gradient, gradient_x, gradient_y);
|
||||
+ OIIO_NAMESPACE::ImageBuf gradient, gradient_x, gradient_y;
|
||||
+ OIIO_NAMESPACE::ImageBufAlgo::convolve(gradient_x, image_, kernel_x, false);
|
||||
+ OIIO_NAMESPACE::ImageBufAlgo::abs(gradient_x, gradient_x);
|
||||
+ OIIO_NAMESPACE::ImageBufAlgo::convolve(gradient_y, image_, kernel_y, false);
|
||||
+ OIIO_NAMESPACE::ImageBufAlgo::abs(gradient_y, gradient_y);
|
||||
+ OIIO_NAMESPACE::ImageBufAlgo::add(gradient, gradient_x, gradient_y);
|
||||
|
||||
return FloatImage(gradient);
|
||||
}
|
||||
|
||||
void FloatImage::ApproximateGaussianBlur(const double sigma) {
|
||||
- OpenImageIO::ImageBuf kernel;
|
||||
- OpenImageIO::ImageBufAlgo::make_kernel(kernel, "gaussian", 5.0f, 5.0f);
|
||||
- OpenImageIO::ImageBufAlgo::convolve(image_, image_, kernel);
|
||||
+ OIIO_NAMESPACE::ImageBuf kernel;
|
||||
+ OIIO_NAMESPACE::ImageBufAlgo::make_kernel(kernel, "gaussian", 5.0f, 5.0f);
|
||||
+ OIIO_NAMESPACE::ImageBufAlgo::convolve(image_, image_, kernel);
|
||||
}
|
||||
|
||||
void FloatImage::MedianFilter(const int patch_width) {
|
||||
- CHECK(OpenImageIO::ImageBufAlgo::median_filter(image_, image_, patch_width));
|
||||
+ CHECK(OIIO_NAMESPACE::ImageBufAlgo::median_filter(image_, image_, patch_width));
|
||||
}
|
||||
|
||||
void FloatImage::Integrate(FloatImage* integral) const {
|
||||
@@ -327,14 +327,14 @@ void FloatImage::Resize(int new_width, int new_height) {
|
||||
// If the image has not been initialized then initialize it with the image
|
||||
// spec. Otherwise resize the image and interpolate pixels accordingly.
|
||||
if (!image_.initialized()) {
|
||||
- OpenImageIO::ImageSpec image_spec(new_width, new_height, Channels(),
|
||||
- OpenImageIO::TypeDesc::FLOAT);
|
||||
+ OIIO_NAMESPACE::ImageSpec image_spec(new_width, new_height, Channels(),
|
||||
+ OIIO_NAMESPACE::TypeDesc::FLOAT);
|
||||
image_.reset(image_spec);
|
||||
} else {
|
||||
- OpenImageIO::ROI roi(0, new_width, 0, new_height, 0, 1, 0, Channels());
|
||||
- OpenImageIO::ImageBuf dst;
|
||||
- CHECK(OpenImageIO::ImageBufAlgo::resize(dst, image_, nullptr, roi))
|
||||
- << OpenImageIO::geterror();
|
||||
+ OIIO_NAMESPACE::ROI roi(0, new_width, 0, new_height, 0, 1, 0, Channels());
|
||||
+ OIIO_NAMESPACE::ImageBuf dst;
|
||||
+ CHECK(OIIO_NAMESPACE::ImageBufAlgo::resize(dst, image_, nullptr, roi))
|
||||
+ << OIIO_NAMESPACE::geterror();
|
||||
image_.copy(dst);
|
||||
}
|
||||
}
|
||||
diff --git a/src/theia/image/image.h b/src/theia/image/image.h
|
||||
index e4f22cc..29122d2 100644
|
||||
--- a/src/theia/image/image.h
|
||||
+++ b/src/theia/image/image.h
|
||||
@@ -64,7 +64,7 @@ class FloatImage {
|
||||
|
||||
// Copy function. This is a deep copy of the image.
|
||||
FloatImage(const FloatImage& image_to_copy);
|
||||
- explicit FloatImage(const OpenImageIO::ImageBuf& image);
|
||||
+ explicit FloatImage(const OIIO_NAMESPACE::ImageBuf& image);
|
||||
FloatImage& operator=(const FloatImage& image2);
|
||||
~FloatImage() {}
|
||||
|
||||
@@ -74,8 +74,8 @@ class FloatImage {
|
||||
// wrapper for all algorithms. Getting a reference to the ImageBuf provides
|
||||
// efficient access to the image data so that the image processing algorithms
|
||||
// or other manipulations may be executed on the pixels.
|
||||
- OpenImageIO::ImageBuf& GetOpenImageIOImageBuf();
|
||||
- const OpenImageIO::ImageBuf& GetOpenImageIOImageBuf() const;
|
||||
+ OIIO_NAMESPACE::ImageBuf& GetOpenImageIOImageBuf();
|
||||
+ const OIIO_NAMESPACE::ImageBuf& GetOpenImageIOImageBuf() const;
|
||||
|
||||
// Image information
|
||||
int Rows() const;
|
||||
@@ -171,7 +171,7 @@ class FloatImage {
|
||||
void Resize(double scale);
|
||||
|
||||
protected:
|
||||
- OpenImageIO::ImageBuf image_;
|
||||
+ OIIO_NAMESPACE::ImageBuf image_;
|
||||
};
|
||||
} // namespace theia
|
||||
|
||||
diff --git a/src/theia/image/image_test.cc b/src/theia/image/image_test.cc
|
||||
index 894dc30..340488d 100644
|
||||
--- a/src/theia/image/image_test.cc
|
||||
+++ b/src/theia/image/image_test.cc
|
||||
@@ -53,11 +53,11 @@ RandomNumberGenerator rng(51);
|
||||
std::string img_filename = THEIA_DATA_DIR + std::string("/") + FLAGS_test_img;
|
||||
|
||||
#define ASSERT_IMG_EQ(oiio_img, theia_img, rows, cols) \
|
||||
- oiio_img.read(0, 0, true, OpenImageIO::TypeDesc::FLOAT); \
|
||||
+ oiio_img.read(0, 0, true, OIIO_NAMESPACE::TypeDesc::FLOAT); \
|
||||
ASSERT_EQ(oiio_img.oriented_width(), theia_img.Cols()); \
|
||||
ASSERT_EQ(oiio_img.oriented_height(), theia_img.Rows()); \
|
||||
ASSERT_EQ(oiio_img.nchannels(), theia_img.Channels()); \
|
||||
- OpenImageIO::ImageBuf::ConstIterator<float> it(oiio_img); \
|
||||
+ OIIO_NAMESPACE::ImageBuf::ConstIterator<float> it(oiio_img); \
|
||||
for (; !it.done(); ++it) { \
|
||||
for (int c = 0; c < oiio_img.nchannels(); c++) { \
|
||||
ASSERT_EQ(it[c], theia_img.GetXY(it.x(), it.y(), c)); \
|
||||
@@ -89,7 +89,7 @@ float Interpolate(const FloatImage& image,
|
||||
|
||||
// Test that inputting the old fashioned way is the same as through our class.
|
||||
TEST(Image, RGBInput) {
|
||||
- OpenImageIO::ImageBuf oiio_img(img_filename.c_str());
|
||||
+ OIIO_NAMESPACE::ImageBuf oiio_img(img_filename.c_str());
|
||||
oiio_img.read();
|
||||
FloatImage theia_img(img_filename);
|
||||
|
||||
@@ -102,7 +102,7 @@ TEST(Image, RGBInput) {
|
||||
|
||||
// Test that width and height methods work.
|
||||
TEST(Image, RGBColsRows) {
|
||||
- OpenImageIO::ImageBuf oiio_img(img_filename.c_str());
|
||||
+ OIIO_NAMESPACE::ImageBuf oiio_img(img_filename.c_str());
|
||||
FloatImage theia_img(img_filename);
|
||||
|
||||
int true_height = oiio_img.oriented_height();
|
||||
@@ -114,10 +114,10 @@ TEST(Image, RGBColsRows) {
|
||||
|
||||
// Test that inputting the old fashioned way is the same as through our class.
|
||||
TEST(Image, ConvertToGrayscaleImage) {
|
||||
- OpenImageIO::ImageBuf oiio_img(img_filename.c_str());
|
||||
- OpenImageIO::ImageBuf gray_img;
|
||||
+ OIIO_NAMESPACE::ImageBuf oiio_img(img_filename.c_str());
|
||||
+ OIIO_NAMESPACE::ImageBuf gray_img;
|
||||
const float luma_weights[3] = {.2126, .7152, .0722};
|
||||
- OpenImageIO::ImageBufAlgo::channel_sum(gray_img, oiio_img, luma_weights);
|
||||
+ OIIO_NAMESPACE::ImageBufAlgo::channel_sum(gray_img, oiio_img, luma_weights);
|
||||
|
||||
FloatImage theia_img(img_filename);
|
||||
theia_img.ConvertToGrayscaleImage();
|
||||
@@ -131,10 +131,10 @@ TEST(Image, ConvertToGrayscaleImage) {
|
||||
}
|
||||
|
||||
TEST(Image, ConvertToRGBImage) {
|
||||
- OpenImageIO::ImageBuf oiio_img(img_filename.c_str());
|
||||
- OpenImageIO::ImageBuf gray_img;
|
||||
+ OIIO_NAMESPACE::ImageBuf oiio_img(img_filename.c_str());
|
||||
+ OIIO_NAMESPACE::ImageBuf gray_img;
|
||||
const float luma_weights[3] = {.2126, .7152, .0722};
|
||||
- OpenImageIO::ImageBufAlgo::channel_sum(gray_img, oiio_img, luma_weights);
|
||||
+ OIIO_NAMESPACE::ImageBufAlgo::channel_sum(gray_img, oiio_img, luma_weights);
|
||||
|
||||
// This should result in an image with the grayscale image copied in each
|
||||
// channel.
|
||||
@@ -148,7 +148,7 @@ TEST(Image, ConvertToRGBImage) {
|
||||
|
||||
// Check that all channels have equal value and that the value is equal to the
|
||||
// grayscale image.
|
||||
- for (OpenImageIO::ImageBuf::ConstIterator<float> it(gray_img);
|
||||
+ for (OIIO_NAMESPACE::ImageBuf::ConstIterator<float> it(gray_img);
|
||||
!it.done();
|
||||
++it) {
|
||||
ASSERT_EQ(it[0], rgb_img.GetXY(it.x(), it.y(), 0));
|
||||
diff --git a/src/theia/sfm/exif_reader.cc b/src/theia/sfm/exif_reader.cc
|
||||
index 48c049a..fea884d 100644
|
||||
--- a/src/theia/sfm/exif_reader.cc
|
||||
+++ b/src/theia/sfm/exif_reader.cc
|
||||
@@ -127,8 +127,8 @@ bool ExifReader::ExtractEXIFMetadata(
|
||||
CameraIntrinsicsPrior* camera_intrinsics_prior) const {
|
||||
CHECK_NOTNULL(camera_intrinsics_prior);
|
||||
|
||||
- OpenImageIO::ImageBuf image(image_file);
|
||||
- OpenImageIO::ImageSpec image_spec = image.spec();
|
||||
+ OIIO_NAMESPACE::ImageBuf image(image_file);
|
||||
+ OIIO_NAMESPACE::ImageSpec image_spec = image.spec();
|
||||
|
||||
// Set the image dimensions.
|
||||
camera_intrinsics_prior->image_width = image_spec.width;
|
||||
@@ -154,7 +154,7 @@ bool ExifReader::ExtractEXIFMetadata(
|
||||
camera_intrinsics_prior->focal_length.is_set = true;
|
||||
|
||||
// Set GPS latitude.
|
||||
- const OpenImageIO::ImageIOParameter* latitude =
|
||||
+ const OIIO_NAMESPACE::ImageIOParameter* latitude =
|
||||
image_spec.find_attribute("GPS:Latitude");
|
||||
if (latitude != nullptr) {
|
||||
camera_intrinsics_prior->latitude.is_set = true;
|
||||
@@ -173,7 +173,7 @@ bool ExifReader::ExtractEXIFMetadata(
|
||||
}
|
||||
|
||||
// Set GPS longitude.
|
||||
- const OpenImageIO::ImageIOParameter* longitude =
|
||||
+ const OIIO_NAMESPACE::ImageIOParameter* longitude =
|
||||
image_spec.find_attribute("GPS:Longitude");
|
||||
if (longitude != nullptr) {
|
||||
camera_intrinsics_prior->longitude.is_set = true;
|
||||
@@ -193,7 +193,7 @@ bool ExifReader::ExtractEXIFMetadata(
|
||||
|
||||
|
||||
// Set GSP altitude.
|
||||
- const OpenImageIO::ImageIOParameter* altitude =
|
||||
+ const OIIO_NAMESPACE::ImageIOParameter* altitude =
|
||||
image_spec.find_attribute("GPS:Altitude");
|
||||
if (altitude != nullptr) {
|
||||
camera_intrinsics_prior->altitude.is_set = true;
|
||||
@@ -205,7 +205,7 @@ bool ExifReader::ExtractEXIFMetadata(
|
||||
}
|
||||
|
||||
bool ExifReader::SetFocalLengthFromExif(
|
||||
- const OpenImageIO::ImageSpec& image_spec,
|
||||
+ const OIIO_NAMESPACE::ImageSpec& image_spec,
|
||||
CameraIntrinsicsPrior* camera_intrinsics_prior) const {
|
||||
static const float kMinFocalLength = 1e-2;
|
||||
|
||||
@@ -268,7 +268,7 @@ bool ExifReader::SetFocalLengthFromExif(
|
||||
}
|
||||
|
||||
bool ExifReader::SetFocalLengthFromSensorDatabase(
|
||||
- const OpenImageIO::ImageSpec& image_spec,
|
||||
+ const OIIO_NAMESPACE::ImageSpec& image_spec,
|
||||
CameraIntrinsicsPrior* camera_intrinsics_prior) const {
|
||||
const int max_image_dimension = std::max(image_spec.width, image_spec.height);
|
||||
const float exif_focal_length =
|
||||
diff --git a/src/theia/sfm/exif_reader.h b/src/theia/sfm/exif_reader.h
|
||||
index 3049cf4..d9d3108 100644
|
||||
--- a/src/theia/sfm/exif_reader.h
|
||||
+++ b/src/theia/sfm/exif_reader.h
|
||||
@@ -74,13 +74,13 @@ class ExifReader {
|
||||
// Sets the focal length from the focal plane resolution. Returns true if a
|
||||
// valid focal length is found and false otherwise.
|
||||
bool SetFocalLengthFromExif(
|
||||
- const OpenImageIO::ImageSpec& image_spec,
|
||||
+ const OIIO_NAMESPACE::ImageSpec& image_spec,
|
||||
CameraIntrinsicsPrior* camera_intrinsics_prior) const;
|
||||
|
||||
// Sets the focal length from a look up in the sensor width database. Returns
|
||||
// true if a valid focal length is found and false otherwise.
|
||||
bool SetFocalLengthFromSensorDatabase(
|
||||
- const OpenImageIO::ImageSpec& image_spec,
|
||||
+ const OIIO_NAMESPACE::ImageSpec& image_spec,
|
||||
CameraIntrinsicsPrior* camera_intrinsics_prior) const;
|
||||
|
||||
std::unordered_map<std::string, double> sensor_width_database_;
|
||||
diff --git a/src/theia/sfm/undistort_image.cc b/src/theia/sfm/undistort_image.cc
|
||||
index 95a061d..ae0690e 100644
|
||||
--- a/src/theia/sfm/undistort_image.cc
|
||||
+++ b/src/theia/sfm/undistort_image.cc
|
||||
@@ -160,9 +160,9 @@ void RemoveImageLensDistortion(const Camera& distorted_camera,
|
||||
// For each pixel in the undistorted image, find the coordinate in the
|
||||
// distorted image and set the pixel color accordingly.
|
||||
const int num_channels = distorted_image.Channels();
|
||||
- OpenImageIO::ImageBuf& undistorted_img =
|
||||
+ OIIO_NAMESPACE::ImageBuf& undistorted_img =
|
||||
undistorted_image->GetOpenImageIOImageBuf();
|
||||
- OpenImageIO::ImageBuf::Iterator<float> undistorted_it(undistorted_img);
|
||||
+ OIIO_NAMESPACE::ImageBuf::Iterator<float> undistorted_it(undistorted_img);
|
||||
for (; !undistorted_it.done(); ++undistorted_it) {
|
||||
Eigen::Vector2d image_point(undistorted_it.x() + 0.5,
|
||||
undistorted_it.y() + 0.5);
|
@ -1,49 +0,0 @@
|
||||
diff --git a/libraries/vlfeat/CMakeLists.txt b/libraries/vlfeat/CMakeLists.txt
|
||||
index d248bcf..24469c9 100644
|
||||
--- a/libraries/vlfeat/CMakeLists.txt
|
||||
+++ b/libraries/vlfeat/CMakeLists.txt
|
||||
@@ -16,11 +16,11 @@ set(vl_sources
|
||||
set_source_files_properties(${vl_sources} PROPERTIES LANGUAGE C)
|
||||
|
||||
if (MSVC)
|
||||
- add_definitions(-DVL_BUILD_DLL)
|
||||
+ #add_definitions(-DVL_BUILD_DLL)
|
||||
add_definitions(-DVL_DISABLE_SSE2)
|
||||
endif (MSVC)
|
||||
|
||||
-add_library(vlfeat SHARED ${vl_sources})
|
||||
+add_library(vlfeat ${vl_sources})
|
||||
install(TARGETS vlfeat
|
||||
EXPORT TheiaExport
|
||||
RUNTIME DESTINATION bin
|
||||
diff --git a/libraries/vlfeat/vl/host.h b/libraries/vlfeat/vl/host.h
|
||||
index 4fdb86c..01c1134 100644
|
||||
--- a/libraries/vlfeat/vl/host.h
|
||||
+++ b/libraries/vlfeat/vl/host.h
|
||||
@@ -316,18 +316,24 @@ defined(__DOXYGEN__)
|
||||
# define snprintf _snprintf
|
||||
# define isnan _isnan
|
||||
#endif
|
||||
-# ifdef VL_BUILD_DLL
|
||||
+# if defined(VL_BUILD_DLL)
|
||||
# ifdef __cplusplus
|
||||
# define VL_EXPORT extern "C" __declspec(dllexport)
|
||||
# else
|
||||
# define VL_EXPORT extern __declspec(dllexport)
|
||||
# endif
|
||||
-# else
|
||||
+# elif defined(VL_DLL)
|
||||
# ifdef __cplusplus
|
||||
# define VL_EXPORT extern "C" __declspec(dllimport)
|
||||
# else
|
||||
# define VL_EXPORT extern __declspec(dllimport)
|
||||
# endif
|
||||
+# else
|
||||
+# ifdef __cplusplus
|
||||
+# define VL_EXPORT extern "C"
|
||||
+# else
|
||||
+# define VL_EXPORT extern
|
||||
+# endif
|
||||
# endif
|
||||
#endif
|
||||
|
@ -2,31 +2,23 @@ include(vcpkg_common_functions)
|
||||
|
||||
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
||||
|
||||
if(VCPKG_TARGET_ARCHIECTURE STREQUAL "x86")
|
||||
message(FATAL_ERROR "theia requires ceres[suitesparse] which depends on suitesparse which depends on openblas which is unavailable on x86.")
|
||||
endif()
|
||||
|
||||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO sweeneychris/TheiaSfM
|
||||
REF v0.8
|
||||
SHA512 2f620389c415badec36f4b44be0378fc62761dd6b2ee4cd7033b13573c372f098e248553575fb2cceb757b1ca00e86a11c67e03b6077e0a4b0f8797065746312
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
fix-external-dependencies.patch
|
||||
)
|
||||
|
||||
vcpkg_apply_patches(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PATCHES
|
||||
${CMAKE_CURRENT_LIST_DIR}/fix-cmakelists.patch
|
||||
${CMAKE_CURRENT_LIST_DIR}/fix-vlfeat-static.patch
|
||||
${CMAKE_CURRENT_LIST_DIR}/fix-glog-error.patch
|
||||
${CMAKE_CURRENT_LIST_DIR}/fix-find-suitesparse.patch
|
||||
${CMAKE_CURRENT_LIST_DIR}/fix-oiio.patch
|
||||
)
|
||||
file(REMOVE ${SOURCE_PATH}/cmake/FindSuiteSparse.cmake)
|
||||
file(REMOVE ${SOURCE_PATH}/cmake/FindGflags.cmake)
|
||||
file(REMOVE ${SOURCE_PATH}/cmake/FindGlog.cmake)
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
OPTIONS
|
||||
-DBUILD_TESTING=OFF
|
||||
-DTHEIA_USE_EXTERNAL_CEREAL=ON
|
||||
@ -34,28 +26,19 @@ vcpkg_configure_cmake(
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
|
||||
vcpkg_fixup_cmake_targets(CONFIG_PATH "CMake")
|
||||
|
||||
# Changes target search path
|
||||
file(READ ${CURRENT_PACKAGES_DIR}/share/theia/TheiaConfig.cmake THEIA_TARGETS)
|
||||
string(REPLACE "get_filename_component(CURRENT_ROOT_INSTALL_DIR\n \${THEIA_CURRENT_CONFIG_INSTALL_DIR}/../ ABSOLUTE)"
|
||||
"get_filename_component(CURRENT_ROOT_INSTALL_DIR\n \${THEIA_CURRENT_CONFIG_INSTALL_DIR}/../../ ABSOLUTE)" THEIA_TARGETS "${THEIA_TARGETS}")
|
||||
file(WRITE ${CURRENT_PACKAGES_DIR}/share/theia/TheiaConfig.cmake "${THEIA_TARGETS}")
|
||||
|
||||
vcpkg_fixup_cmake_targets()
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
# Clean
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/optimo)
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/optimo)
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/theia/libraries/akaze/cimg/cmake-modules)
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/theia/libraries/akaze/cmake)
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/theia/libraries/akaze/datasets)
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/theia/libraries/spectra/doxygen)
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/optimo)
|
||||
|
||||
# Handle copyright
|
||||
file(COPY ${SOURCE_PATH}/license.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/theia)
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/share/theia/license.txt ${CURRENT_PACKAGES_DIR}/share/theia/copyright)
|
||||
file(INSTALL ${SOURCE_PATH}/license.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/theia RENAME copyright)
|
||||
file(COPY ${SOURCE_PATH}/data/camera_sensor_database_license.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/theia)
|
||||
|
@ -14,7 +14,7 @@ vcpkg_apply_patches(
|
||||
)
|
||||
|
||||
set(ENABLE_ASSEMBLY OFF)
|
||||
if (WIN32)
|
||||
if (NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
||||
vcpkg_find_acquire_program(NASM)
|
||||
get_filename_component(NASM_EXE_PATH ${NASM} DIRECTORY)
|
||||
set(ENV{PATH} "$ENV{PATH};${NASM_EXE_PATH}")
|
||||
@ -41,9 +41,9 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
||||
|
||||
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/x265)
|
||||
|
||||
if(UNIX)
|
||||
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux" OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/bin/x265 ${CURRENT_PACKAGES_DIR}/tools/x265/x265)
|
||||
elseif(WIN32)
|
||||
elseif(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/bin/x265.exe ${CURRENT_PACKAGES_DIR}/tools/x265/x265.exe)
|
||||
endif()
|
||||
|
||||
@ -55,4 +55,4 @@ vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/x265)
|
||||
|
||||
# Handle copyright
|
||||
file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/x265)
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/share/x265/COPYING ${CURRENT_PACKAGES_DIR}/share/x265/copyright)
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/share/x265/COPYING ${CURRENT_PACKAGES_DIR}/share/x265/copyright)
|
||||
|
@ -23,11 +23,11 @@ vcpkg_install_cmake()
|
||||
vcpkg_fixup_cmake_targets(CONFIG_PATH "lib/zxing/cmake" TARGET_PATH share/zxing)
|
||||
|
||||
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/zxing)
|
||||
if (WIN32)
|
||||
if (NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
||||
file(COPY ${CURRENT_PACKAGES_DIR}/bin/zxing.exe DESTINATION ${CURRENT_PACKAGES_DIR}/tools/zxing)
|
||||
else(WIN32)
|
||||
else()
|
||||
file(COPY ${CURRENT_PACKAGES_DIR}/bin/zxing DESTINATION ${CURRENT_PACKAGES_DIR}/tools/zxing)
|
||||
endif(WIN32)
|
||||
endif()
|
||||
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/zxing)
|
||||
|
||||
vcpkg_copy_pdbs()
|
||||
|
Loading…
x
Reference in New Issue
Block a user