early-access version 2853

This commit is contained in:
pineappleEA
2022-07-23 03:01:36 +02:00
parent 1f2b5081b5
commit 1f111bb69c
8955 changed files with 418777 additions and 999 deletions

View File

@@ -0,0 +1,4 @@
@PACKAGE_INIT@
include("${CMAKE_CURRENT_LIST_DIR}/@targets_export_name@.cmake")
check_required_components("@PROJECT_NAME@")

View File

@@ -0,0 +1,211 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8713b2f..0e034fa 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -51,7 +51,7 @@ set(VORPALINE_VERSION_MINOR 7)
set(VORPALINE_VERSION_PATCH 6)
set(VORPALINE_VERSION ${VORPALINE_VERSION_MAJOR}.${VORPALINE_VERSION_MINOR}.${VORPALINE_VERSION_PATCH})
-set(VORPALINE_INCLUDE_SUBPATH geogram${VORPALINE_VERSION_MAJOR})
+set(VORPALINE_INCLUDE_SUBPATH ./)
# Determine the current Build-OS (Build-platform without the compiler info)
string(REGEX REPLACE "-[^-]+$" "" VORPALINE_OS ${VORPALINE_PLATFORM})
@@ -116,6 +116,7 @@ endif()
add_subdirectory(src/lib/third_party)
if(GEOGRAM_WITH_GRAPHICS)
+ find_package(GLFW3 REQUIRED)
add_subdirectory(src/lib/geogram_gfx)
endif()
@@ -146,7 +147,44 @@ file(REMOVE ${CMAKE_BINARY_DIR}/doc/LICENSE.txt)
# FindGeogram.cmake
-install(FILES cmake/FindGeogram.cmake DESTINATION lib/cmake/modules COMPONENT devkit)
+# This installation is not suitable for vcpkg
+# install(FILES cmake/FindGeogram.cmake DESTINATION lib/cmake/modules COMPONENT devkit)
+
+set(config_install_dir "share/geogram")
+set(include_install_dir "include")
+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 "${PROJECT_NAME}::")
+
+# Include module with fuction 'write_basic_package_version_file'
+include(CMakePackageConfigHelpers)
+
+write_basic_package_version_file(
+ "${version_config}" COMPATIBILITY SameMajorVersion VERSION ${VORPALINE_VERSION}
+)
+
+configure_package_config_file(
+ "cmake/Config.cmake.in"
+ "${project_config}"
+ INSTALL_DESTINATION "${config_install_dir}"
+)
+
+# Config
+install(
+ FILES "${project_config}" "${version_config}"
+ DESTINATION "${config_install_dir}"
+)
+
+# Config
+install(
+ EXPORT "${targets_export_name}"
+ NAMESPACE "${namespace}"
+ DESTINATION "${config_install_dir}"
+)
# Configure CPack
diff --git a/src/lib/geogram/CMakeLists.txt b/src/lib/geogram/CMakeLists.txt
index 49cb2ba..8985137 100644
--- a/src/lib/geogram/CMakeLists.txt
+++ b/src/lib/geogram/CMakeLists.txt
@@ -61,8 +61,19 @@ if(WIN32)
target_link_libraries(geogram psapi)
endif()
+if(WIN32 AND VORPALINE_BUILD_DYNAMIC)
+ target_compile_definitions(geogram PUBLIC GEO_DYNAMIC_LIBS)
+endif()
+
# Install the library
-install_devkit_targets(geogram)
+install(
+ TARGETS geogram
+ EXPORT "${PROJECT_NAME}Targets"
+ LIBRARY DESTINATION "lib"
+ ARCHIVE DESTINATION "lib"
+ RUNTIME DESTINATION "bin"
+ INCLUDES DESTINATION "include"
+)
# Install include files for the standard devkit
install(
diff --git a/src/lib/geogram_gfx/CMakeLists.txt b/src/lib/geogram_gfx/CMakeLists.txt
index b155975..ad66440 100644
--- a/src/lib/geogram_gfx/CMakeLists.txt
+++ b/src/lib/geogram_gfx/CMakeLists.txt
@@ -47,14 +47,21 @@ if(VORPALINE_BUILD_DYNAMIC)
endif()
# Install the library
-install_devkit_targets(geogram_gfx)
+install(
+ TARGETS geogram_gfx
+ EXPORT "${PROJECT_NAME}Targets"
+ LIBRARY DESTINATION "lib"
+ ARCHIVE DESTINATION "lib"
+ RUNTIME DESTINATION "bin"
+ INCLUDES DESTINATION "include"
+)
# Install include files for the standard devkit
install(
DIRECTORY .
DESTINATION include/${VORPALINE_INCLUDE_SUBPATH}/geogram_gfx
COMPONENT devkit
- FILES_MATCHING PATTERN *.h
+ FILES_MATCHING PATTERN *.h PATTERN *.xpm # xpm is the colrbar file
)
# Install include files for the full devkit
@@ -62,7 +69,7 @@ install(
DIRECTORY .
DESTINATION include/${VORPALINE_INCLUDE_SUBPATH}/geogram_gfx
COMPONENT devkit-full
- FILES_MATCHING PATTERN *.h
+ FILES_MATCHING PATTERN *.h PATTERN *.xpm # xpm is the colrbar file
)
install(
diff --git a/src/lib/third_party/numerics/CMakeLists.txt b/src/lib/third_party/numerics/CMakeLists.txt
index 8fd39b0..46d5cc6 100644
--- a/src/lib/third_party/numerics/CMakeLists.txt
+++ b/src/lib/third_party/numerics/CMakeLists.txt
@@ -10,17 +10,19 @@ endif()
include_directories(${GEOGRAM_SOURCE_DIR}/src/lib/third_party/numerics/INCLUDE)
-aux_source_directories(SOURCES "Source Files" .)
+set(LAPACK_lapack_WORKS TRUE)
+find_package(BLAS REQUIRED)
+find_package(LAPACK REQUIRED)
+ aux_source_directories(SOURCES "Source Files" .)
aux_source_directories(SOURCES "Source Files\\LIBF2C" LIBF2C)
-aux_source_directories(SOURCES "Source Files\\CBLAS" CBLAS)
-aux_source_directories(SOURCES "Source Files\\CLAPACK" CLAPACK)
aux_source_directories(SOURCES "Source Files\\SUPERLU" SUPERLU)
aux_source_directories(SOURCES "Source Files\\ARPACK" ARPACK)
aux_source_directories(SOURCES "Source Files\\ARPACK_UTIL" ARPACK_UTIL)
add_library(geogram_num_3rdparty ${SOURCES})
-if(UNIX)
+target_link_libraries(geogram_num_3rdparty ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES})
+ if(UNIX)
target_link_libraries(geogram_num_3rdparty m)
endif()
diff --git a/src/lib/third_party/numerics/LIBF2C/getarg_.c b/src/lib/third_party/numerics/LIBF2C/getarg_.c
index 2b69a1e..a504538 100644
--- a/src/lib/third_party/numerics/LIBF2C/getarg_.c
+++ b/src/lib/third_party/numerics/LIBF2C/getarg_.c
@@ -17,20 +17,20 @@ VOID getarg_(n, s, ls) ftnint *n; char *s; ftnlen ls;
void getarg_(ftnint *n, char *s, ftnlen ls)
#endif
{
- extern int xargc;
- extern char **xargv;
- Const char *t;
- int i;
+ // extern int xargc;
+ // extern char **xargv;
+ // Const char *t;
+ // int i;
- if(*n>=0 && *n<xargc)
- t = xargv[*n];
- else
- t = "";
- for(i = 0; i<ls && *t!='\0' ; ++i)
- *s++ = *t++;
- for( ; i<ls ; ++i)
- *s++ = ' ';
- }
+ // if(*n>=0 && *n<xargc)
+ // t = xargv[*n];
+ // else
+ // t = "";
+ // for(i = 0; i<ls && *t!='\0' ; ++i)
+ // *s++ = *t++;
+ // for( ; i<ls ; ++i)
+ // *s++ = ' ';
+}
#ifdef __cplusplus
}
#endif
diff --git a/src/lib/third_party/numerics/LIBF2C/iargc_.c b/src/lib/third_party/numerics/LIBF2C/iargc_.c
index 2f29da0..48dfd9f 100644
--- a/src/lib/third_party/numerics/LIBF2C/iargc_.c
+++ b/src/lib/third_party/numerics/LIBF2C/iargc_.c
@@ -9,8 +9,9 @@ ftnint iargc_()
ftnint iargc_(void)
#endif
{
-extern int xargc;
-return ( xargc - 1 );
+// extern int xargc;
+// return ( xargc - 1 );
+ return -1;
}
#ifdef __cplusplus
}

