From e984f5c79a40f61c713c1bee79d4ec69e8608f6b Mon Sep 17 00:00:00 2001 From: Stefano Sinigardi Date: Thu, 9 May 2019 14:43:27 +0200 Subject: [PATCH 01/34] [openexr,openimageio,suitesparse,theia] updates for non-win32 --- ports/openexr/CONTROL | 2 +- ...x_clang_not_setting_modern_cplusplus.patch | 13 ++++++ ports/openexr/portfile.cmake | 4 +- ports/openimageio/portfile.cmake | 3 +- .../openimageio/remove_wrong_dependency.patch | 23 ++++++++++ ports/suitesparse/CONTROL | 4 +- ports/suitesparse/portfile.cmake | 42 +++++++------------ ports/theia/CONTROL | 8 ++-- ports/theia/disable_applications.patch | 13 ++++++ ports/theia/portfile.cmake | 34 +++++++-------- 10 files changed, 93 insertions(+), 53 deletions(-) create mode 100644 ports/openexr/fix_clang_not_setting_modern_cplusplus.patch create mode 100644 ports/openimageio/remove_wrong_dependency.patch create mode 100644 ports/theia/disable_applications.patch diff --git a/ports/openexr/CONTROL b/ports/openexr/CONTROL index ea85a082f1e6fb..5fd21f6daa080d 100644 --- a/ports/openexr/CONTROL +++ b/ports/openexr/CONTROL @@ -1,4 +1,4 @@ Source: openexr -Version: 2.3.0-2 +Version: 2.3.0-3 Description: OpenEXR is a high dynamic-range (HDR) image file format developed by Industrial Light & Magic for use in computer imaging applications Build-Depends: zlib diff --git a/ports/openexr/fix_clang_not_setting_modern_cplusplus.patch b/ports/openexr/fix_clang_not_setting_modern_cplusplus.patch new file mode 100644 index 00000000000000..05e86b50c6e4ef --- /dev/null +++ b/ports/openexr/fix_clang_not_setting_modern_cplusplus.patch @@ -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 diff --git a/ports/openexr/portfile.cmake b/ports/openexr/portfile.cmake index f06ee4841e7c8f..d2524b5170ba26 100644 --- a/ports/openexr/portfile.cmake +++ b/ports/openexr/portfile.cmake @@ -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} diff --git a/ports/openimageio/portfile.cmake b/ports/openimageio/portfile.cmake index 93b04e6275c2f5..79027397572cf7 100644 --- a/ports/openimageio/portfile.cmake +++ b/ports/openimageio/portfile.cmake @@ -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") diff --git a/ports/openimageio/remove_wrong_dependency.patch b/ports/openimageio/remove_wrong_dependency.patch new file mode 100644 index 00000000000000..dabf47b1ecbe72 --- /dev/null +++ b/ports/openimageio/remove_wrong_dependency.patch @@ -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}) diff --git a/ports/suitesparse/CONTROL b/ports/suitesparse/CONTROL index 67b72bb49406db..770c509d47b167 100644 --- a/ports/suitesparse/CONTROL +++ b/ports/suitesparse/CONTROL @@ -1,6 +1,6 @@ Source: suitesparse -Version: 5.1.2-1 -Build-Depends: clapack (!osx) +Version: 5.4.0 +Build-Depends: clapack Description: algebra library Feature: metis diff --git a/ports/suitesparse/portfile.cmake b/ports/suitesparse/portfile.cmake index c823d0d93c746a..09212a7aab85f3 100644 --- a/ports/suitesparse/portfile.cmake +++ b/ports/suitesparse/portfile.cmake @@ -2,33 +2,30 @@ 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 SuiteSparse-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 + 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} + PATCHES + fix-install-suitesparse.patch ) -#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} - PATCHES - remove-debug-postfix.patch +vcpkg_from_github( + OUT_SOURCE_PATH SUITESPARSEWIN_SOURCE_PATH + REPO jlblancoc/suitesparse-metis-for-windows + REF ${SUITESPARSEWIN_VER} + SHA512 2859d534200ab9b76fca1530eae5de2f9328aa867c727dbc83a96c6f16e1f87e70123fb2decbb84531d75dac58b6f0ce7323e48c57aeede324fd9a1f77ba74c6 + HEAD_REF master ) set(USE_VCPKG_METIS OFF) @@ -44,19 +41,12 @@ else() 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 ${SOURCE_PATH} PREFER_NINJA OPTIONS - -DBUILD_METIS=OFF - -DUSE_VCPKG_METIS=${USE_VCPKG_METIS} + -DBUILD_METIS=OFF #Disable the option to build metis from source + -DUSE_VCPKG_METIS=${USE_VCPKG_METIS} #Force using vcpckg metis library -DMETIS_SOURCE_DIR=${CURRENT_INSTALLED_DIR} -DSUITESPARSE_USE_CUSTOM_BLAS_LAPACK_LIBS=ON OPTIONS_DEBUG diff --git a/ports/theia/CONTROL b/ports/theia/CONTROL index 7cfd81e6026f62..e05e4e884e1d0b 100644 --- a/ports/theia/CONTROL +++ b/ports/theia/CONTROL @@ -1,4 +1,4 @@ -Source: theia -Version: 0.7-d15154a-4 -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.7-d15154a-5 +Build-Depends: flann, cereal, ceres[suitesparse] (!x86), openimageio, glew, freeglut (!osx) +Description: An open source library for multiview geometry and structure from motion diff --git a/ports/theia/disable_applications.patch b/ports/theia/disable_applications.patch new file mode 100644 index 00000000000000..9dc1bdc5c98335 --- /dev/null +++ b/ports/theia/disable_applications.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 09857e9..81cbd0e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -290,7 +290,7 @@ include(OptimizeTheiaCompilerFlags) + optimizetheiacompilerflags() + + add_subdirectory(src/theia) +-add_subdirectory(applications) ++#add_subdirectory(applications) + + if (BUILD_DOCUMENTATION) + message("-- Documentation building is enabled") diff --git a/ports/theia/portfile.cmake b/ports/theia/portfile.cmake index 18f8490b1e3cf8..be6a951fd1cd2f 100644 --- a/ports/theia/portfile.cmake +++ b/ports/theia/portfile.cmake @@ -3,7 +3,7 @@ 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.") + message(FATAL_ERROR "${PORT} requires ceres[suitesparse] which depends on suitesparse which depends on openblas which is unavailable on x86.") endif() @@ -13,16 +13,13 @@ vcpkg_from_github( REF d15154a6c30ea48e7d135be126e2936802e476ad SHA512 aaf6e9737d04499f0ffd453952380f2e1aa3aab2a75487d6806bfab60aa972719d7349730eab3d1b37088e99cf6c9076ae1cdea276f48532698226c69ac48977 HEAD_REF master -) - -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 + fix-cmakelists.patch + fix-vlfeat-static.patch + fix-glog-error.patch + fix-find-suitesparse.patch + fix-oiio.patch + disable_applications.patch ) vcpkg_configure_cmake( @@ -35,16 +32,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}") +if(WIN32) + vcpkg_fixup_cmake_targets(CONFIG_PATH "CMake") +endif() vcpkg_copy_pdbs() +if(WIN32) + 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}/../" + "get_filename_component(CURRENT_ROOT_INSTALL_DIR\n \${THEIA_CURRENT_CONFIG_INSTALL_DIR}/../../" THEIA_TARGETS "${THEIA_TARGETS}") + file(WRITE ${CURRENT_PACKAGES_DIR}/share/theia/TheiaConfig.cmake "${THEIA_TARGETS}") +endif() + # Clean file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/optimo) From c574b5d4bbbd7d47fe5280760ee37866a46243d5 Mon Sep 17 00:00:00 2001 From: Stefano Sinigardi Date: Mon, 13 May 2019 23:38:28 +0200 Subject: [PATCH 02/34] [theia] use only valid cmake symbols --- ports/theia/portfile.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/theia/portfile.cmake b/ports/theia/portfile.cmake index be6a951fd1cd2f..15aa8e44d82b55 100644 --- a/ports/theia/portfile.cmake +++ b/ports/theia/portfile.cmake @@ -32,13 +32,13 @@ 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") endif() vcpkg_copy_pdbs() -if(WIN32) +if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") 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}/../" "get_filename_component(CURRENT_ROOT_INSTALL_DIR\n \${THEIA_CURRENT_CONFIG_INSTALL_DIR}/../../" THEIA_TARGETS "${THEIA_TARGETS}") From 251f9bf42949b702723743a66a05d64ecb177ed5 Mon Sep 17 00:00:00 2001 From: Victor Romero Date: Mon, 13 May 2019 17:39:55 -0700 Subject: [PATCH 03/34] [suitesparse] Fix build --- ports/suitesparse/CONTROL | 2 +- ports/suitesparse/portfile.cmake | 43 +++++++++++++++++++------------- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/ports/suitesparse/CONTROL b/ports/suitesparse/CONTROL index 922fab8cdd856a..5182a90cd3706f 100644 --- a/ports/suitesparse/CONTROL +++ b/ports/suitesparse/CONTROL @@ -1,5 +1,5 @@ Source: suitesparse -Version: 5.4.0 +Version: 5.4.0-1 Build-Depends: clapack (!osx) Description: algebra library diff --git a/ports/suitesparse/portfile.cmake b/ports/suitesparse/portfile.cmake index 0e69a79863a7e8..ee73b94fb04963 100644 --- a/ports/suitesparse/portfile.cmake +++ b/ports/suitesparse/portfile.cmake @@ -2,14 +2,12 @@ include(vcpkg_common_functions) vcpkg_check_linkage(ONLY_STATIC_LIBRARY) -set(SUITESPARSE_VER SuiteSparse-5.4.0) +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) vcpkg_download_distfile(SUITESPARSE - URLS "http://faculty.cse.tamu.edu/davis/SuiteSparse/${SUITESPARSE_VER}.tar.gz" - FILENAME "${SUITESPARSE_VER}.tar.gz" + URLS "http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-${SUITESPARSE_VER}.tar.gz" + FILENAME "SuiteSparse-${SUITESPARSE_VER}.tar.gz" SHA512 8328bcc2ef5eb03febf91b9c71159f091ff405c1ba7522e53714120fcf857ceab2d2ecf8bf9a2e1fc45e1a934665a341e3a47f954f87b59934f4fce6164775d6 ) @@ -23,11 +21,20 @@ vcpkg_extract_source_archive_ex( vcpkg_from_github( OUT_SOURCE_PATH SUITESPARSEWIN_SOURCE_PATH REPO jlblancoc/suitesparse-metis-for-windows - REF ${SUITESPARSEWIN_VER} - SHA512 2859d534200ab9b76fca1530eae5de2f9328aa867c727dbc83a96c6f16e1f87e70123fb2decbb84531d75dac58b6f0ce7323e48c57aeede324fd9a1f77ba74c6 + REF v${SUITESPARSEWIN_VER} + SHA512 35a2563d6e33ebe8157f8d023167abd8d2512e2a627b8dbea798c59afefc56b8f01c7d10553529b03a7b4759e200ca82bb26ebce5cefce6983ffb057a8622162 HEAD_REF master ) +# 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) @@ -42,33 +49,33 @@ else() endif() vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} + SOURCE_PATH ${SUITESPARSEWIN_SOURCE_PATH} PREFER_NINJA OPTIONS -DBUILD_METIS=OFF #Disable the option to build metis from source -DUSE_VCPKG_METIS=${USE_VCPKG_METIS} #Force using vcpckg metis library - -DMETIS_SOURCE_DIR=${CURRENT_INSTALLED_DIR} + -DMETIS_SOURCE_DIR="${CURRENT_INSTALLED_DIR}" -DSUITESPARSE_USE_CUSTOM_BLAS_LAPACK_LIBS=ON 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" + -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}" 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}" + -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}" ) 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) From 792fa3fb97dd08aa94cf47e323e8c51425d3c70d Mon Sep 17 00:00:00 2001 From: Stefano Sinigardi Date: Tue, 14 May 2019 15:36:23 +0200 Subject: [PATCH 04/34] [lapack] still not properly integrating with other ports --- ...003_remove_unnecessary_cmake_modules.patch | 949 ----------- ...arget.patch => 0003_use_glog_target.patch} | 0 ...h => 0004_fix_exported_ceres_config.patch} | 0 ports/ceres/CONTROL | 1 - ports/ceres/portfile.cmake | 11 +- ports/clapack/fix-lack-library.patch | 18 - ports/clapack/fix-linux-build.patch | 46 - ports/clapack/lapack.def | 1453 ----------------- ports/clapack/link-to-math-lib.patch | 12 - ports/clapack/portfile.cmake | 35 +- ports/clapack/remove_internal_blas.patch | 77 + .../use-other-blas-and-install-include.patch | 103 -- ports/openblas/CONTROL | 2 +- ports/openblas/portfile.cmake | 3 +- ports/openssl-windows/portfile.cmake | 50 +- ports/suitesparse/lapack_module.patch | 16 + ports/suitesparse/portfile.cmake | 12 +- ports/suitesparse/remove-debug-postfix.patch | 11 - 18 files changed, 153 insertions(+), 2646 deletions(-) delete mode 100644 ports/ceres/0003_remove_unnecessary_cmake_modules.patch rename ports/ceres/{0004_use_glog_target.patch => 0003_use_glog_target.patch} (100%) rename ports/ceres/{0005_fix_exported_ceres_config.patch => 0004_fix_exported_ceres_config.patch} (100%) delete mode 100644 ports/clapack/fix-lack-library.patch delete mode 100644 ports/clapack/fix-linux-build.patch delete mode 100644 ports/clapack/lapack.def delete mode 100644 ports/clapack/link-to-math-lib.patch create mode 100644 ports/clapack/remove_internal_blas.patch delete mode 100644 ports/clapack/use-other-blas-and-install-include.patch create mode 100644 ports/suitesparse/lapack_module.patch delete mode 100644 ports/suitesparse/remove-debug-postfix.patch diff --git a/ports/ceres/0003_remove_unnecessary_cmake_modules.patch b/ports/ceres/0003_remove_unnecessary_cmake_modules.patch deleted file mode 100644 index 698d410b996d19..00000000000000 --- a/ports/ceres/0003_remove_unnecessary_cmake_modules.patch +++ /dev/null @@ -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/] 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 _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 -- 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 -- 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/] 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 _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 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/ 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) diff --git a/ports/ceres/0004_use_glog_target.patch b/ports/ceres/0003_use_glog_target.patch similarity index 100% rename from ports/ceres/0004_use_glog_target.patch rename to ports/ceres/0003_use_glog_target.patch diff --git a/ports/ceres/0005_fix_exported_ceres_config.patch b/ports/ceres/0004_fix_exported_ceres_config.patch similarity index 100% rename from ports/ceres/0005_fix_exported_ceres_config.patch rename to ports/ceres/0004_fix_exported_ceres_config.patch diff --git a/ports/ceres/CONTROL b/ports/ceres/CONTROL index 3c890ff533d30d..8ec022fd3baac6 100644 --- a/ports/ceres/CONTROL +++ b/ports/ceres/CONTROL @@ -1,6 +1,5 @@ Source: ceres Version: 1.14.0-3 -# eigen is always required by CMake, even if it isn't used. Build-Depends: glog, eigen3 Description: non-linear optimization package diff --git a/ports/ceres/portfile.cmake b/ports/ceres/portfile.cmake index 1c52b2d931f540..92a46d0aee112a 100644 --- a/ports/ceres/portfile.cmake +++ b/ports/ceres/portfile.cmake @@ -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) diff --git a/ports/clapack/fix-lack-library.patch b/ports/clapack/fix-lack-library.patch deleted file mode 100644 index 8e9bd5178ac059..00000000000000 --- a/ports/clapack/fix-lack-library.patch +++ /dev/null @@ -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) -+ diff --git a/ports/clapack/fix-linux-build.patch b/ports/clapack/fix-linux-build.patch deleted file mode 100644 index 230fa9bf611495..00000000000000 --- a/ports/clapack/fix-linux-build.patch +++ /dev/null @@ -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) diff --git a/ports/clapack/lapack.def b/ports/clapack/lapack.def deleted file mode 100644 index e2070d99b483f4..00000000000000 --- a/ports/clapack/lapack.def +++ /dev/null @@ -1,1453 +0,0 @@ -EXPORTS -sgbbrd_ -sgbcon_ -sgbequ_ -sgbrfs_ -sgbsv_ -sgbsvx_ -sgbtf2_ -sgbtrf_ -sgbtrs_ -sgebak_ -sgebal_ -sgebd2_ -sgebrd_ -sgecon_ -sgeequ_ -sgees_ -sgeesx_ -sgeev_ -sgeevx_ -sgegs_ -sgegv_ -sgehd2_ -sgehrd_ -sgelq2_ -sgelqf_ -sgels_ -sgelsd_ -sgelss_ -sgelsx_ -sgelsy_ -sgeql2_ -sgeqlf_ -sgeqp3_ -sgeqpf_ -sgeqr2_ -sgeqrf_ -sgerfs_ -sgerq2_ -sgerqf_ -sgesc2_ -sgesdd_ -sgesv_ -sgesvd_ -sgesvx_ -sgetc2_ -sgetf2_ -sgetrf_ -sgetri_ -sgetrs_ -sggbak_ -sggbal_ -sgges_ -sggesx_ -sggev_ -sggevx_ -sggglm_ -sgghrd_ -sgglse_ -sggqrf_ -sggrqf_ -sggsvd_ -sggsvp_ -sgtcon_ -sgtrfs_ -sgtsv_ -sgtsvx_ -sgttrf_ -sgttrs_ -sgtts2_ -shgeqz_ -shsein_ -shseqr_ -slabrd_ -slacon_ -slacn2_ -slaein_ -slaexc_ -slag2_ -slags2_ -slagtm_ -slagv2_ -slahqr_ -slahrd_ -slahr2_ -slaic1_ -slaln2_ -slals0_ -slalsa_ -slalsd_ -slangb_ -slange_ -slangt_ -slanhs_ -slansb_ -slansp_ -slansy_ -slantb_ -slantp_ -slantr_ -slanv2_ -slapll_ -slapmt_ -slaqgb_ -slaqge_ -slaqp2_ -slaqps_ -slaqsb_ -slaqsp_ -slaqsy_ -slaqr0_ -slaqr1_ -slaqr2_ -slaqr3_ -slaqr4_ -slaqr5_ -slaqtr_ -slar1v_ -slar2v_ -ilaslr_ -ilaslc_ -slarf_ -slarfb_ -slarfg_ -slarft_ -slarfx_ -slargv_ -slarrv_ -slartv_ -slarfp_ -slarz_ -slarzb_ -slarzt_ -slaswp_ -slasy2_ -slasyf_ -slatbs_ -slatdf_ -slatps_ -slatrd_ -slatrs_ -slatrz_ -slatzm_ -slauu2_ -slauum_ -sopgtr_ -sopmtr_ -sorg2l_ -sorg2r_ -sorgbr_ -sorghr_ -sorgl2_ -sorglq_ -sorgql_ -sorgqr_ -sorgr2_ -sorgrq_ -sorgtr_ -sorm2l_ -sorm2r_ -sormbr_ -sormhr_ -sorml2_ -sormlq_ -sormql_ -sormqr_ -sormr2_ -sormr3_ -sormrq_ -sormrz_ -sormtr_ -spbcon_ -spbequ_ -spbrfs_ -spbstf_ -spbsv_ -spbsvx_ -spbtf2_ -spbtrf_ -spbtrs_ -spocon_ -spoequ_ -sporfs_ -sposv_ -sposvx_ -spotf2_ -spotrf_ -spotri_ -spotrs_ -spstrf_ -spstf2_ -sppcon_ -sppequ_ -spprfs_ -sppsv_ -sppsvx_ -spptrf_ -spptri_ -spptrs_ -sptcon_ -spteqr_ -sptrfs_ -sptsv_ -sptsvx_ -spttrs_ -sptts2_ -srscl_ -ssbev_ -ssbevd_ -ssbevx_ -ssbgst_ -ssbgv_ -ssbgvd_ -ssbgvx_ -ssbtrd_ -sspcon_ -sspev_ -sspevd_ -sspevx_ -sspgst_ -sspgv_ -sspgvd_ -sspgvx_ -ssprfs_ -sspsv_ -sspsvx_ -ssptrd_ -ssptrf_ -ssptri_ -ssptrs_ -sstegr_ -sstein_ -sstev_ -sstevd_ -sstevr_ -sstevx_ -ssycon_ -ssyev_ -ssyevd_ -ssyevr_ -ssyevx_ -ssygs2_ -ssygst_ -ssygv_ -ssygvd_ -ssygvx_ -ssyrfs_ -ssysv_ -ssysvx_ -ssytd2_ -ssytf2_ -ssytrd_ -ssytrf_ -ssytri_ -ssytrs_ -stbcon_ -stbrfs_ -stbtrs_ -stgevc_ -stgex2_ -stgexc_ -stgsen_ -stgsja_ -stgsna_ -stgsy2_ -stgsyl_ -stpcon_ -stprfs_ -stptri_ -stptrs_ -strcon_ -strevc_ -strexc_ -strrfs_ -strsen_ -strsna_ -strsyl_ -strti2_ -strtri_ -strtrs_ -stzrqf_ -stzrzf_ -sstemr_ -slansf_ -spftrf_ -spftri_ -spftrs_ -ssfrk_ -stfsm_ -stftri_ -stfttp_ -stfttr_ -stpttf_ -stpttr_ -strttf_ -strttp_ -sgejsv_ -sgesvj_ -sgsvj0_ -sgsvj1_ -sgeequb_ -ssyequb_ -spoequb_ -sgbequb_ -dgbbrd_ -dgbcon_ -dgbequ_ -dgbrfs_ -dgbsv_ -dgbsvx_ -dgbtf2_ -dgbtrf_ -dgbtrs_ -dgebak_ -dgebal_ -dgebd2_ -dgebrd_ -dgecon_ -dgeequ_ -dgees_ -dgeesx_ -dgeev_ -dgeevx_ -dgegs_ -dgegv_ -dgehd2_ -dgehrd_ -dgelq2_ -dgelqf_ -dgels_ -dgelsd_ -dgelss_ -dgelsx_ -dgelsy_ -dgeql2_ -dgeqlf_ -dgeqp3_ -dgeqpf_ -dgeqr2_ -dgeqrf_ -dgerfs_ -dgerq2_ -dgerqf_ -dgesc2_ -dgesdd_ -dgesv_ -dgesvd_ -dgesvx_ -dgetc2_ -dgetf2_ -dgetrf_ -dgetri_ -dgetrs_ -dggbak_ -dggbal_ -dgges_ -dggesx_ -dggev_ -dggevx_ -dggglm_ -dgghrd_ -dgglse_ -dggqrf_ -dggrqf_ -dggsvd_ -dggsvp_ -dgtcon_ -dgtrfs_ -dgtsv_ -dgtsvx_ -dgttrf_ -dgttrs_ -dgtts2_ -dhgeqz_ -dhsein_ -dhseqr_ -dlabrd_ -dlacon_ -dlacn2_ -dlaein_ -dlaexc_ -dlag2_ -dlags2_ -dlagtm_ -dlagv2_ -dlahqr_ -dlahrd_ -dlahr2_ -dlaic1_ -dlaln2_ -dlals0_ -dlalsa_ -dlalsd_ -dlangb_ -dlange_ -dlangt_ -dlanhs_ -dlansb_ -dlansp_ -dlansy_ -dlantb_ -dlantp_ -dlantr_ -dlanv2_ -dlapll_ -dlapmt_ -dlaqgb_ -dlaqge_ -dlaqp2_ -dlaqps_ -dlaqsb_ -dlaqsp_ -dlaqsy_ -dlaqr0_ -dlaqr1_ -dlaqr2_ -dlaqr3_ -dlaqr4_ -dlaqr5_ -dlaqtr_ -dlar1v_ -dlar2v_ -iladlr_ -iladlc_ -dlarf_ -dlarfb_ -dlarfg_ -dlarft_ -dlarfx_ -dlargv_ -dlarrv_ -dlartv_ -dlarfp_ -dlarz_ -dlarzb_ -dlarzt_ -dlaswp_ -dlasy2_ -dlasyf_ -dlatbs_ -dlatdf_ -dlatps_ -dlatrd_ -dlatrs_ -dlatrz_ -dlatzm_ -dlauu2_ -dlauum_ -dopgtr_ -dopmtr_ -dorg2l_ -dorg2r_ -dorgbr_ -dorghr_ -dorgl2_ -dorglq_ -dorgql_ -dorgqr_ -dorgr2_ -dorgrq_ -dorgtr_ -dorm2l_ -dorm2r_ -dormbr_ -dormhr_ -dorml2_ -dormlq_ -dormql_ -dormqr_ -dormr2_ -dormr3_ -dormrq_ -dormrz_ -dormtr_ -dpbcon_ -dpbequ_ -dpbrfs_ -dpbstf_ -dpbsv_ -dpbsvx_ -dpbtf2_ -dpbtrf_ -dpbtrs_ -dpocon_ -dpoequ_ -dporfs_ -dposv_ -dposvx_ -dpotf2_ -dpotrf_ -dpotri_ -dpotrs_ -dpstrf_ -dpstf2_ -dppcon_ -dppequ_ -dpprfs_ -dppsv_ -dppsvx_ -dpptrf_ -dpptri_ -dpptrs_ -dptcon_ -dpteqr_ -dptrfs_ -dptsv_ -dptsvx_ -dpttrs_ -dptts2_ -drscl_ -dsbev_ -dsbevd_ -dsbevx_ -dsbgst_ -dsbgv_ -dsbgvd_ -dsbgvx_ -dsbtrd_ -dspcon_ -dspev_ -dspevd_ -dspevx_ -dspgst_ -dspgv_ -dspgvd_ -dspgvx_ -dsprfs_ -dspsv_ -dspsvx_ -dsptrd_ -dsptrf_ -dsptri_ -dsptrs_ -dstegr_ -dstein_ -dstev_ -dstevd_ -dstevr_ -dstevx_ -dsycon_ -dsyev_ -dsyevd_ -dsyevr_ -dsyevx_ -dsygs2_ -dsygst_ -dsygv_ -dsygvd_ -dsygvx_ -dsyrfs_ -dsysv_ -dsysvx_ -dsytd2_ -dsytf2_ -dsytrd_ -dsytrf_ -dsytri_ -dsytrs_ -dtbcon_ -dtbrfs_ -dtbtrs_ -dtgevc_ -dtgex2_ -dtgexc_ -dtgsen_ -dtgsja_ -dtgsna_ -dtgsy2_ -dtgsyl_ -dtpcon_ -dtprfs_ -dtptri_ -dtptrs_ -dtrcon_ -dtrevc_ -dtrexc_ -dtrrfs_ -dtrsen_ -dtrsna_ -dtrsyl_ -dtrti2_ -dtrtri_ -dtrtrs_ -dtzrqf_ -dtzrzf_ -dstemr_ -dsgesv_ -dsposv_ -dlag2s_ -slag2d_ -dlat2s_ -dlansf_ -dpftrf_ -dpftri_ -dpftrs_ -dsfrk_ -dtfsm_ -dtftri_ -dtfttp_ -dtfttr_ -dtpttf_ -dtpttr_ -dtrttf_ -dtrttp_ -dgejsv_ -dgesvj_ -dgsvj0_ -dgsvj1_ -dgeequb_ -dsyequb_ -dpoequb_ -dgbequb_ -cbdsqr_ -cgbbrd_ -cgbcon_ -cgbequ_ -cgbrfs_ -cgbsv_ -cgbsvx_ -cgbtf2_ -cgbtrf_ -cgbtrs_ -cgebak_ -cgebal_ -cgebd2_ -cgebrd_ -cgecon_ -cgeequ_ -cgees_ -cgeesx_ -cgeev_ -cgeevx_ -cgegs_ -cgegv_ -cgehd2_ -cgehrd_ -cgelq2_ -cgelqf_ -cgels_ -cgelsd_ -cgelss_ -cgelsx_ -cgelsy_ -cgeql2_ -cgeqlf_ -cgeqp3_ -cgeqpf_ -cgeqr2_ -cgeqrf_ -cgerfs_ -cgerq2_ -cgerqf_ -cgesc2_ -cgesdd_ -cgesv_ -cgesvd_ -cgesvx_ -cgetc2_ -cgetf2_ -cgetrf_ -cgetri_ -cgetrs_ -cggbak_ -cggbal_ -cgges_ -cggesx_ -cggev_ -cggevx_ -cggglm_ -cgghrd_ -cgglse_ -cggqrf_ -cggrqf_ -cggsvd_ -cggsvp_ -cgtcon_ -cgtrfs_ -cgtsv_ -cgtsvx_ -cgttrf_ -cgttrs_ -cgtts2_ -chbev_ -chbevd_ -chbevx_ -chbgst_ -chbgv_ -chbgvd_ -chbgvx_ -chbtrd_ -checon_ -cheev_ -cheevd_ -cheevr_ -cheevx_ -chegs2_ -chegst_ -chegv_ -chegvd_ -chegvx_ -cherfs_ -chesv_ -chesvx_ -chetd2_ -chetf2_ -chetrd_ -chetrf_ -chetri_ -chetrs_ -chgeqz_ -chpcon_ -chpev_ -chpevd_ -chpevx_ -chpgst_ -chpgv_ -chpgvd_ -chpgvx_ -chprfs_ -chpsv_ -chpsvx_ -chptrd_ -chptrf_ -chptri_ -chptrs_ -chsein_ -chseqr_ -clabrd_ -clacgv_ -clacon_ -clacn2_ -clacp2_ -clacpy_ -clacrm_ -clacrt_ -cladiv_ -claed0_ -claed7_ -claed8_ -claein_ -claesy_ -claev2_ -clags2_ -clagtm_ -clahef_ -clahqr_ -clahrd_ -clahr2_ -claic1_ -clals0_ -clalsa_ -clalsd_ -clangb_ -clange_ -clangt_ -clanhb_ -clanhe_ -clanhp_ -clanhs_ -clanht_ -clansb_ -clansp_ -clansy_ -clantb_ -clantp_ -clantr_ -clapll_ -clapmt_ -clarcm_ -claqgb_ -claqge_ -claqhb_ -claqhe_ -claqhp_ -claqp2_ -claqps_ -claqsb_ -claqr0_ -claqr1_ -claqr2_ -claqr3_ -claqr4_ -claqr5_ -claqsp_ -claqsy_ -clar1v_ -clar2v_ -ilaclr_ -ilaclc_ -clarf_ -clarfb_ -clarfg_ -clarft_ -clarfp_ -clarfx_ -clargv_ -clarnv_ -clarrv_ -clartg_ -clartv_ -clarz_ -clarzb_ -clarzt_ -clascl_ -claset_ -clasr_ -classq_ -claswp_ -clasyf_ -clatbs_ -clatdf_ -clatps_ -clatrd_ -clatrs_ -clatrz_ -clatzm_ -clauu2_ -clauum_ -cpbcon_ -cpbequ_ -cpbrfs_ -cpbstf_ -cpbsv_ -cpbsvx_ -cpbtf2_ -cpbtrf_ -cpbtrs_ -cpocon_ -cpoequ_ -cporfs_ -cposv_ -cposvx_ -cpotf2_ -cpotrf_ -cpotri_ -cpotrs_ -cpstrf_ -cpstf2_ -cppcon_ -cppequ_ -cpprfs_ -cppsv_ -cppsvx_ -cpptrf_ -cpptri_ -cpptrs_ -cptcon_ -cpteqr_ -cptrfs_ -cptsv_ -cptsvx_ -cpttrf_ -cpttrs_ -cptts2_ -crot_ -cspcon_ -cspmv_ -cspr_ -csprfs_ -cspsv_ -cspsvx_ -csptrf_ -csptri_ -csptrs_ -csrscl_ -cstedc_ -cstegr_ -cstein_ -csteqr_ -csycon_ -csymv_ -csyr_ -csyrfs_ -csysv_ -csysvx_ -csytf2_ -csytrf_ -csytri_ -csytrs_ -ctbcon_ -ctbrfs_ -ctbtrs_ -ctgevc_ -ctgex2_ -ctgexc_ -ctgsen_ -ctgsja_ -ctgsna_ -ctgsy2_ -ctgsyl_ -ctpcon_ -ctprfs_ -ctptri_ -ctptrs_ -ctrcon_ -ctrevc_ -ctrexc_ -ctrrfs_ -ctrsen_ -ctrsna_ -ctrsyl_ -ctrti2_ -ctrtri_ -ctrtrs_ -ctzrqf_ -ctzrzf_ -cung2l_ -cung2r_ -cungbr_ -cunghr_ -cungl2_ -cunglq_ -cungql_ -cungqr_ -cungr2_ -cungrq_ -cungtr_ -cunm2l_ -cunm2r_ -cunmbr_ -cunmhr_ -cunml2_ -cunmlq_ -cunmql_ -cunmqr_ -cunmr2_ -cunmr3_ -cunmrq_ -cunmrz_ -cunmtr_ -cupgtr_ -cupmtr_ -icmax1_ -scsum1_ -cstemr_ -chfrk_ -ctfttp_ -clanhf_ -cpftrf_ -cpftri_ -cpftrs_ -ctfsm_ -ctftri_ -ctfttr_ -ctpttf_ -ctpttr_ -ctrttf_ -ctrttp_ -cgeequb_ -cgbequb_ -csyequb_ -cpoequb_ -cheequb_ -zbdsqr_ -zgbbrd_ -zgbcon_ -zgbequ_ -zgbrfs_ -zgbsv_ -zgbsvx_ -zgbtf2_ -zgbtrf_ -zgbtrs_ -zgebak_ -zgebal_ -zgebd2_ -zgebrd_ -zgecon_ -zgeequ_ -zgees_ -zgeesx_ -zgeev_ -zgeevx_ -zgegs_ -zgegv_ -zgehd2_ -zgehrd_ -zgelq2_ -zgelqf_ -zgels_ -zgelsd_ -zgelss_ -zgelsx_ -zgelsy_ -zgeql2_ -zgeqlf_ -zgeqp3_ -zgeqpf_ -zgeqr2_ -zgeqrf_ -zgerfs_ -zgerq2_ -zgerqf_ -zgesc2_ -zgesdd_ -zgesv_ -zgesvd_ -zgesvx_ -zgetc2_ -zgetf2_ -zgetrf_ -zgetri_ -zgetrs_ -zggbak_ -zggbal_ -zgges_ -zggesx_ -zggev_ -zggevx_ -zggglm_ -zgghrd_ -zgglse_ -zggqrf_ -zggrqf_ -zggsvd_ -zggsvp_ -zgtcon_ -zgtrfs_ -zgtsv_ -zgtsvx_ -zgttrf_ -zgttrs_ -zgtts2_ -zhbev_ -zhbevd_ -zhbevx_ -zhbgst_ -zhbgv_ -zhbgvd_ -zhbgvx_ -zhbtrd_ -zhecon_ -zheev_ -zheevd_ -zheevr_ -zheevx_ -zhegs2_ -zhegst_ -zhegv_ -zhegvd_ -zhegvx_ -zherfs_ -zhesv_ -zhesvx_ -zhetd2_ -zhetf2_ -zhetrd_ -zhetrf_ -zhetri_ -zhetrs_ -zhgeqz_ -zhpcon_ -zhpev_ -zhpevd_ -zhpevx_ -zhpgst_ -zhpgv_ -zhpgvd_ -zhpgvx_ -zhprfs_ -zhpsv_ -zhpsvx_ -zhptrd_ -zhptrf_ -zhptri_ -zhptrs_ -zhsein_ -zhseqr_ -zlabrd_ -zlacgv_ -zlacon_ -zlacn2_ -zlacp2_ -zlacpy_ -zlacrm_ -zlacrt_ -zladiv_ -zlaed0_ -zlaed7_ -zlaed8_ -zlaein_ -zlaesy_ -zlaev2_ -zlags2_ -zlagtm_ -zlahef_ -zlahqr_ -zlahrd_ -zlahr2_ -zlaic1_ -zlals0_ -zlalsa_ -zlalsd_ -zlangb_ -zlange_ -zlangt_ -zlanhb_ -zlanhe_ -zlanhp_ -zlanhs_ -zlanht_ -zlansb_ -zlansp_ -zlansy_ -zlantb_ -zlantp_ -zlantr_ -zlapll_ -zlapmt_ -zlaqgb_ -zlaqge_ -zlaqhb_ -zlaqhe_ -zlaqhp_ -zlaqp2_ -zlaqps_ -zlaqsb_ -zlaqr0_ -zlaqr1_ -zlaqr2_ -zlaqr3_ -zlaqr4_ -zlaqr5_ -zlaqsp_ -zlaqsy_ -zlar1v_ -zlar2v_ -ilazlr_ -ilazlc_ -zlarcm_ -zlarf_ -zlarfb_ -zlarfg_ -zlarft_ -zlarfp_ -zlarfx_ -zlargv_ -zlarnv_ -zlarrv_ -zlartg_ -zlartv_ -zlarz_ -zlarzb_ -zlarzt_ -zlascl_ -zlaset_ -zlasr_ -zlassq_ -zlaswp_ -zlasyf_ -zlatbs_ -zlatdf_ -zlatps_ -zlatrd_ -zlatrs_ -zlatrz_ -zlatzm_ -zlauu2_ -zlauum_ -zpbcon_ -zpbequ_ -zpbrfs_ -zpbstf_ -zpbsv_ -zpbsvx_ -zpbtf2_ -zpbtrf_ -zpbtrs_ -zpocon_ -zpoequ_ -zporfs_ -zposv_ -zposvx_ -zpotf2_ -zpotrf_ -zpotri_ -zpotrs_ -zpstrf_ -zpstf2_ -zppcon_ -zppequ_ -zpprfs_ -zppsv_ -zppsvx_ -zpptrf_ -zpptri_ -zpptrs_ -zptcon_ -zpteqr_ -zptrfs_ -zptsv_ -zptsvx_ -zpttrf_ -zpttrs_ -zptts2_ -zrot_ -zspcon_ -zspmv_ -zspr_ -zsprfs_ -zspsv_ -zspsvx_ -zsptrf_ -zsptri_ -zsptrs_ -zdrscl_ -zstedc_ -zstegr_ -zstein_ -zsteqr_ -zsycon_ -zsymv_ -zsyr_ -zsyrfs_ -zsysv_ -zsysvx_ -zsytf2_ -zsytrf_ -zsytri_ -zsytrs_ -ztbcon_ -ztbrfs_ -ztbtrs_ -ztgevc_ -ztgex2_ -ztgexc_ -ztgsen_ -ztgsja_ -ztgsna_ -ztgsy2_ -ztgsyl_ -ztpcon_ -ztprfs_ -ztptri_ -ztptrs_ -ztrcon_ -ztrevc_ -ztrexc_ -ztrrfs_ -ztrsen_ -ztrsna_ -ztrsyl_ -ztrti2_ -ztrtri_ -ztrtrs_ -ztzrqf_ -ztzrzf_ -zung2l_ -zung2r_ -zungbr_ -zunghr_ -zungl2_ -zunglq_ -zungql_ -zungqr_ -zungr2_ -zungrq_ -zungtr_ -zunm2l_ -zunm2r_ -zunmbr_ -zunmhr_ -zunml2_ -zunmlq_ -zunmql_ -zunmqr_ -zunmr2_ -zunmr3_ -zunmrq_ -zunmrz_ -zunmtr_ -zupgtr_ -zupmtr_ -izmax1_ -dzsum1_ -zstemr_ -zcgesv_ -zcposv_ -zlag2c_ -clag2z_ -zlat2c_ -zhfrk_ -ztfttp_ -zlanhf_ -zpftrf_ -zpftri_ -zpftrs_ -ztfsm_ -ztftri_ -ztfttr_ -ztpttf_ -ztpttr_ -ztrttf_ -ztrttp_ -zgeequb_ -zgbequb_ -zsyequb_ -zpoequb_ -zheequb_ -sbdsdc_ -sbdsqr_ -sdisna_ -slabad_ -slacpy_ -sladiv_ -slae2_ -slaebz_ -slaed0_ -slaed1_ -slaed2_ -slaed3_ -slaed4_ -slaed5_ -slaed6_ -slaed7_ -slaed8_ -slaed9_ -slaeda_ -slaev2_ -slagtf_ -slagts_ -slamrg_ -slanst_ -slapy2_ -slapy3_ -slarnv_ -slarra_ -slarrb_ -slarrc_ -slarrd_ -slarre_ -slarrf_ -slarrj_ -slarrk_ -slarrr_ -slaneg_ -slartg_ -slaruv_ -slas2_ -slascl_ -slasd0_ -slasd1_ -slasd2_ -slasd3_ -slasd4_ -slasd5_ -slasd6_ -slasd7_ -slasd8_ -slasda_ -slasdq_ -slasdt_ -slaset_ -slasq1_ -slasq2_ -slasq3_ -slasq4_ -slasq5_ -slasq6_ -slasr_ -slasrt_ -slassq_ -slasv2_ -spttrf_ -sstebz_ -sstedc_ -ssteqr_ -ssterf_ -slaisnan_ -sisnan_ -slamch_ -dbdsdc_ -dbdsqr_ -ddisna_ -dlabad_ -dlacpy_ -dladiv_ -dlae2_ -dlaebz_ -dlaed0_ -dlaed1_ -dlaed2_ -dlaed3_ -dlaed4_ -dlaed5_ -dlaed6_ -dlaed7_ -dlaed8_ -dlaed9_ -dlaeda_ -dlaev2_ -dlagtf_ -dlagts_ -dlamrg_ -dlanst_ -dlapy2_ -dlapy3_ -dlarnv_ -dlarra_ -dlarrb_ -dlarrc_ -dlarrd_ -dlarre_ -dlarrf_ -dlarrj_ -dlarrk_ -dlarrr_ -dlaneg_ -dlartg_ -dlaruv_ -dlas2_ -dlascl_ -dlasd0_ -dlasd1_ -dlasd2_ -dlasd3_ -dlasd4_ -dlasd5_ -dlasd6_ -dlasd7_ -dlasd8_ -dlasda_ -dlasdq_ -dlasdt_ -dlaset_ -dlasq1_ -dlasq2_ -dlasq3_ -dlasq4_ -dlasq5_ -dlasq6_ -dlasr_ -dlasrt_ -dlassq_ -dlasv2_ -dpttrf_ -dstebz_ -dstedc_ -dsteqr_ -dsterf_ -dlaisnan_ -disnan_ -dlamch_ -ilaenv_ -ieeeck_ -lsamen_ -iparmq_ -ilaprec_ -ilatrans_ -ilauplo_ -iladiag_ -ilaver_ -lsame_ diff --git a/ports/clapack/link-to-math-lib.patch b/ports/clapack/link-to-math-lib.patch deleted file mode 100644 index c80a8d4ed5cd27..00000000000000 --- a/ports/clapack/link-to-math-lib.patch +++ /dev/null @@ -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) diff --git a/ports/clapack/portfile.cmake b/ports/clapack/portfile.cmake index 3c46088486754d..e529188e28100f 100644 --- a/ports/clapack/portfile.cmake +++ b/ports/clapack/portfile.cmake @@ -1,45 +1,30 @@ 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 ) 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 ) -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 ) vcpkg_install_cmake() +vcpkg_copy_pdbs() +vcpkg_fixup_cmake_targets(CONFIG_PATH share/clapack TARGET_PATH 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) diff --git a/ports/clapack/remove_internal_blas.patch b/ports/clapack/remove_internal_blas.patch new file mode 100644 index 00000000000000..41d9e666efd440 --- /dev/null +++ b/ports/clapack/remove_internal_blas.patch @@ -0,0 +1,77 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 320ccc6..3567e41 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(OpenBLAS 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 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/lapack-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/lapack-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/ports/clapack/use-other-blas-and-install-include.patch b/ports/clapack/use-other-blas-and-install-include.patch deleted file mode 100644 index 0f81e64fee8c4f..00000000000000 --- a/ports/clapack/use-other-blas-and-install-include.patch +++ /dev/null @@ -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} ) - diff --git a/ports/openblas/CONTROL b/ports/openblas/CONTROL index d485b4126ecd7c..cabd86f8b67c5e 100644 --- a/ports/openblas/CONTROL +++ b/ports/openblas/CONTROL @@ -1,3 +1,3 @@ Source: openblas -Version: 0.3.6 +Version: 0.3.6-1 Description: OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version. diff --git a/ports/openblas/portfile.cmake b/ports/openblas/portfile.cmake index caf901ccfac9f6..d1ba5207fee410 100644 --- a/ports/openblas/portfile.cmake +++ b/ports/openblas/portfile.cmake @@ -72,7 +72,7 @@ if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} - OPTIONS -DCMAKE_SYSTEM_PROCESSOR=AMD64 -DVS_WINRT_COMPONENT=TRUE -DBUILD_WITHOUT_LAPACK=ON + OPTIONS -DCMAKE_SYSTEM_PROCESSOR=AMD64 -DVS_WINRT_COMPONENT=TRUE -DBUILD_WITHOUT_LAPACK=ON "-DBLASHELPER_BINARY_DIR=${CURRENT_BUILDTREES_DIR}/x64-windows-rel") elseif(NOT VCPKG_CMAKE_SYSTEM_NAME) @@ -87,6 +87,7 @@ endif() vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH share/cmake/OpenBLAS TARGET_PATH share/openblas) # 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 diff --git a/ports/openssl-windows/portfile.cmake b/ports/openssl-windows/portfile.cmake index 4331c2eabdc206..b5e505a3dc1950 100644 --- a/ports/openssl-windows/portfile.cmake +++ b/ports/openssl-windows/portfile.cmake @@ -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) diff --git a/ports/suitesparse/lapack_module.patch b/ports/suitesparse/lapack_module.patch new file mode 100644 index 00000000000000..cdc71253155836 --- /dev/null +++ b/ports/suitesparse/lapack_module.patch @@ -0,0 +1,16 @@ +diff --git a/cmake/SuiteSparse-config-install.cmake.in b/cmake/SuiteSparse-config-install.cmake.in +index cb1f51f..8bd2210 100755 +--- a/cmake/SuiteSparse-config-install.cmake.in ++++ b/cmake/SuiteSparse-config-install.cmake.in +@@ -4,10 +4,7 @@ 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) diff --git a/ports/suitesparse/portfile.cmake b/ports/suitesparse/portfile.cmake index ee73b94fb04963..1dc69f7f3944af 100644 --- a/ports/suitesparse/portfile.cmake +++ b/ports/suitesparse/portfile.cmake @@ -19,11 +19,13 @@ vcpkg_extract_source_archive_ex( ) vcpkg_from_github( - OUT_SOURCE_PATH SUITESPARSEWIN_SOURCE_PATH - REPO jlblancoc/suitesparse-metis-for-windows - REF v${SUITESPARSEWIN_VER} - SHA512 35a2563d6e33ebe8157f8d023167abd8d2512e2a627b8dbea798c59afefc56b8f01c7d10553529b03a7b4759e200ca82bb26ebce5cefce6983ffb057a8622162 - HEAD_REF master + OUT_SOURCE_PATH SUITESPARSEWIN_SOURCE_PATH + REPO jlblancoc/suitesparse-metis-for-windows + REF v${SUITESPARSEWIN_VER} + SHA512 35a2563d6e33ebe8157f8d023167abd8d2512e2a627b8dbea798c59afefc56b8f01c7d10553529b03a7b4759e200ca82bb26ebce5cefce6983ffb057a8622162 + HEAD_REF master + PATCHES + lapack_module.patch ) # Copy suitesparse sources. diff --git a/ports/suitesparse/remove-debug-postfix.patch b/ports/suitesparse/remove-debug-postfix.patch deleted file mode 100644 index 1b41139dae0968..00000000000000 --- a/ports/suitesparse/remove-debug-postfix.patch +++ /dev/null @@ -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) From 7c7514b57a83f2af3d466d6a6b550394a34aac13 Mon Sep 17 00:00:00 2001 From: Stefano Sinigardi Date: Tue, 14 May 2019 16:35:41 +0200 Subject: [PATCH 05/34] [lapack] intercept cmake module calls and substitute them with our defs --- ports/clapack/portfile.cmake | 12 ++++- ports/clapack/remove_internal_blas.patch | 15 ++++-- .../clapack/vcpkg-cmake-wrapper-clapack.cmake | 3 ++ ports/clapack/vcpkg-cmake-wrapper.cmake | 46 +++++++++++++++++++ 4 files changed, 71 insertions(+), 5 deletions(-) create mode 100644 ports/clapack/vcpkg-cmake-wrapper-clapack.cmake create mode 100644 ports/clapack/vcpkg-cmake-wrapper.cmake diff --git a/ports/clapack/portfile.cmake b/ports/clapack/portfile.cmake index e529188e28100f..6a77a4065dd4a3 100644 --- a/ports/clapack/portfile.cmake +++ b/ports/clapack/portfile.cmake @@ -18,11 +18,21 @@ vcpkg_extract_source_archive_ex( vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA + OPTIONS + -DCMAKE_DEBUG_POSTFIX=d ) vcpkg_install_cmake() vcpkg_copy_pdbs() -vcpkg_fixup_cmake_targets(CONFIG_PATH share/clapack TARGET_PATH share/lapack) + +#TODO: fix the exported targets, since they are broken. +vcpkg_fixup_cmake_targets(CONFIG_PATH share/clapack) + +#we install a cmake wrapper since the official FindLAPACK module does not accept clapack as a valid library, unfortunately... +file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/lapack) + +#we also intercept any call to FindCLAPACK redirecting it to our FindLAPACK +file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper-clapack.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/clapack RENAME vcpkg-cmake-wrapper.cmake) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) diff --git a/ports/clapack/remove_internal_blas.patch b/ports/clapack/remove_internal_blas.patch index 41d9e666efd440..21eb754b29dcc9 100644 --- a/ports/clapack/remove_internal_blas.patch +++ b/ports/clapack/remove_internal_blas.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 320ccc6..3567e41 100755 +index 320ccc6..284e9d3 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,6 @@ @@ -32,13 +32,13 @@ index 320ccc6..3567e41 100755 -set(CPACK_PACKAGE_VERSION_PATCH 1) -include(CPack) -export(TARGETS f2c blas lapack FILE clapack-targets.cmake) -+export(TARGETS f2c 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/lapack-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/lapack-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 @@ -75,3 +75,10 @@ index ac4cce3..07dc8c7 100755 + 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") diff --git a/ports/clapack/vcpkg-cmake-wrapper-clapack.cmake b/ports/clapack/vcpkg-cmake-wrapper-clapack.cmake new file mode 100644 index 00000000000000..5f44bc8dc14d1c --- /dev/null +++ b/ports/clapack/vcpkg-cmake-wrapper-clapack.cmake @@ -0,0 +1,3 @@ +include(${CMAKE_ROOT}/Modules/CMakeFindDependencyMacro.cmake) + +find_dependency(LAPACK) diff --git a/ports/clapack/vcpkg-cmake-wrapper.cmake b/ports/clapack/vcpkg-cmake-wrapper.cmake new file mode 100644 index 00000000000000..698c8a0997cd2d --- /dev/null +++ b/ports/clapack/vcpkg-cmake-wrapper.cmake @@ -0,0 +1,46 @@ +include(${CMAKE_ROOT}/Modules/SelectLibraryConfigurations.cmake) +include(${CMAKE_ROOT}/Modules/CheckSymbolExists.cmake) + +if(UNIX) + find_library(ADDITIONAL_LAPACK_LIBRARY m) +endif() + +if(NOT F2C_LIBRARY) + find_library(F2C_LIBRARY_RELEASE NAMES libf2c) + find_library(F2C_LIBRARY_DEBUG NAMES libf2cd) + select_library_configurations(F2C) +endif() + +if(NOT LAPACK_LIBRARY) + find_library(LAPACK_LIBRARY_RELEASE NAMES lapack) + find_library(LAPACK_LIBRARY_DEBUG NAMES lapackd) + select_library_configurations(LAPACK) +endif() + +list(APPEND LAPACK_LIBRARY ${F2C_LIBRARY}) +list(APPEND LAPACK_LIBRARY ${ADDITIONAL_LAPACK_LIBRARY}) + +set(F2C_LIBRARIES "${F2C_LIBRARY}" 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) + +#check_symbol_exists(cheev_ clapack.h HAVE_CHEEV_) +#check_symbol_exists(cheev clapack.h HAVE_CHEEV) + +set(CLAPACK_FOUND TRUE CACHE BOOL "" FORCE) +set(LAPACK_FOUND TRUE CACHE BOOL "" FORCE) +set(F2C_FOUND TRUE CACHE BOOL "" FORCE) From d57678512ebc0068fcd575ace1da379628164369 Mon Sep 17 00:00:00 2001 From: Stefano Sinigardi Date: Tue, 14 May 2019 17:22:44 +0200 Subject: [PATCH 06/34] [suitesparse,clapack] fixes for proper integration --- ports/ceres/portfile.cmake | 2 - ports/clapack/portfile.cmake | 4 +- .../suitesparse/fix-install-suitesparse.patch | 29 --------- ports/suitesparse/lapack_module.patch | 16 ----- ports/suitesparse/portfile.cmake | 16 ++--- ports/suitesparse/suitesparse.patch | 60 +++++++++++++++++++ 6 files changed, 67 insertions(+), 60 deletions(-) delete mode 100644 ports/suitesparse/fix-install-suitesparse.patch delete mode 100644 ports/suitesparse/lapack_module.patch create mode 100644 ports/suitesparse/suitesparse.patch diff --git a/ports/ceres/portfile.cmake b/ports/ceres/portfile.cmake index 92a46d0aee112a..7b51fda7cd1759 100644 --- a/ports/ceres/portfile.cmake +++ b/ports/ceres/portfile.cmake @@ -64,8 +64,6 @@ 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} ) diff --git a/ports/clapack/portfile.cmake b/ports/clapack/portfile.cmake index 6a77a4065dd4a3..17c39e6134e949 100644 --- a/ports/clapack/portfile.cmake +++ b/ports/clapack/portfile.cmake @@ -29,10 +29,10 @@ vcpkg_copy_pdbs() vcpkg_fixup_cmake_targets(CONFIG_PATH share/clapack) #we install a cmake wrapper since the official FindLAPACK module does not accept clapack as a valid library, unfortunately... -file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/lapack) +file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/lapack) #we also intercept any call to FindCLAPACK redirecting it to our FindLAPACK -file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper-clapack.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/clapack RENAME vcpkg-cmake-wrapper.cmake) +file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper-clapack.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/clapack RENAME vcpkg-cmake-wrapper.cmake) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) diff --git a/ports/suitesparse/fix-install-suitesparse.patch b/ports/suitesparse/fix-install-suitesparse.patch deleted file mode 100644 index a5b5400fae43a1..00000000000000 --- a/ports/suitesparse/fix-install-suitesparse.patch +++ /dev/null @@ -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. diff --git a/ports/suitesparse/lapack_module.patch b/ports/suitesparse/lapack_module.patch deleted file mode 100644 index cdc71253155836..00000000000000 --- a/ports/suitesparse/lapack_module.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/cmake/SuiteSparse-config-install.cmake.in b/cmake/SuiteSparse-config-install.cmake.in -index cb1f51f..8bd2210 100755 ---- a/cmake/SuiteSparse-config-install.cmake.in -+++ b/cmake/SuiteSparse-config-install.cmake.in -@@ -4,10 +4,7 @@ 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) diff --git a/ports/suitesparse/portfile.cmake b/ports/suitesparse/portfile.cmake index 1dc69f7f3944af..359c09b3bfff47 100644 --- a/ports/suitesparse/portfile.cmake +++ b/ports/suitesparse/portfile.cmake @@ -14,8 +14,6 @@ vcpkg_download_distfile(SUITESPARSE vcpkg_extract_source_archive_ex( OUT_SOURCE_PATH SOURCE_PATH ARCHIVE ${SUITESPARSE} - PATCHES - fix-install-suitesparse.patch ) vcpkg_from_github( @@ -25,7 +23,7 @@ vcpkg_from_github( SHA512 35a2563d6e33ebe8157f8d023167abd8d2512e2a627b8dbea798c59afefc56b8f01c7d10553529b03a7b4759e200ca82bb26ebce5cefce6983ffb057a8622162 HEAD_REF master PATCHES - lapack_module.patch + suitesparse.patch ) # Copy suitesparse sources. @@ -40,6 +38,7 @@ 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") @@ -54,18 +53,13 @@ vcpkg_configure_cmake( SOURCE_PATH ${SUITESPARSEWIN_SOURCE_PATH} PREFER_NINJA OPTIONS - -DBUILD_METIS=OFF #Disable the option to build metis from source - -DUSE_VCPKG_METIS=${USE_VCPKG_METIS} #Force using vcpckg metis library - -DMETIS_SOURCE_DIR="${CURRENT_INSTALLED_DIR}" - -DSUITESPARSE_USE_CUSTOM_BLAS_LAPACK_LIBS=ON + -DBUILD_METIS=OFF + -DUSE_VCPKG_METIS=${USE_VCPKG_METIS} + ${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}" 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}" ) vcpkg_install_cmake() diff --git a/ports/suitesparse/suitesparse.patch b/ports/suitesparse/suitesparse.patch new file mode 100644 index 00000000000000..3118de1918f800 --- /dev/null +++ b/ports/suitesparse/suitesparse.patch @@ -0,0 +1,60 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 3486f05..492289a 100755 +--- 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") +diff --git a/SuiteSparse/CMakeLists.txt b/SuiteSparse/CMakeLists.txt +index c6e2834..5ef08a6 100755 +--- 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..d771f61 100755 +--- a/cmake/SuiteSparse-config-install.cmake.in ++++ b/cmake/SuiteSparse-config-install.cmake.in +@@ -4,10 +4,7 @@ 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) +@@ -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) ++ From a5bfd8170e0ba412bcdeeea6a2019d3745dc42bc Mon Sep 17 00:00:00 2001 From: Stefano Sinigardi Date: Tue, 14 May 2019 17:33:51 +0200 Subject: [PATCH 07/34] [ceres,clapack] bump CONTROL --- ports/ceres/CONTROL | 2 +- ports/clapack/CONTROL | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/ceres/CONTROL b/ports/ceres/CONTROL index 8ec022fd3baac6..a1dffa1c419b9a 100644 --- a/ports/ceres/CONTROL +++ b/ports/ceres/CONTROL @@ -1,5 +1,5 @@ Source: ceres -Version: 1.14.0-3 +Version: 1.14.0-4 Build-Depends: glog, eigen3 Description: non-linear optimization package diff --git a/ports/clapack/CONTROL b/ports/clapack/CONTROL index 1a862a113811bb..70d42f2b9ec37b 100644 --- a/ports/clapack/CONTROL +++ b/ports/clapack/CONTROL @@ -1,4 +1,4 @@ Source: clapack -Version: 3.2.1-4 +Version: 3.2.1-5 Description: CLAPACK (f2c'ed version of LAPACK) Build-Depends: openblas (!osx) From 6cd1302ab2ee1241fd6232c0632df34bb4ff28b8 Mon Sep 17 00:00:00 2001 From: Stefano Sinigardi Date: Wed, 15 May 2019 11:35:58 +0200 Subject: [PATCH 08/34] [suitesparse] remove unnecessary defs --- ports/suitesparse/portfile.cmake | 8 -------- 1 file changed, 8 deletions(-) diff --git a/ports/suitesparse/portfile.cmake b/ports/suitesparse/portfile.cmake index 359c09b3bfff47..a527f88259ed78 100644 --- a/ports/suitesparse/portfile.cmake +++ b/ports/suitesparse/portfile.cmake @@ -41,14 +41,6 @@ if("metis" IN_LIST FEATURES) 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() - vcpkg_configure_cmake( SOURCE_PATH ${SUITESPARSEWIN_SOURCE_PATH} PREFER_NINJA From f054f784b6f4daaf5f8633812f535d42c69b3f37 Mon Sep 17 00:00:00 2001 From: Stefano Sinigardi Date: Wed, 15 May 2019 13:16:33 +0200 Subject: [PATCH 09/34] [clapack] improve wrapper logic --- ports/clapack/vcpkg-cmake-wrapper.cmake | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ports/clapack/vcpkg-cmake-wrapper.cmake b/ports/clapack/vcpkg-cmake-wrapper.cmake index 698c8a0997cd2d..0d9b5f7403968c 100644 --- a/ports/clapack/vcpkg-cmake-wrapper.cmake +++ b/ports/clapack/vcpkg-cmake-wrapper.cmake @@ -37,10 +37,13 @@ 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) #check_symbol_exists(cheev_ clapack.h HAVE_CHEEV_) #check_symbol_exists(cheev clapack.h HAVE_CHEEV) -set(CLAPACK_FOUND TRUE CACHE BOOL "" FORCE) -set(LAPACK_FOUND TRUE CACHE BOOL "" FORCE) -set(F2C_FOUND TRUE CACHE BOOL "" FORCE) +if(LAPACK_LIBRARIES AND F2C_LIBRARIES AND LAPACK_INCLUDE_DIRS AND F2C_INCLUDE_DIRS) + set(CLAPACK_FOUND TRUE CACHE BOOL "" FORCE) + set(LAPACK_FOUND TRUE CACHE BOOL "" FORCE) + set(F2C_FOUND TRUE CACHE BOOL "" FORCE) +endif() From 26132c22006c0b20f92cd849bf24a3dda8c9614f Mon Sep 17 00:00:00 2001 From: Stefano Sinigardi Date: Wed, 15 May 2019 13:37:48 +0200 Subject: [PATCH 10/34] [WIN32] remove wrong symbol --- ports/arrow/portfile.cmake | 2 +- ports/assimp/portfile.cmake | 2 +- ports/ceres/portfile.cmake | 4 +- ports/ebml/portfile.cmake | 2 +- ports/exiv2/portfile.cmake | 4 +- ports/ffmpeg/portfile.cmake | 6 +- ports/fmilib/portfile.cmake | 52 ++++++++-------- ports/fontconfig/portfile.cmake | 2 +- ports/gdal/portfile.cmake | 88 +++++++++++++-------------- ports/graphqlparser/portfile.cmake | 4 +- ports/gsoap/portfile.cmake | 10 +-- ports/highfive/portfile.cmake | 2 +- ports/jsonnet/portfile.cmake | 2 +- ports/matroska/portfile.cmake | 2 +- ports/moos-core/portfile.cmake | 2 +- ports/octomap/portfile.cmake | 2 +- ports/openexr/portfile.cmake | 2 +- ports/platform-folders/portfile.cmake | 2 +- ports/portaudio/portfile.cmake | 2 +- ports/rttr/portfile.cmake | 4 +- ports/sndfile/portfile.cmake | 2 +- ports/tgui/portfile.cmake | 6 +- ports/x265/portfile.cmake | 8 +-- ports/zxing-cpp/portfile.cmake | 6 +- 24 files changed, 109 insertions(+), 109 deletions(-) diff --git a/ports/arrow/portfile.cmake b/ports/arrow/portfile.cmake index 28b58e8bf82761..a99a4fdc80087e 100644 --- a/ports/arrow/portfile.cmake +++ b/ports/arrow/portfile.cmake @@ -58,7 +58,7 @@ vcpkg_install_cmake() vcpkg_copy_pdbs() -if(WIN32) +if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") file(RENAME ${CURRENT_PACKAGES_DIR}/lib/arrow_static.lib ${CURRENT_PACKAGES_DIR}/lib/arrow.lib) file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/arrow_static.lib ${CURRENT_PACKAGES_DIR}/debug/lib/arrow.lib) diff --git a/ports/assimp/portfile.cmake b/ports/assimp/portfile.cmake index 2945f51f922625..1c40efe7ed0784 100644 --- a/ports/assimp/portfile.cmake +++ b/ports/assimp/portfile.cmake @@ -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() diff --git a/ports/ceres/portfile.cmake b/ports/ceres/portfile.cmake index 7b51fda7cd1759..f1b21d64793889 100644 --- a/ports/ceres/portfile.cmake +++ b/ports/ceres/portfile.cmake @@ -69,7 +69,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${LIB_SUFFIX}/cmake/Ceres") @@ -78,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}") diff --git a/ports/ebml/portfile.cmake b/ports/ebml/portfile.cmake index 3eb8d642d9249f..0f0e878b103b15 100644 --- a/ports/ebml/portfile.cmake +++ b/ports/ebml/portfile.cmake @@ -21,7 +21,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/ebml) diff --git a/ports/exiv2/portfile.cmake b/ports/exiv2/portfile.cmake index 96cec76cb45a31..44daf8717e4480 100644 --- a/ports/exiv2/portfile.cmake +++ b/ports/exiv2/portfile.cmake @@ -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) diff --git a/ports/ffmpeg/portfile.cmake b/ports/ffmpeg/portfile.cmake index 786d82ea14109b..32d2c416118a99 100644 --- a/ports/ffmpeg/portfile.cmake +++ b/ports/ffmpeg/portfile.cmake @@ -25,7 +25,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) @@ -34,7 +34,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}") @@ -141,7 +141,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") diff --git a/ports/fmilib/portfile.cmake b/ports/fmilib/portfile.cmake index 5692b7d123c8e0..46912d440da034 100644 --- a/ports/fmilib/portfile.cmake +++ b/ports/fmilib/portfile.cmake @@ -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) diff --git a/ports/fontconfig/portfile.cmake b/ports/fontconfig/portfile.cmake index 4637f112cc259d..772e741fd3c700 100644 --- a/ports/fontconfig/portfile.cmake +++ b/ports/fontconfig/portfile.cmake @@ -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}") diff --git a/ports/gdal/portfile.cmake b/ports/gdal/portfile.cmake index b880c91848635c..61609d3d3bd4fd 100644 --- a/ports/gdal/portfile.cmake +++ b/ports/gdal/portfile.cmake @@ -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) diff --git a/ports/graphqlparser/portfile.cmake b/ports/graphqlparser/portfile.cmake index bab77a0c72ab2d..a90959f5db9a22 100644 --- a/ports/graphqlparser/portfile.cmake +++ b/ports/graphqlparser/portfile.cmake @@ -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) diff --git a/ports/gsoap/portfile.cmake b/ports/gsoap/portfile.cmake index dc7547eb284a56..5924ff5adbdb1e 100644 --- a/ports/gsoap/portfile.cmake +++ b/ports/gsoap/portfile.cmake @@ -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() \ No newline at end of file +vcpkg_copy_pdbs() diff --git a/ports/highfive/portfile.cmake b/ports/highfive/portfile.cmake index ed88a45c998c16..db6f4a0129576c 100644 --- a/ports/highfive/portfile.cmake +++ b/ports/highfive/portfile.cmake @@ -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() diff --git a/ports/jsonnet/portfile.cmake b/ports/jsonnet/portfile.cmake index d1f9ca15337bf4..5472445da6e64f 100644 --- a/ports/jsonnet/portfile.cmake +++ b/ports/jsonnet/portfile.cmake @@ -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}" diff --git a/ports/matroska/portfile.cmake b/ports/matroska/portfile.cmake index 946ee81bc0cae1..8e134a9be62099 100644 --- a/ports/matroska/portfile.cmake +++ b/ports/matroska/portfile.cmake @@ -20,7 +20,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/matroska) diff --git a/ports/moos-core/portfile.cmake b/ports/moos-core/portfile.cmake index 196b3e6480e75e..646fde9e2ff2b7 100644 --- a/ports/moos-core/portfile.cmake +++ b/ports/moos-core/portfile.cmake @@ -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() diff --git a/ports/octomap/portfile.cmake b/ports/octomap/portfile.cmake index 113f6fc04762e7..d260d440964d4b 100644 --- a/ports/octomap/portfile.cmake +++ b/ports/octomap/portfile.cmake @@ -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) diff --git a/ports/openexr/portfile.cmake b/ports/openexr/portfile.cmake index d2524b5170ba26..1fd50b0693c3cf 100644 --- a/ports/openexr/portfile.cmake +++ b/ports/openexr/portfile.cmake @@ -34,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 "") diff --git a/ports/platform-folders/portfile.cmake b/ports/platform-folders/portfile.cmake index c6684809676dd6..fef2bf327cf954 100644 --- a/ports/platform-folders/portfile.cmake +++ b/ports/platform-folders/portfile.cmake @@ -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/) diff --git a/ports/portaudio/portfile.cmake b/ports/portaudio/portfile.cmake index 9bb86005dfffa7..6fcbdf4377484a 100644 --- a/ports/portaudio/portfile.cmake +++ b/ports/portaudio/portfile.cmake @@ -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) diff --git a/ports/rttr/portfile.cmake b/ports/rttr/portfile.cmake index 2c2c7e86350645..a85a2b157c579b 100644 --- a/ports/rttr/portfile.cmake +++ b/ports/rttr/portfile.cmake @@ -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") diff --git a/ports/sndfile/portfile.cmake b/ports/sndfile/portfile.cmake index 22f1579e88c304..f11a8695e5718e 100644 --- a/ports/sndfile/portfile.cmake +++ b/ports/sndfile/portfile.cmake @@ -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) diff --git a/ports/tgui/portfile.cmake b/ports/tgui/portfile.cmake index e87bfaaa96fc67..dd326c9ae82e27 100644 --- a/ports/tgui/portfile.cmake +++ b/ports/tgui/portfile.cmake @@ -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}") diff --git a/ports/x265/portfile.cmake b/ports/x265/portfile.cmake index 6b207baf38b7c4..987e7224681968 100644 --- a/ports/x265/portfile.cmake +++ b/ports/x265/portfile.cmake @@ -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) \ No newline at end of file +file(RENAME ${CURRENT_PACKAGES_DIR}/share/x265/COPYING ${CURRENT_PACKAGES_DIR}/share/x265/copyright) diff --git a/ports/zxing-cpp/portfile.cmake b/ports/zxing-cpp/portfile.cmake index 06a2e6b49aa446..40f1aca5be2b1a 100644 --- a/ports/zxing-cpp/portfile.cmake +++ b/ports/zxing-cpp/portfile.cmake @@ -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() From 55bb36b0d7f6e32823cb5ab9b74f41c3bedf4003 Mon Sep 17 00:00:00 2001 From: Stefano Sinigardi Date: Wed, 15 May 2019 23:00:38 +0200 Subject: [PATCH 11/34] [clapack] fix wrapper integration --- ports/clapack/remove_internal_blas.patch | 2 +- ports/clapack/vcpkg-cmake-wrapper.cmake | 5 +++-- ports/mlpack/CONTROL | 2 +- ports/openblas/portfile.cmake | 13 +------------ 4 files changed, 6 insertions(+), 16 deletions(-) diff --git a/ports/clapack/remove_internal_blas.patch b/ports/clapack/remove_internal_blas.patch index 21eb754b29dcc9..6380f75a8960bb 100644 --- a/ports/clapack/remove_internal_blas.patch +++ b/ports/clapack/remove_internal_blas.patch @@ -7,7 +7,7 @@ index 320ccc6..284e9d3 100755 project(CLAPACK C) -enable_testing() -include(CTest) -+find_package(OpenBLAS REQUIRED) ++find_package(BLAS REQUIRED) if(WIN32 AND NOT CYGWIN) set(SECOND_SRC ${CLAPACK_SOURCE_DIR}/INSTALL/winsecond.c) diff --git a/ports/clapack/vcpkg-cmake-wrapper.cmake b/ports/clapack/vcpkg-cmake-wrapper.cmake index 0d9b5f7403968c..7e15da59ce7ee4 100644 --- a/ports/clapack/vcpkg-cmake-wrapper.cmake +++ b/ports/clapack/vcpkg-cmake-wrapper.cmake @@ -6,8 +6,8 @@ if(UNIX) endif() if(NOT F2C_LIBRARY) - find_library(F2C_LIBRARY_RELEASE NAMES libf2c) - find_library(F2C_LIBRARY_DEBUG NAMES libf2cd) + find_library(F2C_LIBRARY_RELEASE NAMES f2c) + find_library(F2C_LIBRARY_DEBUG NAMES f2cd) select_library_configurations(F2C) endif() @@ -46,4 +46,5 @@ if(LAPACK_LIBRARIES AND F2C_LIBRARIES AND LAPACK_INCLUDE_DIRS AND F2C_INCLUDE_DI set(CLAPACK_FOUND TRUE CACHE BOOL "" FORCE) set(LAPACK_FOUND TRUE CACHE BOOL "" FORCE) set(F2C_FOUND TRUE CACHE BOOL "" FORCE) + message(STATUS "Found LAPACK (include: ${LAPACK_INCLUDE_DIRS}, libs: ${LAPACK_LIBRARIES})") endif() diff --git a/ports/mlpack/CONTROL b/ports/mlpack/CONTROL index d57aa4ca3eaf4c..17835a6aa64d94 100644 --- a/ports/mlpack/CONTROL +++ b/ports/mlpack/CONTROL @@ -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 +Build-Depends: openblas (!osx), clapack, boost, armadillo Feature: tools Description: Build command-line executables and tests. diff --git a/ports/openblas/portfile.cmake b/ports/openblas/portfile.cmake index d1ba5207fee410..e0387c95f6ee90 100644 --- a/ports/openblas/portfile.cmake +++ b/ports/openblas/portfile.cmake @@ -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 = -# VCPKG_TARGET_ARCHITECTURE = target architecture (x64, x86, arm) -# - include(vcpkg_common_functions) if(NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") @@ -88,6 +76,7 @@ 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 From 485cdeb68fe01435faddf6d1630d08d713c168ff Mon Sep 17 00:00:00 2001 From: Stefano Sinigardi Date: Wed, 15 May 2019 23:07:16 +0200 Subject: [PATCH 12/34] [Accelerate] use best framework when available --- ports/blaze/CONTROL | 2 +- ports/ceres/CONTROL | 2 +- ports/dlib/CONTROL | 2 +- ports/ensmallen/CONTROL | 5 ++--- ports/g2o/CONTROL | 2 +- ports/geogram/CONTROL | 2 +- ports/mlpack/CONTROL | 2 +- ports/shogun/CONTROL | 2 +- 8 files changed, 9 insertions(+), 10 deletions(-) diff --git a/ports/blaze/CONTROL b/ports/blaze/CONTROL index 89af7e7d34c957..c70a72a6c3fab7 100644 --- a/ports/blaze/CONTROL +++ b/ports/blaze/CONTROL @@ -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. diff --git a/ports/ceres/CONTROL b/ports/ceres/CONTROL index a1dffa1c419b9a..47ae7051e5a520 100644 --- a/ports/ceres/CONTROL +++ b/ports/ceres/CONTROL @@ -4,7 +4,7 @@ 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 diff --git a/ports/dlib/CONTROL b/ports/dlib/CONTROL index 02560b26da7fd6..fe76fb54cc4c64 100644 --- a/ports/dlib/CONTROL +++ b/ports/dlib/CONTROL @@ -1,6 +1,6 @@ Source: dlib Version: 19.16-3 -Build-Depends: libjpeg-turbo, libpng, sqlite3, fftw3, openblas (!osx), clapack +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++ Feature: cuda diff --git a/ports/ensmallen/CONTROL b/ports/ensmallen/CONTROL index e2ed02e4ac2eec..4d8ce960c5ed4c 100644 --- a/ports/ensmallen/CONTROL +++ b/ports/ensmallen/CONTROL @@ -1,5 +1,4 @@ Source: ensmallen -Version: 1.14.3 +Version: 1.14.3 Description: A header-only C++ library for mathematical optimization. -Build-Depends: openblas, clapack, armadillo - +Build-Depends: openblas (!osx), clapack (!osx), armadillo diff --git a/ports/g2o/CONTROL b/ports/g2o/CONTROL index 57999aece05f48..9bc511479cfe7a 100644 --- a/ports/g2o/CONTROL +++ b/ports/g2o/CONTROL @@ -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 diff --git a/ports/geogram/CONTROL b/ports/geogram/CONTROL index 87688018b90ae0..1a3daf4f9779bd 100644 --- a/ports/geogram/CONTROL +++ b/ports/geogram/CONTROL @@ -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. diff --git a/ports/mlpack/CONTROL b/ports/mlpack/CONTROL index 17835a6aa64d94..61e83e9408660e 100644 --- a/ports/mlpack/CONTROL +++ b/ports/mlpack/CONTROL @@ -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 (!osx), clapack, boost, armadillo +Build-Depends: openblas (!osx), clapack (!osx), boost, armadillo Feature: tools Description: Build command-line executables and tests. diff --git a/ports/shogun/CONTROL b/ports/shogun/CONTROL index 5188892da1fbdd..d9435af1f1f3a8 100644 --- a/ports/shogun/CONTROL +++ b/ports/shogun/CONTROL @@ -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 +Build-Depends: bzip2, eigen3, liblzma, libxml2, openblas (x64&!osx), nlopt, rxcpp, snappy, zlib, protobuf, curl, lzo, dirent Description: Unified and efficient Machine Learning From e6f56b86010d732123337604efe7d159c8a1c40c Mon Sep 17 00:00:00 2001 From: Stefano Sinigardi Date: Fri, 17 May 2019 10:16:37 +0200 Subject: [PATCH 13/34] [clapack] separate config from wrapper --- ports/clapack/CONTROL | 2 +- ports/clapack/lapack-config.cmake | 186 ++++++++++++++++++ ports/clapack/openblas_linux.patch | 12 ++ ports/clapack/portfile.cmake | 13 +- .../clapack/vcpkg-cmake-wrapper-clapack.cmake | 3 - ports/clapack/vcpkg-cmake-wrapper.cmake | 54 +---- 6 files changed, 211 insertions(+), 59 deletions(-) create mode 100644 ports/clapack/lapack-config.cmake create mode 100644 ports/clapack/openblas_linux.patch delete mode 100644 ports/clapack/vcpkg-cmake-wrapper-clapack.cmake diff --git a/ports/clapack/CONTROL b/ports/clapack/CONTROL index 70d42f2b9ec37b..9cdebdf74ab0a5 100644 --- a/ports/clapack/CONTROL +++ b/ports/clapack/CONTROL @@ -1,4 +1,4 @@ Source: clapack -Version: 3.2.1-5 +Version: 3.2.1-6 Description: CLAPACK (f2c'ed version of LAPACK) Build-Depends: openblas (!osx) diff --git a/ports/clapack/lapack-config.cmake b/ports/clapack/lapack-config.cmake new file mode 100644 index 00000000000000..84923c5e60334f --- /dev/null +++ b/ports/clapack/lapack-config.cmake @@ -0,0 +1,186 @@ +#.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) + find_library(F2C_LIBRARY_DEBUG NAMES f2cd) + select_library_configurations(F2C) +endif() + +if(NOT LAPACK_LIBRARY) + find_library(LAPACK_LIBRARY_RELEASE NAMES lapack) + find_library(LAPACK_LIBRARY_DEBUG NAMES lapackd) + select_library_configurations(LAPACK) +endif() + +list(APPEND LAPACK_LIBRARY ${F2C_LIBRARY}) +list(APPEND LAPACK_LIBRARY ${ADDITIONAL_LAPACK_LIBRARY}) + +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() diff --git a/ports/clapack/openblas_linux.patch b/ports/clapack/openblas_linux.patch new file mode 100644 index 00000000000000..e2b7b6e8286c46 --- /dev/null +++ b/ports/clapack/openblas_linux.patch @@ -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) diff --git a/ports/clapack/portfile.cmake b/ports/clapack/portfile.cmake index 17c39e6134e949..409b8812b2a7b9 100644 --- a/ports/clapack/portfile.cmake +++ b/ports/clapack/portfile.cmake @@ -8,11 +8,16 @@ vcpkg_download_distfile(ARCHIVE 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 remove_internal_blas.patch + ${ADDITIONAL_PATCH} ) vcpkg_configure_cmake( @@ -25,14 +30,12 @@ vcpkg_configure_cmake( vcpkg_install_cmake() vcpkg_copy_pdbs() -#TODO: fix the exported targets, since they are broken. +#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 does not accept clapack as a valid library, unfortunately... +#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) - -#we also intercept any call to FindCLAPACK redirecting it to our FindLAPACK -file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper-clapack.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/clapack RENAME vcpkg-cmake-wrapper.cmake) +file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/lapack-config.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/lapack) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) diff --git a/ports/clapack/vcpkg-cmake-wrapper-clapack.cmake b/ports/clapack/vcpkg-cmake-wrapper-clapack.cmake deleted file mode 100644 index 5f44bc8dc14d1c..00000000000000 --- a/ports/clapack/vcpkg-cmake-wrapper-clapack.cmake +++ /dev/null @@ -1,3 +0,0 @@ -include(${CMAKE_ROOT}/Modules/CMakeFindDependencyMacro.cmake) - -find_dependency(LAPACK) diff --git a/ports/clapack/vcpkg-cmake-wrapper.cmake b/ports/clapack/vcpkg-cmake-wrapper.cmake index 7e15da59ce7ee4..8a792cf9615e93 100644 --- a/ports/clapack/vcpkg-cmake-wrapper.cmake +++ b/ports/clapack/vcpkg-cmake-wrapper.cmake @@ -1,50 +1,4 @@ -include(${CMAKE_ROOT}/Modules/SelectLibraryConfigurations.cmake) -include(${CMAKE_ROOT}/Modules/CheckSymbolExists.cmake) - -if(UNIX) - find_library(ADDITIONAL_LAPACK_LIBRARY m) -endif() - -if(NOT F2C_LIBRARY) - find_library(F2C_LIBRARY_RELEASE NAMES f2c) - find_library(F2C_LIBRARY_DEBUG NAMES f2cd) - select_library_configurations(F2C) -endif() - -if(NOT LAPACK_LIBRARY) - find_library(LAPACK_LIBRARY_RELEASE NAMES lapack) - find_library(LAPACK_LIBRARY_DEBUG NAMES lapackd) - select_library_configurations(LAPACK) -endif() - -list(APPEND LAPACK_LIBRARY ${F2C_LIBRARY}) -list(APPEND LAPACK_LIBRARY ${ADDITIONAL_LAPACK_LIBRARY}) - -set(F2C_LIBRARIES "${F2C_LIBRARY}" 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) - -#check_symbol_exists(cheev_ clapack.h HAVE_CHEEV_) -#check_symbol_exists(cheev clapack.h HAVE_CHEEV) - -if(LAPACK_LIBRARIES AND F2C_LIBRARIES AND LAPACK_INCLUDE_DIRS AND F2C_INCLUDE_DIRS) - set(CLAPACK_FOUND TRUE CACHE BOOL "" FORCE) - set(LAPACK_FOUND TRUE CACHE BOOL "" FORCE) - set(F2C_FOUND TRUE CACHE BOOL "" FORCE) - message(STATUS "Found LAPACK (include: ${LAPACK_INCLUDE_DIRS}, libs: ${LAPACK_LIBRARIES})") -endif() +set(LAPACK_PREV_MODULE_PATH ${CMAKE_MODULE_PATH}) +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) +_find_package(${ARGS} CONFIG) +set(CMAKE_MODULE_PATH ${LAPACK_PREV_MODULE_PATH}) From 46204e1c8fb8d09f9d575b0e3f476da6abd0ccf2 Mon Sep 17 00:00:00 2001 From: Stefano Sinigardi Date: Sat, 18 May 2019 17:34:24 +0200 Subject: [PATCH 14/34] [clapack] fix paths and filenames --- ports/clapack/lapack-config.cmake | 4 ++-- ports/clapack/remove_internal_blas.patch | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/clapack/lapack-config.cmake b/ports/clapack/lapack-config.cmake index 84923c5e60334f..bbcf236a5bfaf2 100644 --- a/ports/clapack/lapack-config.cmake +++ b/ports/clapack/lapack-config.cmake @@ -74,8 +74,8 @@ if(UNIX) endif() if(NOT F2C_LIBRARY) - find_library(F2C_LIBRARY_RELEASE NAMES f2c) - find_library(F2C_LIBRARY_DEBUG NAMES f2cd) + find_library(F2C_LIBRARY_RELEASE NAMES f2c libf2c) + find_library(F2C_LIBRARY_DEBUG NAMES f2cd libf2cd) select_library_configurations(F2C) endif() diff --git a/ports/clapack/remove_internal_blas.patch b/ports/clapack/remove_internal_blas.patch index 6380f75a8960bb..471d87a87aa6fa 100644 --- a/ports/clapack/remove_internal_blas.patch +++ b/ports/clapack/remove_internal_blas.patch @@ -40,8 +40,8 @@ index 320ccc6..284e9d3 100755 - ${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 ++ ${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 From fdf6085a84c1051a506c31e6a5d07aa80fae1a53 Mon Sep 17 00:00:00 2001 From: Stefano Sinigardi Date: Sun, 19 May 2019 18:50:02 +0200 Subject: [PATCH 15/34] [mlpack,armadillo,clapack] improve library handling --- ports/armadillo/CONTROL | 3 +- ports/armadillo/portfile.cmake | 64 +++++++------ ports/armadillo/remove_custom_modules.patch | 17 ++++ .../{lapack-config.cmake => FindLAPACK.cmake} | 16 +++- ports/clapack/portfile.cmake | 2 +- ports/clapack/vcpkg-cmake-wrapper.cmake | 2 +- ports/mlpack/CONTROL | 14 +-- ports/mlpack/cmakelists.patch | 96 +++++++++++-------- ports/mlpack/portfile.cmake | 35 ++++--- 9 files changed, 154 insertions(+), 95 deletions(-) create mode 100644 ports/armadillo/remove_custom_modules.patch rename ports/clapack/{lapack-config.cmake => FindLAPACK.cmake} (89%) diff --git a/ports/armadillo/CONTROL b/ports/armadillo/CONTROL index d8edd620e4ed16..a162b1ced3a4fc 100644 --- a/ports/armadillo/CONTROL +++ b/ports/armadillo/CONTROL @@ -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) diff --git a/ports/armadillo/portfile.cmake b/ports/armadillo/portfile.cmake index 172984712d7495..6b9b3790ac3a1c 100644 --- a/ports/armadillo/portfile.cmake +++ b/ports/armadillo/portfile.cmake @@ -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) diff --git a/ports/armadillo/remove_custom_modules.patch b/ports/armadillo/remove_custom_modules.patch new file mode 100644 index 00000000000000..0723dbeb549ff1 --- /dev/null +++ b/ports/armadillo/remove_custom_modules.patch @@ -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}" ) diff --git a/ports/clapack/lapack-config.cmake b/ports/clapack/FindLAPACK.cmake similarity index 89% rename from ports/clapack/lapack-config.cmake rename to ports/clapack/FindLAPACK.cmake index bbcf236a5bfaf2..dfbf2c73eec34b 100644 --- a/ports/clapack/lapack-config.cmake +++ b/ports/clapack/FindLAPACK.cmake @@ -76,17 +76,22 @@ 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 ${F2C_LIBRARY}) -list(APPEND LAPACK_LIBRARY ${ADDITIONAL_LAPACK_LIBRARY}) +list(APPEND LAPACK_LIBRARY ${BLAS_LIBRARIES}) set(F2C_LIBRARIES "${F2C_LIBRARY}" CACHE STRING "" FORCE) set(LAPACK_VERSION "${CLAPACK_VERSION}" CACHE STRING "" FORCE) @@ -184,3 +189,10 @@ if( CLAPACK_FOUND AND NOT TARGET lapack ) 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) diff --git a/ports/clapack/portfile.cmake b/ports/clapack/portfile.cmake index 409b8812b2a7b9..ecdf51c87af4a2 100644 --- a/ports/clapack/portfile.cmake +++ b/ports/clapack/portfile.cmake @@ -35,7 +35,7 @@ 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}/lapack-config.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) diff --git a/ports/clapack/vcpkg-cmake-wrapper.cmake b/ports/clapack/vcpkg-cmake-wrapper.cmake index 8a792cf9615e93..69c54ea0da1b14 100644 --- a/ports/clapack/vcpkg-cmake-wrapper.cmake +++ b/ports/clapack/vcpkg-cmake-wrapper.cmake @@ -1,4 +1,4 @@ set(LAPACK_PREV_MODULE_PATH ${CMAKE_MODULE_PATH}) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) -_find_package(${ARGS} CONFIG) +_find_package(${ARGS}) set(CMAKE_MODULE_PATH ${LAPACK_PREV_MODULE_PATH}) diff --git a/ports/mlpack/CONTROL b/ports/mlpack/CONTROL index 61e83e9408660e..75cc21eb4fdd83 100644 --- a/ports/mlpack/CONTROL +++ b/ports/mlpack/CONTROL @@ -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 (!osx), clapack (!osx), 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. diff --git a/ports/mlpack/cmakelists.patch b/ports/mlpack/cmakelists.patch index 6c39a429383b51..a4ef8f119c0748 100644 --- a/ports/mlpack/cmakelists.patch +++ b/ports/mlpack/cmakelists.patch @@ -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 diff --git a/ports/mlpack/portfile.cmake b/ports/mlpack/portfile.cmake index c7bf89bc141a9c..3eaa1482479046 100644 --- a/ports/mlpack/portfile.cmake +++ b/ports/mlpack/portfile.cmake @@ -6,12 +6,23 @@ 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) set(BUILD_TOOLS ON) @@ -20,10 +31,10 @@ 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} + -DBUILD_SHARED_LIBS=${MLPACK_SHARED_LIBS} ) vcpkg_install_cmake() vcpkg_copy_pdbs() @@ -31,12 +42,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) From 8424c9d9f27b217d1c464833e91f37e8b345a3f7 Mon Sep 17 00:00:00 2001 From: Stefano Sinigardi Date: Mon, 20 May 2019 17:04:38 +0200 Subject: [PATCH 16/34] [mlpack] remove unnecessary cmake option --- ports/mlpack/portfile.cmake | 3 --- 1 file changed, 3 deletions(-) diff --git a/ports/mlpack/portfile.cmake b/ports/mlpack/portfile.cmake index 3eaa1482479046..20cbc882e38951 100644 --- a/ports/mlpack/portfile.cmake +++ b/ports/mlpack/portfile.cmake @@ -10,8 +10,6 @@ vcpkg_from_github( 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) @@ -34,7 +32,6 @@ vcpkg_configure_cmake( OPTIONS -DBUILD_TESTS=${BUILD_TOOLS} -DBUILD_CLI_EXECUTABLES=${BUILD_TOOLS} - -DBUILD_SHARED_LIBS=${MLPACK_SHARED_LIBS} ) vcpkg_install_cmake() vcpkg_copy_pdbs() From 92cf8d323df877f9593c2d9bda7851b2b714a3e3 Mon Sep 17 00:00:00 2001 From: Stefano Sinigardi Date: Tue, 21 May 2019 12:07:58 +0200 Subject: [PATCH 17/34] [clp,coinutils,osi,liblemon] dependencies of openmvg, improve compatibility with non-win32 --- ports/clp/CMakeLists.txt | 276 ++++++++++++++++----------------- ports/clp/CONTROL | 8 +- ports/clp/Config.cmake.in | 10 +- ports/clp/portfile.cmake | 4 +- ports/coinutils/CMakeLists.txt | 72 ++++----- ports/coinutils/CONTROL | 2 +- ports/coinutils/portfile.cmake | 4 +- ports/liblemon/CONTROL | 6 +- ports/liblemon/portfile.cmake | 1 + ports/osi/CMakeLists.txt | 201 +++++++++++------------- ports/osi/CONTROL | 8 +- ports/osi/Config.cmake.in | 10 +- ports/osi/portfile.cmake | 3 +- ports/sophus/CONTROL | 2 +- 14 files changed, 295 insertions(+), 312 deletions(-) diff --git a/ports/clp/CMakeLists.txt b/ports/clp/CMakeLists.txt index 86305aa580fcbf..78f41fb40b9dd5 100644 --- a/ports/clp/CMakeLists.txt +++ b/ports/clp/CMakeLists.txt @@ -1,139 +1,137 @@ -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: * /lib*/cmake/ * -# /lib*/ * /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 $) -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 'ConfigVersion.cmake' Use: * PROJECT_VERSION -write_basic_package_version_file("${version_config}" - COMPATIBILITY SameMajorVersion) - -# Configure 'Config.cmake' Use variables: * TARGETS_EXPORT_NAME * -# PROJECT_NAME -configure_package_config_file("Config.cmake.in" - "${project_config}" - INSTALL_DESTINATION - "${config_install_dir}") - -# Config * /lib/cmake/Foo/FooConfig.cmake * -# /lib/cmake/Foo/FooConfigVersion.cmake -install(FILES "${project_config}" "${version_config}" - DESTINATION "${config_install_dir}") - -# Config * /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) + +# Introduce variables: * CMAKE_INSTALL_LIBDIR * CMAKE_INSTALL_BINDIR +include(GNUInstallDirs) +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(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" 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) +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() + +# Include module with fuction 'write_basic_package_version_file' +include(CMakePackageConfigHelpers) + +set(config_install_dir "${INSTALL_CMAKE_DIR}") +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) + +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 + $ + $ + $) + +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(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) + +write_basic_package_version_file("${version_config}" + COMPATIBILITY SameMajorVersion) + +# Configure 'Config.cmake' Use variables: * TARGETS_EXPORT_NAME * +configure_package_config_file("Config.cmake.in" + "${project_config}" + INSTALL_DESTINATION + "${config_install_dir}") + +install(FILES "${project_config}" "${version_config}" + DESTINATION "${config_install_dir}") + +install(EXPORT "${TARGETS_EXPORT_NAME}" + NAMESPACE "${namespace}" + DESTINATION "${config_install_dir}") diff --git a/ports/clp/CONTROL b/ports/clp/CONTROL index e19909f3510b8f..b920c1b354b0dc 100644 --- a/ports/clp/CONTROL +++ b/ports/clp/CONTROL @@ -1,4 +1,4 @@ -Source: clp -Version: 1.16.11-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 +Source: clp +Version: 1.16.11-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 diff --git a/ports/clp/Config.cmake.in b/ports/clp/Config.cmake.in index ec01d2e5bd9501..a53c5749598794 100644 --- a/ports/clp/Config.cmake.in +++ b/ports/clp/Config.cmake.in @@ -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}/@TARGETS_EXPORT_NAME@.cmake") +check_required_components("@PROJECT_NAME@") diff --git a/ports/clp/portfile.cmake b/ports/clp/portfile.cmake index f43dc295d2a484..c373bbcc07fe13 100644 --- a/ports/clp/portfile.cmake +++ b/ports/clp/portfile.cmake @@ -19,8 +19,8 @@ vcpkg_configure_cmake( vcpkg_install_cmake() vcpkg_copy_pdbs() +vcpkg_fixup_cmake_targets(CONFIG_PATH share/Clp) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -vcpkg_fixup_cmake_targets(CONFIG_PATH "lib/cmake/Clp") -# Handle copyright file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/clp RENAME copyright) diff --git a/ports/coinutils/CMakeLists.txt b/ports/coinutils/CMakeLists.txt index 1a090c94d284c3..717398b4fa4796 100644 --- a/ports/coinutils/CMakeLists.txt +++ b/ports/coinutils/CMakeLists.txt @@ -8,17 +8,33 @@ set(PROJECT_VERSION_MINOR 10) set(PROJECT_VERSION_PATCH 14) set(CMAKE_CXX_STANDARD 14) + +# Introduce variables: * CMAKE_INSTALL_LIBDIR * CMAKE_INSTALL_BINDIR +include(GNUInstallDirs) 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" 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) +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,25 +42,20 @@ if(APPLE) ) set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9" CACHE STRING "Minimum OS X deployment version") -endif(APPLE) - -set_property(GLOBAL PROPERTY USE_FOLDERS ON) - -# options -option(BUILD_SHARED_LIBS "" ON) - -# -# 设置用于 install 的变量 -# -# Introduce variables: * CMAKE_INSTALL_LIBDIR * CMAKE_INSTALL_BINDIR -include(GNUInstallDirs) +endif() # Include module with fuction 'write_basic_package_version_file' include(CMakePackageConfigHelpers) -# Layout. This works for all platforms: * /lib*/cmake/ * -# /lib*/ * /include/ -set(config_install_dir "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}") +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() + +set(config_install_dir "${INSTALL_CMAKE_DIR}") set(generated_dir "${CMAKE_CURRENT_BINARY_DIR}/generated") # Configuration set(version_config "${generated_dir}/${PROJECT_NAME}ConfigVersion.cmake") @@ -52,23 +63,19 @@ set(project_config "${generated_dir}/${PROJECT_NAME}Config.cmake") set(TARGETS_EXPORT_NAME "${PROJECT_NAME}Targets") set(namespace "Coin::") -# -# Add sources -# -include_directories(CoinUtils/src) - file(GLOB UTILS_SOURCES CoinUtils/src/*.hpp CoinUtils/src/*.cpp CoinUtils/src/*.h) + add_library(${PROJECT_NAME} ${UTILS_SOURCES}) -target_include_directories(${PROJECT_NAME} - PUBLIC $) -target_compile_definitions(${PROJECT_NAME} - PUBLIC - $ - $) +target_include_directories(${PROJECT_NAME} PUBLIC $ $) + +if(MSVC) + target_compile_definitions(${PROJECT_NAME} PRIVATE _CRT_SECURE_NO_WARNINGS) +endif() +target_compile_definitions(${PROJECT_NAME} PRIVATE HAVE_CMATH HAVE_CFLOAT) install(TARGETS ${PROJECT_NAME} EXPORT "${TARGETS_EXPORT_NAME}" @@ -84,26 +91,19 @@ install(DIRECTORY CoinUtils/src/ PATTERN "*.h" PATTERN "*.hpp") -# -# Install Libraries -# # Configure 'ConfigVersion.cmake' Use: * PROJECT_VERSION write_basic_package_version_file("${version_config}" COMPATIBILITY SameMajorVersion) -# Configure 'Config.cmake' Use variables: * TARGETS_EXPORT_NAME * -# PROJECT_NAME +# Configure 'Config.cmake' Use variables: * TARGETS_EXPORT_NAME * PROJECT_NAME configure_package_config_file("Config.cmake.in" "${project_config}" INSTALL_DESTINATION "${config_install_dir}") -# Config * /lib/cmake/Foo/FooConfig.cmake * -# /lib/cmake/Foo/FooConfigVersion.cmake install(FILES "${project_config}" "${version_config}" DESTINATION "${config_install_dir}") -# Config * /lib/cmake/Foo/FooTargets.cmake install(EXPORT "${TARGETS_EXPORT_NAME}" NAMESPACE "${namespace}" DESTINATION "${config_install_dir}") diff --git a/ports/coinutils/CONTROL b/ports/coinutils/CONTROL index f20222532f1962..895f4c6c84ea2a 100644 --- a/ports/coinutils/CONTROL +++ b/ports/coinutils/CONTROL @@ -1,3 +1,3 @@ Source: coinutils -Version: 2.10.14-1 +Version: 2.10.14-2 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 diff --git a/ports/coinutils/portfile.cmake b/ports/coinutils/portfile.cmake index 7b9a86b85f802b..6206bb7ef1212b 100644 --- a/ports/coinutils/portfile.cmake +++ b/ports/coinutils/portfile.cmake @@ -19,10 +19,8 @@ vcpkg_configure_cmake( vcpkg_install_cmake() vcpkg_copy_pdbs() - -vcpkg_fixup_cmake_targets(CONFIG_PATH "lib/cmake/CoinUtils") +vcpkg_fixup_cmake_targets(CONFIG_PATH share/CoinUtils) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -# Handle copyright file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/coinutils RENAME copyright) diff --git a/ports/liblemon/CONTROL b/ports/liblemon/CONTROL index c21960b72abf2f..87234c68ae753d 100644 --- a/ports/liblemon/CONTROL +++ b/ports/liblemon/CONTROL @@ -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 diff --git a/ports/liblemon/portfile.cmake b/ports/liblemon/portfile.cmake index b41322a8759492..1fe64d3fecb816 100644 --- a/ports/liblemon/portfile.cmake +++ b/ports/liblemon/portfile.cmake @@ -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 diff --git a/ports/osi/CMakeLists.txt b/ports/osi/CMakeLists.txt index 7f4ca5ed1ba4e4..46b6a6f19e6838 100644 --- a/ports/osi/CMakeLists.txt +++ b/ports/osi/CMakeLists.txt @@ -1,108 +1,93 @@ -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: * /lib*/cmake/ * -# /lib*/ * /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 $) -target_compile_definitions(${PROJECT_NAME} - PUBLIC - $ - $) -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 'ConfigVersion.cmake' Use: * PROJECT_VERSION -write_basic_package_version_file("${version_config}" - COMPATIBILITY SameMajorVersion) - -# Configure 'Config.cmake' Use variables: * TARGETS_EXPORT_NAME * -# PROJECT_NAME -configure_package_config_file("Config.cmake.in" - "${project_config}" - INSTALL_DESTINATION - "${config_install_dir}") - -# Config * /lib/cmake/Foo/FooConfig.cmake * -# /lib/cmake/Foo/FooConfigVersion.cmake -install(FILES "${project_config}" "${version_config}" - DESTINATION "${config_install_dir}") - -# Config * /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) + +# Introduce variables: * CMAKE_INSTALL_LIBDIR * CMAKE_INSTALL_BINDIR +include(GNUInstallDirs) +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(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" CACHE PATH "Path where headers will be installed") +set(INSTALL_CMAKE_DIR "share/${PROJECT_NAME}" CACHE PATH "Path where cmake configs will be installed") + +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) + +include(CMakePackageConfigHelpers) + +set(config_install_dir "${INSTALL_CMAKE_DIR}") +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::") + +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 $ $) + +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(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) + +# Configure 'ConfigVersion.cmake' Use: * PROJECT_VERSION +write_basic_package_version_file("${version_config}" + COMPATIBILITY SameMajorVersion) + +# Configure 'Config.cmake' Use variables: * TARGETS_EXPORT_NAME * PROJECT_NAME +configure_package_config_file("Config.cmake.in" + "${project_config}" + INSTALL_DESTINATION + "${config_install_dir}") + +install(FILES "${project_config}" "${version_config}" + DESTINATION "${config_install_dir}") + +install(EXPORT "${TARGETS_EXPORT_NAME}" + NAMESPACE "${namespace}" + DESTINATION "${config_install_dir}") diff --git a/ports/osi/CONTROL b/ports/osi/CONTROL index 98cfbdcadf5adb..093d8fdd295273 100644 --- a/ports/osi/CONTROL +++ b/ports/osi/CONTROL @@ -1,4 +1,4 @@ -Source: osi -Version: 0.107.9-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 +Source: osi +Version: 0.107.9-2 +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 diff --git a/ports/osi/Config.cmake.in b/ports/osi/Config.cmake.in index ec01d2e5bd9501..a53c5749598794 100644 --- a/ports/osi/Config.cmake.in +++ b/ports/osi/Config.cmake.in @@ -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}/@TARGETS_EXPORT_NAME@.cmake") +check_required_components("@PROJECT_NAME@") diff --git a/ports/osi/portfile.cmake b/ports/osi/portfile.cmake index 8c890581c4ceee..a32327d74c8ae7 100644 --- a/ports/osi/portfile.cmake +++ b/ports/osi/portfile.cmake @@ -19,8 +19,9 @@ vcpkg_configure_cmake( vcpkg_install_cmake() vcpkg_copy_pdbs() +vcpkg_fixup_cmake_targets(CONFIG_PATH "share/Osi") + 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) diff --git a/ports/sophus/CONTROL b/ports/sophus/CONTROL index f6433e410ffd65..e7e8ca31bb83d1 100644 --- a/ports/sophus/CONTROL +++ b/ports/sophus/CONTROL @@ -1,4 +1,4 @@ Source: sophus Version: 1.0.0-1 -Build-Depends: eigen3, ceres +Build-Depends: eigen3, ceres, suitesparse Description: Lie group library for C++ From 99a72c96c90d474ce07cbb565fb07fecc1bcfa87 Mon Sep 17 00:00:00 2001 From: Stefano Sinigardi Date: Tue, 21 May 2019 12:23:53 +0200 Subject: [PATCH 18/34] [openmvg] fix for case-sensitive filesystems --- ports/openmvg/CONTROL | 2 +- ports/openmvg/fixcmake.patch | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/openmvg/CONTROL b/ports/openmvg/CONTROL index 5006dc8dd4e170..9d35fc30a37448 100644 --- a/ports/openmvg/CONTROL +++ b/ports/openmvg/CONTROL @@ -1,5 +1,5 @@ Source: openmvg -Version: 1.4-2 +Version: 1.4-3 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 diff --git a/ports/openmvg/fixcmake.patch b/ports/openmvg/fixcmake.patch index 66eff4fd335bdb..0ba73961bc7f1e 100644 --- a/ports/openmvg/fixcmake.patch +++ b/ports/openmvg/fixcmake.patch @@ -218,7 +218,7 @@ 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 From 8efcb8ade06c2e8711ac045b01cf6c23cd2a3ec5 Mon Sep 17 00:00:00 2001 From: Stefano Sinigardi Date: Tue, 21 May 2019 15:15:17 +0200 Subject: [PATCH 19/34] [clp,coinutils,osi] simplify CMakeLists removing many unnecessary steps --- ports/clp/CMakeLists.txt | 68 ++++++++++++------------------- ports/clp/CONTROL | 2 +- ports/clp/Config.cmake.in | 2 +- ports/clp/portfile.cmake | 6 ++- ports/coinutils/CMakeLists.txt | 60 +++++++++++---------------- ports/coinutils/CONTROL | 2 +- ports/coinutils/Config.cmake.in | 2 +- ports/coinutils/portfile.cmake | 6 ++- ports/osi/CMakeLists.txt | 72 ++++++++++++++++----------------- ports/osi/CONTROL | 2 +- ports/osi/Config.cmake.in | 2 +- ports/osi/portfile.cmake | 6 ++- 12 files changed, 104 insertions(+), 126 deletions(-) diff --git a/ports/clp/CMakeLists.txt b/ports/clp/CMakeLists.txt index 78f41fb40b9dd5..94f6559d98c850 100644 --- a/ports/clp/CMakeLists.txt +++ b/ports/clp/CMakeLists.txt @@ -9,18 +9,13 @@ set(PROJECT_VERSION_PATCH 11) set(CMAKE_CXX_STANDARD 14) -# Introduce variables: * CMAKE_INSTALL_LIBDIR * CMAKE_INSTALL_BINDIR -include(GNUInstallDirs) -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(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" CACHE PATH "Path where headers will be installed") -set(INSTALL_CMAKE_DIR "share/${PROJECT_NAME}" CACHE PATH "Path where cmake configs will be installed") +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}}") @@ -44,18 +39,6 @@ if(APPLE) CACHE STRING "Minimum OS X deployment version") endif() -# Include module with fuction 'write_basic_package_version_file' -include(CMakePackageConfigHelpers) - -set(config_install_dir "${INSTALL_CMAKE_DIR}") -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) @@ -84,7 +67,7 @@ add_library(${PROJECT_NAME} ${CLP_SOURCES}) target_include_directories(${PROJECT_NAME} PUBLIC - $ + $ $ $) @@ -96,42 +79,43 @@ target_compile_definitions(${PROJECT_NAME} PUBLIC COIN_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 + DESTINATION ${INSTALL_INCLUDE_DIR} FILES_MATCHING PATTERN "*.h" PATTERN "*.hpp" - PATTERN "config_default.h" - EXCLUDE) + PATTERN "config_default.h" EXCLUDE) install(DIRECTORY Clp/src/OsiClp/ - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/coin + DESTINATION ${INSTALL_INCLUDE_DIR} FILES_MATCHING PATTERN "*.h" PATTERN "*.hpp" - PATTERN "config_default.h" - EXCLUDE) + 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 'Config.cmake' Use variables: * TARGETS_EXPORT_NAME * configure_package_config_file("Config.cmake.in" "${project_config}" INSTALL_DESTINATION - "${config_install_dir}") + "${INSTALL_CMAKE_DIR}") install(FILES "${project_config}" "${version_config}" - DESTINATION "${config_install_dir}") + DESTINATION "${INSTALL_CMAKE_DIR}") -install(EXPORT "${TARGETS_EXPORT_NAME}" +install(EXPORT "${PROJECT_NAME}Targets" NAMESPACE "${namespace}" - DESTINATION "${config_install_dir}") + DESTINATION "${INSTALL_CMAKE_DIR}") diff --git a/ports/clp/CONTROL b/ports/clp/CONTROL index b920c1b354b0dc..f1415b9ada5ae3 100644 --- a/ports/clp/CONTROL +++ b/ports/clp/CONTROL @@ -1,4 +1,4 @@ Source: clp -Version: 1.16.11-2 +Version: 1.16.11-3 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 diff --git a/ports/clp/Config.cmake.in b/ports/clp/Config.cmake.in index a53c5749598794..2c12f83f027dcf 100644 --- a/ports/clp/Config.cmake.in +++ b/ports/clp/Config.cmake.in @@ -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@") diff --git a/ports/clp/portfile.cmake b/ports/clp/portfile.cmake index c373bbcc07fe13..d694e8d266c54d 100644 --- a/ports/clp/portfile.cmake +++ b/ports/clp/portfile.cmake @@ -19,7 +19,11 @@ vcpkg_configure_cmake( vcpkg_install_cmake() vcpkg_copy_pdbs() -vcpkg_fixup_cmake_targets(CONFIG_PATH share/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) diff --git a/ports/coinutils/CMakeLists.txt b/ports/coinutils/CMakeLists.txt index 717398b4fa4796..bdaf5969b6306e 100644 --- a/ports/coinutils/CMakeLists.txt +++ b/ports/coinutils/CMakeLists.txt @@ -9,18 +9,13 @@ set(PROJECT_VERSION_PATCH 14) set(CMAKE_CXX_STANDARD 14) -# Introduce variables: * CMAKE_INSTALL_LIBDIR * CMAKE_INSTALL_BINDIR -include(GNUInstallDirs) -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(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" CACHE PATH "Path where headers will be installed") -set(INSTALL_CMAKE_DIR "share/${PROJECT_NAME}" CACHE PATH "Path where cmake configs will be installed") +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}}") @@ -44,9 +39,6 @@ if(APPLE) CACHE STRING "Minimum OS X deployment version") endif() -# Include module with fuction 'write_basic_package_version_file' -include(CMakePackageConfigHelpers) - include(CheckIncludeFileCXX) include(CheckIncludeFile) check_include_file_cxx("cmath" HAVE_CMATH) @@ -55,14 +47,6 @@ if(NOT HAVE_CMATH OR NOT HAVE_CFLOAT) message(FATAL_ERROR "Missing necessary include files, like cmath or cfloat") endif() -set(config_install_dir "${INSTALL_CMAKE_DIR}") -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::") - file(GLOB UTILS_SOURCES CoinUtils/src/*.hpp CoinUtils/src/*.cpp @@ -70,40 +54,42 @@ file(GLOB UTILS_SOURCES add_library(${PROJECT_NAME} ${UTILS_SOURCES}) -target_include_directories(${PROJECT_NAME} PUBLIC $ $) +target_include_directories(${PROJECT_NAME} PUBLIC $ $) if(MSVC) target_compile_definitions(${PROJECT_NAME} PRIVATE _CRT_SECURE_NO_WARNINGS) endif() target_compile_definitions(${PROJECT_NAME} PRIVATE HAVE_CMATH HAVE_CFLOAT) -install(TARGETS ${PROJECT_NAME} - EXPORT "${TARGETS_EXPORT_NAME}" - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES - DESTINATION include) - install(DIRECTORY CoinUtils/src/ - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/coin + DESTINATION ${INSTALL_INCLUDE_DIR} FILES_MATCHING PATTERN "*.h" PATTERN "*.hpp") -# Configure '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 '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}") install(FILES "${project_config}" "${version_config}" - DESTINATION "${config_install_dir}") + DESTINATION "${INSTALL_CMAKE_DIR}") -install(EXPORT "${TARGETS_EXPORT_NAME}" +install(EXPORT "${PROJECT_NAME}Targets" NAMESPACE "${namespace}" - DESTINATION "${config_install_dir}") + DESTINATION "${INSTALL_CMAKE_DIR}") diff --git a/ports/coinutils/CONTROL b/ports/coinutils/CONTROL index 895f4c6c84ea2a..b418591f444285 100644 --- a/ports/coinutils/CONTROL +++ b/ports/coinutils/CONTROL @@ -1,3 +1,3 @@ Source: coinutils -Version: 2.10.14-2 +Version: 2.10.14-3 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 diff --git a/ports/coinutils/Config.cmake.in b/ports/coinutils/Config.cmake.in index a53c5749598794..2c12f83f027dcf 100644 --- a/ports/coinutils/Config.cmake.in +++ b/ports/coinutils/Config.cmake.in @@ -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@") diff --git a/ports/coinutils/portfile.cmake b/ports/coinutils/portfile.cmake index 6206bb7ef1212b..7bfdb3c8e969cc 100644 --- a/ports/coinutils/portfile.cmake +++ b/ports/coinutils/portfile.cmake @@ -19,7 +19,11 @@ vcpkg_configure_cmake( vcpkg_install_cmake() vcpkg_copy_pdbs() -vcpkg_fixup_cmake_targets(CONFIG_PATH share/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) diff --git a/ports/osi/CMakeLists.txt b/ports/osi/CMakeLists.txt index 46b6a6f19e6838..1aa44d262a1214 100644 --- a/ports/osi/CMakeLists.txt +++ b/ports/osi/CMakeLists.txt @@ -9,23 +9,27 @@ set(PROJECT_VERSION_PATCH 9) set(CMAKE_CXX_STANDARD 14) -# Introduce variables: * CMAKE_INSTALL_LIBDIR * CMAKE_INSTALL_BINDIR -include(GNUInstallDirs) -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(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" CACHE PATH "Path where headers will be installed") -set(INSTALL_CMAKE_DIR "share/${PROJECT_NAME}" CACHE PATH "Path where cmake configs will be installed") +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 @@ -33,17 +37,7 @@ if(APPLE) ) set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9" CACHE STRING "Minimum OS X deployment version") -endif(APPLE) - -include(CMakePackageConfigHelpers) - -set(config_install_dir "${INSTALL_CMAKE_DIR}") -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::") +endif() find_package(CoinUtils REQUIRED) @@ -51,7 +45,7 @@ file(GLOB OSI_SOURCES Osi/src/Osi/*.hpp Osi/src/Osi/*.cpp) add_library(${PROJECT_NAME} ${OSI_SOURCES}) -target_include_directories(${PROJECT_NAME} PUBLIC $ $) +target_include_directories(${PROJECT_NAME} PUBLIC $ $) if(MSVC) target_compile_definitions(${PROJECT_NAME} PRIVATE _CRT_SECURE_NO_WARNINGS) @@ -60,34 +54,36 @@ target_compile_definitions(${PROJECT_NAME} PRIVATE HAVE_CMATH) 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 + DESTINATION ${INSTALL_INCLUDE_DIR} FILES_MATCHING PATTERN "*.h" PATTERN "*.hpp" PATTERN "config_default.h" EXCLUDE) -# Configure '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 '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}") install(FILES "${project_config}" "${version_config}" - DESTINATION "${config_install_dir}") + DESTINATION "${INSTALL_CMAKE_DIR}") -install(EXPORT "${TARGETS_EXPORT_NAME}" +install(EXPORT "${PROJECT_NAME}Targets" NAMESPACE "${namespace}" - DESTINATION "${config_install_dir}") + DESTINATION "${INSTALL_CMAKE_DIR}") diff --git a/ports/osi/CONTROL b/ports/osi/CONTROL index 093d8fdd295273..983b00f9b5f184 100644 --- a/ports/osi/CONTROL +++ b/ports/osi/CONTROL @@ -1,4 +1,4 @@ Source: osi -Version: 0.107.9-2 +Version: 0.107.9-3 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 diff --git a/ports/osi/Config.cmake.in b/ports/osi/Config.cmake.in index a53c5749598794..2c12f83f027dcf 100644 --- a/ports/osi/Config.cmake.in +++ b/ports/osi/Config.cmake.in @@ -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@") diff --git a/ports/osi/portfile.cmake b/ports/osi/portfile.cmake index a32327d74c8ae7..5ecf2f0ece69c0 100644 --- a/ports/osi/portfile.cmake +++ b/ports/osi/portfile.cmake @@ -19,7 +19,11 @@ vcpkg_configure_cmake( vcpkg_install_cmake() vcpkg_copy_pdbs() -vcpkg_fixup_cmake_targets(CONFIG_PATH "share/Osi") +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) From 0f5893d00813d2ac80668dd3611cb025982c734c Mon Sep 17 00:00:00 2001 From: Victor Romero Date: Wed, 22 May 2019 16:53:42 -0700 Subject: [PATCH 20/34] [sophus] Force rebuild --- ports/sophus/CONTROL | 2 +- ports/sophus/portfile.cmake | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/ports/sophus/CONTROL b/ports/sophus/CONTROL index e7e8ca31bb83d1..8b78abc6a9a805 100644 --- a/ports/sophus/CONTROL +++ b/ports/sophus/CONTROL @@ -1,4 +1,4 @@ Source: sophus -Version: 1.0.0-1 +Version: 1.0.0-2 Build-Depends: eigen3, ceres, suitesparse Description: Lie group library for C++ diff --git a/ports/sophus/portfile.cmake b/ports/sophus/portfile.cmake index 9a45e62b876c50..3f07fab015c7d9 100644 --- a/ports/sophus/portfile.cmake +++ b/ports/sophus/portfile.cmake @@ -22,6 +22,5 @@ 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(COPY ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}/) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/${PORT}/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright) From ee9c6333b85db73fb7a7926eafd762a2f1336283 Mon Sep 17 00:00:00 2001 From: Stefano Sinigardi Date: Wed, 29 May 2019 19:32:29 +0200 Subject: [PATCH 21/34] [theia] fixes for linux, part1 --- ports/theia/CONTROL | 2 +- ports/theia/fix-external-dependencies.patch | 240 ++++++++++++++++++++ ports/theia/portfile.cmake | 9 +- 3 files changed, 246 insertions(+), 5 deletions(-) create mode 100644 ports/theia/fix-external-dependencies.patch diff --git a/ports/theia/CONTROL b/ports/theia/CONTROL index fd6d45625e9701..d2465aa7864ed9 100644 --- a/ports/theia/CONTROL +++ b/ports/theia/CONTROL @@ -1,4 +1,4 @@ Source: theia Version: 0.8-1 -Build-Depends: flann, cereal, ceres[suitesparse] (!x86), openimageio, glew, freeglut (!osx) +Build-Depends: flann, cereal, ceres[suitesparse], openimageio, glew, freeglut (!osx) Description: An open source library for multiview geometry and structure from motion diff --git a/ports/theia/fix-external-dependencies.patch b/ports/theia/fix-external-dependencies.patch new file mode 100644 index 00000000000000..9cb08413cc4e10 --- /dev/null +++ b/ports/theia/fix-external-dependencies.patch @@ -0,0 +1,240 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9c1b150..8091593 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -130,69 +130,45 @@ endif () + # GFlags. The namespace patch is borrow from Ceres Solver (see license in + # FindGflags.cmake) + 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) ++if (GFLAGS_TARGET) ++ message("-- Found Google Flags target: ${GFLAGS_TARGET} in namespace: ${GFLAGS_TARGET_NAMESPACE}::") ++ add_definitions(-DTHEIA_GFLAGS_NAMESPACE=${GFLAGS_TARGET_NAMESPACE}) ++endif () + + # 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) ++endif () ++ ++# Flann ++message("-- Check for Flann") ++find_package(Flann REQUIRED) ++if (FLANN_FOUND) ++ message("-- Found Flann: ${FLANN_INCLUDE_DIRS}") ++endif () + + # 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) ++endif () + + # 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) ++endif () + + # 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}") ++ message("-- Found SuiteSparse v${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) ++endif () + + include_directories( + include +@@ -225,24 +201,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 +231,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 +249,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 +289,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..1f2f1a5 100644 +--- a/cmake/TheiaConfig.cmake.in ++++ b/cmake/TheiaConfig.cmake.in +@@ -207,22 +207,28 @@ 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) ++message(STATUS "Found required Theia dependency: Cereal") ++list(APPEND THEIA_LIBRARIES cereal) ++ ++find_package(Flann REQUIRED) ++message(STATUS "Found required Theia dependency: Flann") ++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/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 diff --git a/ports/theia/portfile.cmake b/ports/theia/portfile.cmake index 9d12df126e5951..322a588a65247c 100644 --- a/ports/theia/portfile.cmake +++ b/ports/theia/portfile.cmake @@ -14,14 +14,15 @@ vcpkg_from_github( SHA512 2f620389c415badec36f4b44be0378fc62761dd6b2ee4cd7033b13573c372f098e248553575fb2cceb757b1ca00e86a11c67e03b6077e0a4b0f8797065746312 HEAD_REF master PATCHES - fix-cmakelists.patch + fix-external-dependencies.patch fix-vlfeat-static.patch - fix-glog-error.patch - fix-find-suitesparse.patch fix-oiio.patch - disable_applications.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} OPTIONS From 9910a6f99112e09544e2198b2b8943725fa0a27a Mon Sep 17 00:00:00 2001 From: Stefano Sinigardi Date: Wed, 29 May 2019 22:24:38 +0200 Subject: [PATCH 22/34] [io2d] remove broken sintax --- ports/io2d/portfile.cmake | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/ports/io2d/portfile.cmake b/ports/io2d/portfile.cmake index 0375a9689d3948..3411620f5e3c9c 100644 --- a/ports/io2d/portfile.cmake +++ b/ports/io2d/portfile.cmake @@ -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) From 458022aef978175ffc07e1444515cd08798f5c3d Mon Sep 17 00:00:00 2001 From: Stefano Sinigardi Date: Wed, 29 May 2019 23:15:55 +0200 Subject: [PATCH 23/34] [fontconfig] bump version to remove CI cached failure --- ports/fontconfig/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/fontconfig/CONTROL b/ports/fontconfig/CONTROL index 5d75462c58744e..ec63c3a22b4b23 100644 --- a/ports/fontconfig/CONTROL +++ b/ports/fontconfig/CONTROL @@ -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 From e0e2ad4d4e154bf536360d9bf579beb3ed0fc1cf Mon Sep 17 00:00:00 2001 From: Stefano Sinigardi Date: Thu, 30 May 2019 00:02:31 +0200 Subject: [PATCH 24/34] [theia] fixes for linux, part2 --- ports/theia/CONTROL | 2 +- ports/theia/disable_applications.patch | 13 - ports/theia/fix-cmakelists.patch | 310 ---------------- ports/theia/fix-external-dependencies.patch | 212 +++++++++-- ports/theia/fix-find-suitesparse.patch | 227 ------------ ports/theia/fix-glog-error.patch | 12 - ports/theia/fix-oiio.patch | 391 -------------------- ports/theia/fix-vlfeat-static.patch | 49 --- ports/theia/portfile.cmake | 30 +- 9 files changed, 189 insertions(+), 1057 deletions(-) delete mode 100644 ports/theia/disable_applications.patch delete mode 100644 ports/theia/fix-cmakelists.patch delete mode 100644 ports/theia/fix-find-suitesparse.patch delete mode 100644 ports/theia/fix-glog-error.patch delete mode 100644 ports/theia/fix-oiio.patch delete mode 100644 ports/theia/fix-vlfeat-static.patch diff --git a/ports/theia/CONTROL b/ports/theia/CONTROL index d2465aa7864ed9..d29e6b3fef3b6b 100644 --- a/ports/theia/CONTROL +++ b/ports/theia/CONTROL @@ -1,4 +1,4 @@ Source: theia -Version: 0.8-1 +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 diff --git a/ports/theia/disable_applications.patch b/ports/theia/disable_applications.patch deleted file mode 100644 index 9dc1bdc5c98335..00000000000000 --- a/ports/theia/disable_applications.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 09857e9..81cbd0e 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -290,7 +290,7 @@ include(OptimizeTheiaCompilerFlags) - optimizetheiacompilerflags() - - add_subdirectory(src/theia) --add_subdirectory(applications) -+#add_subdirectory(applications) - - if (BUILD_DOCUMENTATION) - message("-- Documentation building is enabled") diff --git a/ports/theia/fix-cmakelists.patch b/ports/theia/fix-cmakelists.patch deleted file mode 100644 index 674543c6875ac9..00000000000000 --- a/ports/theia/fix-cmakelists.patch +++ /dev/null @@ -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} diff --git a/ports/theia/fix-external-dependencies.patch b/ports/theia/fix-external-dependencies.patch index 9cb08413cc4e10..7a57abe0e1e0ef 100644 --- a/ports/theia/fix-external-dependencies.patch +++ b/ports/theia/fix-external-dependencies.patch @@ -1,10 +1,12 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 9c1b150..8091593 100644 +index 9c1b150..5810156 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -130,69 +130,45 @@ endif () +@@ -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}") @@ -12,54 +14,44 @@ index 9c1b150..8091593 100644 -else (GFLAGS_FOUND) - message(FATAL_ERROR "Can't find Google FLAGS.") -endif (GFLAGS_FOUND) -+if (GFLAGS_TARGET) -+ message("-- Found Google Flags target: ${GFLAGS_TARGET} in namespace: ${GFLAGS_TARGET_NAMESPACE}::") -+ add_definitions(-DTHEIA_GFLAGS_NAMESPACE=${GFLAGS_TARGET_NAMESPACE}) -+endif () # Google Logging message("-- Check for Google Log") find_package(Glog REQUIRED) - if (GLOG_FOUND) - message("-- Found Google Logging: ${GLOG_INCLUDE_DIRS}") +-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) -+endif () + +# Flann +message("-- Check for Flann") +find_package(Flann REQUIRED) -+if (FLANN_FOUND) -+ message("-- Found Flann: ${FLANN_INCLUDE_DIRS}") -+endif () # Ceres message("-- Check for Ceres") find_package(Ceres REQUIRED SuiteSparse) - if (CERES_FOUND) - message("-- Found Ceres: ${CERES_INCLUDE_DIRS}") +-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) -+endif () # OpenImageIO message("-- Check for OpenImageIO") find_package(OpenImageIO REQUIRED) - if (OPENIMAGEIO_FOUND) - message("-- Found OpenImageIO: ${OPENIMAGEIO_INCLUDE_DIRS}") +-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) -+endif () # Suitesparse find_package(SuiteSparse REQUIRED) - if (SUITESPARSE_FOUND) +-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 @@ -76,19 +68,17 @@ index 9c1b150..8091593 100644 - endif (BUILD_SHARED_LIBS AND - SUITESPARSE_IS_BROKEN_SHARED_LINKING_UBUNTU_SYSTEM_VERSION) - message("-- Found SuiteSparse ${SUITESPARSE_VERSION}") -+ message("-- Found SuiteSparse v${SUITESPARSE_VERSION}") - add_definitions(-DTHEIA_SUITESPARSE_VERSION="${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) -+endif () include_directories( include -@@ -225,24 +201,19 @@ include_directories( +@@ -225,24 +182,19 @@ include_directories( libraries/spectra ${akaze_SOURCE_DIR} ${akaze_INCLUDE_DIR} @@ -116,7 +106,7 @@ index 9c1b150..8091593 100644 if (BUILD_DOCUMENTATION) message("-- Documentation building is enabled") -@@ -260,7 +231,13 @@ install(FILES ${THEIA_HDRS} DESTINATION include/theia) +@@ -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") @@ -131,7 +121,7 @@ index 9c1b150..8091593 100644 # Add an uninstall target to remove all installed files. configure_file("${CMAKE_SOURCE_DIR}/cmake/uninstall.cmake.in" -@@ -272,17 +249,10 @@ add_custom_target(uninstall +@@ -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. @@ -153,7 +143,7 @@ index 9c1b150..8091593 100644 # 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 +289,5 @@ configure_file("${CMAKE_SOURCE_DIR}/cmake/TheiaConfigVersion.cmake.in" +@@ -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" @@ -165,19 +155,102 @@ index 9c1b150..8091593 100644 + "${CMAKE_SOURCE_DIR}/cmake/FindOpenImageIO.cmake" DESTINATION ${CMAKECONFIG_INSTALL_DIR}) diff --git a/cmake/TheiaConfig.cmake.in b/cmake/TheiaConfig.cmake.in -index a3ea187..1f2f1a5 100644 +index a3ea187..7e9d912 100644 --- a/cmake/TheiaConfig.cmake.in +++ b/cmake/TheiaConfig.cmake.in -@@ -207,22 +207,28 @@ endif (NOT TARGET theia AND NOT Theia_BINARY_DIR) +@@ -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) -+message(STATUS "Found required Theia dependency: Cereal") +list(APPEND THEIA_LIBRARIES cereal) + +find_package(Flann REQUIRED) -+message(STATUS "Found required Theia dependency: Flann") +list(APPEND THEIA_INCLUDE_DIRS ${FLANN_INCLUDE_DIR}) +list(APPEND THEIA_LIBRARIES ${FLANN_LIBRARY}) + @@ -189,8 +262,8 @@ index a3ea187..1f2f1a5 100644 - ${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}/gtest +- ${THEIA_INTERNAL_LIB_PREFIX}/gtest/include ${THEIA_INTERNAL_LIB_PREFIX}/optimo ${THEIA_INTERNAL_LIB_PREFIX}/spectra ${THEIA_INTERNAL_LIB_PREFIX}/statx @@ -226,6 +299,81 @@ index 84f3829..f88d75a 100644 -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..726f101 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) +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..95da68e 100644 +--- a/libraries/vlfeat/vl/host.h ++++ b/libraries/vlfeat/vl/host.h +@@ -314,18 +314,24 @@ defined(__DOXYGEN__) + # 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 + diff --git a/src/theia/CMakeLists.txt b/src/theia/CMakeLists.txt index 6830f71..768586d 100644 --- a/src/theia/CMakeLists.txt diff --git a/ports/theia/fix-find-suitesparse.patch b/ports/theia/fix-find-suitesparse.patch deleted file mode 100644 index f7de44aa0945ac..00000000000000 --- a/ports/theia/fix-find-suitesparse.patch +++ /dev/null @@ -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) diff --git a/ports/theia/fix-glog-error.patch b/ports/theia/fix-glog-error.patch deleted file mode 100644 index 1e72c9f35c4b7d..00000000000000 --- a/ports/theia/fix-glog-error.patch +++ /dev/null @@ -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") diff --git a/ports/theia/fix-oiio.patch b/ports/theia/fix-oiio.patch deleted file mode 100644 index 7cba45db739fa0..00000000000000 --- a/ports/theia/fix-oiio.patch +++ /dev/null @@ -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(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 it(image_, x, y, 0); -+ OIIO_NAMESPACE::ImageBuf::Iterator 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 it(oiio_img); \ -+ OIIO_NAMESPACE::ImageBuf::ConstIterator 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 it(gray_img); -+ for (OIIO_NAMESPACE::ImageBuf::ConstIterator 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 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 undistorted_it(undistorted_img); -+ OIIO_NAMESPACE::ImageBuf::Iterator undistorted_it(undistorted_img); - for (; !undistorted_it.done(); ++undistorted_it) { - Eigen::Vector2d image_point(undistorted_it.x() + 0.5, - undistorted_it.y() + 0.5); diff --git a/ports/theia/fix-vlfeat-static.patch b/ports/theia/fix-vlfeat-static.patch deleted file mode 100644 index cbade039f4038d..00000000000000 --- a/ports/theia/fix-vlfeat-static.patch +++ /dev/null @@ -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 - diff --git a/ports/theia/portfile.cmake b/ports/theia/portfile.cmake index 322a588a65247c..ff3010f37cfdd6 100644 --- a/ports/theia/portfile.cmake +++ b/ports/theia/portfile.cmake @@ -2,11 +2,6 @@ include(vcpkg_common_functions) vcpkg_check_linkage(ONLY_STATIC_LIBRARY) -if(VCPKG_TARGET_ARCHIECTURE STREQUAL "x86") - message(FATAL_ERROR "${PORT} 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 @@ -15,8 +10,6 @@ vcpkg_from_github( HEAD_REF master PATCHES fix-external-dependencies.patch - fix-vlfeat-static.patch - fix-oiio.patch ) file(REMOVE ${SOURCE_PATH}/cmake/FindSuiteSparse.cmake) @@ -33,30 +26,23 @@ vcpkg_configure_cmake( vcpkg_install_cmake() -if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - vcpkg_fixup_cmake_targets(CONFIG_PATH "CMake") -endif() +vcpkg_fixup_cmake_targets() vcpkg_copy_pdbs() -if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - 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}/../" - "get_filename_component(CURRENT_ROOT_INSTALL_DIR\n \${THEIA_CURRENT_CONFIG_INSTALL_DIR}/../../" THEIA_TARGETS "${THEIA_TARGETS}") - file(WRITE ${CURRENT_PACKAGES_DIR}/share/theia/TheiaConfig.cmake "${THEIA_TARGETS}") -endif() +#if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") +# 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}/../" +# "get_filename_component(CURRENT_ROOT_INSTALL_DIR\n \${THEIA_CURRENT_CONFIG_INSTALL_DIR}/../../" THEIA_TARGETS "${THEIA_TARGETS}") +# file(WRITE ${CURRENT_PACKAGES_DIR}/share/theia/TheiaConfig.cmake "${THEIA_TARGETS}") +#endif() # 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}/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) From 8816585ad292f227141a500bbac947ce8ef4db7e Mon Sep 17 00:00:00 2001 From: Stefano Sinigardi Date: Thu, 30 May 2019 00:13:22 +0200 Subject: [PATCH 25/34] [theia] remove unnecessary empty folders and comments from portfile --- ports/theia/portfile.cmake | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/ports/theia/portfile.cmake b/ports/theia/portfile.cmake index ff3010f37cfdd6..cb77dc6a6140a1 100644 --- a/ports/theia/portfile.cmake +++ b/ports/theia/portfile.cmake @@ -25,23 +25,18 @@ vcpkg_configure_cmake( ) vcpkg_install_cmake() - vcpkg_fixup_cmake_targets() - vcpkg_copy_pdbs() -#if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") -# 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}/../" -# "get_filename_component(CURRENT_ROOT_INSTALL_DIR\n \${THEIA_CURRENT_CONFIG_INSTALL_DIR}/../../" THEIA_TARGETS "${THEIA_TARGETS}") -# file(WRITE ${CURRENT_PACKAGES_DIR}/share/theia/TheiaConfig.cmake "${THEIA_TARGETS}") -#endif() - # 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/iguazu) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/theia/libraries/spectra/doxygen) # Handle copyright file(INSTALL ${SOURCE_PATH}/license.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/theia RENAME copyright) From 5f67148a2ec3b44cc3c05c78195d4f9a20f98182 Mon Sep 17 00:00:00 2001 From: Stefano Sinigardi Date: Thu, 30 May 2019 12:06:05 +0200 Subject: [PATCH 26/34] [theia] use correct build type removing forced vars in cmakelists.txt --- ports/theia/fix-external-dependencies.patch | 25 +++++++++++++++++---- ports/theia/portfile.cmake | 3 ++- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/ports/theia/fix-external-dependencies.patch b/ports/theia/fix-external-dependencies.patch index 7a57abe0e1e0ef..7a4b009611cf99 100644 --- a/ports/theia/fix-external-dependencies.patch +++ b/ports/theia/fix-external-dependencies.patch @@ -300,7 +300,7 @@ index 84f3829..f88d75a 100644 \ No newline at end of file +add_subdirectory(visual_sfm) diff --git a/libraries/statx/CMakeLists.txt b/libraries/statx/CMakeLists.txt -index 23b9e49..726f101 100644 +index 23b9e49..af236a3 100644 --- a/libraries/statx/CMakeLists.txt +++ b/libraries/statx/CMakeLists.txt @@ -103,7 +103,11 @@ if(STATX_WITH_CERES) @@ -316,6 +316,14 @@ index 23b9e49..726f101 100644 # 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 @@ -344,12 +352,14 @@ index 7f4ffc7..15bca12 100644 EXPORT TheiaExport RUNTIME DESTINATION bin diff --git a/libraries/vlfeat/vl/host.h b/libraries/vlfeat/vl/host.h -index 293fe1f..95da68e 100644 +index 293fe1f..0ea3d42 100644 --- a/libraries/vlfeat/vl/host.h +++ b/libraries/vlfeat/vl/host.h -@@ -314,18 +314,24 @@ defined(__DOXYGEN__) +@@ -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 snprintf _snprintf # define isnan _isnan -# ifdef VL_BUILD_DLL +# if defined(VL_BUILD_DLL) @@ -374,6 +384,13 @@ index 293fe1f..95da68e 100644 # 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 diff --git a/ports/theia/portfile.cmake b/ports/theia/portfile.cmake index cb77dc6a6140a1..c131ac095435c3 100644 --- a/ports/theia/portfile.cmake +++ b/ports/theia/portfile.cmake @@ -18,6 +18,7 @@ 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 @@ -35,7 +36,7 @@ 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/iguazu) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/theia/libraries/akaze/datasets) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/theia/libraries/spectra/doxygen) # Handle copyright From b48941dbd6d78cee293c504f0e554221cf9a0fbb Mon Sep 17 00:00:00 2001 From: Stefano Sinigardi Date: Thu, 30 May 2019 13:23:16 +0200 Subject: [PATCH 27/34] [openmvg] add missing suitesparse target detection --- ports/openmvg/CONTROL | 2 +- ports/openmvg/fixcmake.patch | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ports/openmvg/CONTROL b/ports/openmvg/CONTROL index 9d35fc30a37448..7678827207795d 100644 --- a/ports/openmvg/CONTROL +++ b/ports/openmvg/CONTROL @@ -1,7 +1,7 @@ Source: openmvg Version: 1.4-3 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] diff --git a/ports/openmvg/fixcmake.patch b/ports/openmvg/fixcmake.patch index 0ba73961bc7f1e..21140c2bb45b25 100644 --- a/ports/openmvg/fixcmake.patch +++ b/ports/openmvg/fixcmake.patch @@ -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() @@ -222,7 +222,7 @@ index 654bebd..5264bfc 100644 # ============================================================================== # 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") From 1fb8b567fa66c133cf331caf9b72761716ffd8ce Mon Sep 17 00:00:00 2001 From: Stefano Sinigardi Date: Thu, 30 May 2019 13:37:10 +0200 Subject: [PATCH 28/34] [sophus] fix Suitesparse dependency --- ports/sophus/fix_cmakelists.txt | 12 ++++++++++++ ports/sophus/portfile.cmake | 4 +++- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 ports/sophus/fix_cmakelists.txt diff --git a/ports/sophus/fix_cmakelists.txt b/ports/sophus/fix_cmakelists.txt new file mode 100644 index 00000000000000..e639dd7679c8bf --- /dev/null +++ b/ports/sophus/fix_cmakelists.txt @@ -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} ) + + ################################################################################ diff --git a/ports/sophus/portfile.cmake b/ports/sophus/portfile.cmake index 3f07fab015c7d9..069abf361f2957 100644 --- a/ports/sophus/portfile.cmake +++ b/ports/sophus/portfile.cmake @@ -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.txt ) vcpkg_configure_cmake( From a3668973ee77478ad6b5a466d1c8abe324b96800 Mon Sep 17 00:00:00 2001 From: Stefano Sinigardi Date: Thu, 30 May 2019 16:04:47 +0200 Subject: [PATCH 29/34] [sophus,openmvg] use suitesparse lowercase for module compatibility on case-sensitive filesystems --- ports/openmvg/fixcmake.patch | 2 +- ports/sophus/{fix_cmakelists.txt => fix_cmakelists.patch} | 6 +++--- ports/sophus/portfile.cmake | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) rename ports/sophus/{fix_cmakelists.txt => fix_cmakelists.patch} (91%) diff --git a/ports/openmvg/fixcmake.patch b/ports/openmvg/fixcmake.patch index 21140c2bb45b25..655311c5d48d17 100644 --- a/ports/openmvg/fixcmake.patch +++ b/ports/openmvg/fixcmake.patch @@ -238,7 +238,7 @@ index 654bebd..ab7dd90 100644 +# ============================================================================== +# Suitesparse +# ============================================================================== -+find_package(Suitesparse REQUIRED) ++find_package(suitesparse REQUIRED) # ============================================================================== # Third-party libraries: diff --git a/ports/sophus/fix_cmakelists.txt b/ports/sophus/fix_cmakelists.patch similarity index 91% rename from ports/sophus/fix_cmakelists.txt rename to ports/sophus/fix_cmakelists.patch index e639dd7679c8bf..33916cf1df6733 100644 --- a/ports/sophus/fix_cmakelists.txt +++ b/ports/sophus/fix_cmakelists.patch @@ -3,10 +3,10 @@ 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 ) ++FIND_PACKAGE( suitesparse REQUIRED ) LIST( APPEND Sophus_INCLUDE_DIR ${EIGEN3_INCLUDE_DIR} ) - + ################################################################################ diff --git a/ports/sophus/portfile.cmake b/ports/sophus/portfile.cmake index 069abf361f2957..ee454b7a7b03a1 100644 --- a/ports/sophus/portfile.cmake +++ b/ports/sophus/portfile.cmake @@ -7,7 +7,7 @@ vcpkg_from_github( SHA512 569634a8be9237d2240cf30c01e2677ece75d55f1196030f1228baca62fa22460e8ceb2a63bd46afdf7f02d8eb79c59d6ed666228b852da78590de897b278fab HEAD_REF master PATCHES - fix_cmakelists.txt + fix_cmakelists.patch ) vcpkg_configure_cmake( From 6b62b33dcaaaa6b21372a8c58e526f89dbe79fc4 Mon Sep 17 00:00:00 2001 From: Stefano Sinigardi Date: Thu, 30 May 2019 18:36:37 +0200 Subject: [PATCH 30/34] [suitesparse] fixes for case-sensitive filesystems --- ports/suitesparse/suitesparse.patch | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/ports/suitesparse/suitesparse.patch b/ports/suitesparse/suitesparse.patch index 3118de1918f800..39435560679349 100644 --- a/ports/suitesparse/suitesparse.patch +++ b/ports/suitesparse/suitesparse.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 3486f05..492289a 100755 +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 @@ -11,8 +11,17 @@ index 3486f05..492289a 100755 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 100755 +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") @@ -31,10 +40,10 @@ index c6e2834..5ef08a6 100755 # 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..d771f61 100755 +index cb1f51f..49387b8 100644 --- a/cmake/SuiteSparse-config-install.cmake.in +++ b/cmake/SuiteSparse-config-install.cmake.in -@@ -4,10 +4,7 @@ get_filename_component(_SuiteSparse_PREFIX "${_SuiteSparse_SELF_DIR}" PATH) +@@ -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) @@ -45,7 +54,11 @@ index cb1f51f..d771f61 100755 +find_package(LAPACK REQUIRED) # Load targets from the install tree. - include(${_SuiteSparse_SELF_DIR}/SuiteSparse-targets.cmake) +-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@ From a73955f9fd7ec85fcb76214e4f188440e1136081 Mon Sep 17 00:00:00 2001 From: Stefano Sinigardi Date: Thu, 30 May 2019 22:20:55 +0200 Subject: [PATCH 31/34] [openmvg] use correct Eigen3 name for case-sensitive filesystems --- ports/openmvg/CONTROL | 2 +- ports/openmvg/fixcmake.patch | 2 +- ports/sophus/CONTROL | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/openmvg/CONTROL b/ports/openmvg/CONTROL index 7678827207795d..90c10f3cd199d0 100644 --- a/ports/openmvg/CONTROL +++ b/ports/openmvg/CONTROL @@ -1,5 +1,5 @@ Source: openmvg -Version: 1.4-3 +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, suitesparse diff --git a/ports/openmvg/fixcmake.patch b/ports/openmvg/fixcmake.patch index 655311c5d48d17..2dd5201ec74701 100644 --- a/ports/openmvg/fixcmake.patch +++ b/ports/openmvg/fixcmake.patch @@ -110,7 +110,7 @@ index 654bebd..ab7dd90 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}) # ============================================================================== diff --git a/ports/sophus/CONTROL b/ports/sophus/CONTROL index 8b78abc6a9a805..e6cf512f20b9c4 100644 --- a/ports/sophus/CONTROL +++ b/ports/sophus/CONTROL @@ -1,4 +1,4 @@ Source: sophus -Version: 1.0.0-2 +Version: 1.0.0-3 Build-Depends: eigen3, ceres, suitesparse Description: Lie group library for C++ From 2d32b0f7d37bd16fa199b075ac3d5f241944a6ba Mon Sep 17 00:00:00 2001 From: Stefano Sinigardi Date: Thu, 30 May 2019 22:51:19 +0200 Subject: [PATCH 32/34] [sophus] trigger rebuild --- ports/sophus/portfile.cmake | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ports/sophus/portfile.cmake b/ports/sophus/portfile.cmake index ee454b7a7b03a1..f33260c4d756b7 100644 --- a/ports/sophus/portfile.cmake +++ b/ports/sophus/portfile.cmake @@ -16,13 +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) -file(COPY ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}/) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/${PORT}/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}/ RENAME copyright) From aadde60c037f340d11da5e287e38ebf1d08d0a61 Mon Sep 17 00:00:00 2001 From: Stefano Sinigardi Date: Fri, 31 May 2019 14:08:01 +0200 Subject: [PATCH 33/34] [shogun] use modern vcpkg style --- ports/shogun/portfile.cmake | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ports/shogun/portfile.cmake b/ports/shogun/portfile.cmake index b207116c835210..32ab51c8ac6a48 100644 --- a/ports/shogun/portfile.cmake +++ b/ports/shogun/portfile.cmake @@ -8,11 +8,8 @@ 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 ) file(REMOVE_RECURSE ${SOURCE_PATH}/cmake/external) From 76bed991dd6f9f6a53b68acb4395592e641fca88 Mon Sep 17 00:00:00 2001 From: Stefano Sinigardi Date: Fri, 31 May 2019 14:09:43 +0200 Subject: [PATCH 34/34] [shogun] add missing cmake system processor symbol --- ports/shogun/CONTROL | 8 ++++---- ports/shogun/portfile.cmake | 13 ++++++++++++- ports/shogun/use_proper_cmake_symbol.patch | 22 ++++++++++++++++++++++ 3 files changed, 38 insertions(+), 5 deletions(-) create mode 100644 ports/shogun/use_proper_cmake_symbol.patch diff --git a/ports/shogun/CONTROL b/ports/shogun/CONTROL index d9435af1f1f3a8..9854596b5f027e 100644 --- a/ports/shogun/CONTROL +++ b/ports/shogun/CONTROL @@ -1,4 +1,4 @@ -Source: shogun -Version: 6.1.3-1 -Build-Depends: bzip2, eigen3, liblzma, libxml2, openblas (x64&!osx), 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 diff --git a/ports/shogun/portfile.cmake b/ports/shogun/portfile.cmake index 32ab51c8ac6a48..68d3ddf74148cd 100644 --- a/ports/shogun/portfile.cmake +++ b/ports/shogun/portfile.cmake @@ -9,7 +9,8 @@ vcpkg_from_github( SHA512 11aeed456b13720099ca820ab9742c90ce4af2dc049602a425f8c44d2fa155327c7f1d3af2ec840666f600a91e75902d914ffe784d76ed35810da4f3a5815673 HEAD_REF master PATCHES - cmake.patch + cmake.patch + use_proper_cmake_symbol.patch ) file(REMOVE_RECURSE ${SOURCE_PATH}/cmake/external) @@ -22,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}") @@ -35,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 @@ -54,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() diff --git a/ports/shogun/use_proper_cmake_symbol.patch b/ports/shogun/use_proper_cmake_symbol.patch new file mode 100644 index 00000000000000..627c5bd77991d9 --- /dev/null +++ b/ports/shogun/use_proper_cmake_symbol.patch @@ -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")