81
externals/vcpkg/ports/geogram/portfile.cmake vendored Executable file
View File

@@ -0,0 +1,81 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO alicevision/geogram
REF 8b2ae6148c7ab1564fa2700673b4275296ce80d3 #1.7.6
SHA512 0ec0deded92c8d5d100b6e77f8cfbbbaf7b744c230e10abd0b86861960cda9713ff65209575fdc09034afcb0e9137428a20c00d399c09fd58ce541fed2105a2d
PATCHES
fix-vcpkg-install.patch
)
file(COPY ${CURRENT_PORT_DIR}/Config.cmake.in DESTINATION ${SOURCE_PATH}/cmake)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
"graphics" GEOGRAM_WITH_GRAPHICS
)
if (VCPKG_LIBRARY_LINKAGE STREQUAL "static")
set(VORPALINE_BUILD_DYNAMIC FALSE)
if (VCPKG_TARGET_IS_WINDOWS)
set(VORPALINE_PLATFORM Win-vs-generic)
endif()
if (VCPKG_CRT_LINKAGE STREQUAL "dynamic" AND VCPKG_TARGET_IS_WINDOWS)
message("geogram on Windows with CRT dynamic linkage only supports dynamic library linkage. Building dynamic.")
set(VCPKG_LIBRARY_LINKAGE dynamic)
set(VORPALINE_PLATFORM Win-vs-dynamic-generic)
endif()
if (VCPKG_TARGET_IS_LINUX)
message("geogram on Linux only supports dynamic library linkage. Building dynamic.")
set(VCPKG_LIBRARY_LINKAGE dynamic)
set(VORPALINE_PLATFORM Linux64-gcc-dynamic )
endif()
if (VCPKG_TARGET_IS_OSX)
message("geogram on Darwin only supports dynamic library linkage. Building dynamic.")
set(VCPKG_LIBRARY_LINKAGE dynamic)
set(VORPALINE_PLATFORM Darwin-clang-dynamic)
endif()
else()
set(VORPALINE_BUILD_DYNAMIC TRUE)
if (VCPKG_TARGET_IS_WINDOWS)
set(VORPALINE_PLATFORM Win-vs-generic)
endif()
if (VCPKG_TARGET_IS_LINUX)
set(VORPALINE_PLATFORM Linux64-gcc-dynamic )
endif()
if (VCPKG_TARGET_IS_OSX)
set(VORPALINE_PLATFORM Darwin-clang-dynamic)
endif()
endif()
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
# Geogram cannot be built with ninja because it embeds $(Configuration) in some of the generated paths. These require MSBuild in order to be evaluated.
#PREFER_NINJA # Disable this option if project cannot be built with Ninja
OPTIONS
-DVORPALINE_BUILD_DYNAMIC=${VORPALINE_BUILD_DYNAMIC}
-DGEOGRAM_LIB_ONLY=ON
-DGEOGRAM_USE_SYSTEM_GLFW3=ON
-DVORPALINE_PLATFORM=${VORPALINE_PLATFORM}
-DGEOGRAM_WITH_VORPALINE=OFF
${FEATURE_OPTIONS}
)
vcpkg_install_cmake()
vcpkg_copy_pdbs()
vcpkg_fixup_cmake_targets()
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/doc)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/doc)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
vcpkg_replace_string(
${CURRENT_PACKAGES_DIR}/share/geogram/GeogramTargets.cmake
[[INTERFACE_INCLUDE_DIRECTORIES "/src/lib;${_IMPORT_PREFIX}/include"]]
[[INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"]]
)
# Handle copyright
file(INSTALL ${SOURCE_PATH}/doc/devkit/license.dox DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
vcpkg_fixup_pkgconfig()

20
externals/vcpkg/ports/geogram/vcpkg.json vendored Executable file
View File

@@ -0,0 +1,20 @@
{
"name": "geogram",
"version": "1.7.6",
"port-version": 2,
"description": "Geogram is a programming library of geometric algorithms.",
"homepage": "https://gforge.inria.fr/projects/geogram/",
"supports": "!uwp",
"dependencies": [
"blas",
"lapack"
],
"features": {
"graphics": {
"description": "Build viewers and geogram_gfx library.",
"dependencies": [
"glfw3"
]
}
}
}