2021-10-17 03:14:34 +08:00
|
|
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
2023-03-25 13:59:15 +08:00
|
|
|
index 1fd796c..05bd735 100644
|
2021-10-17 03:14:34 +08:00
|
|
|
--- a/CMakeLists.txt
|
|
|
|
+++ b/CMakeLists.txt
|
2023-03-25 13:59:15 +08:00
|
|
|
@@ -53,7 +53,7 @@ endif()
|
|
|
|
include(cmake/geogram.cmake)
|
|
|
|
|
2021-10-17 03:14:34 +08:00
|
|
|
|
|
|
|
-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})
|
2023-03-25 13:59:15 +08:00
|
|
|
@@ -115,6 +115,7 @@ endif()
|
2021-10-17 03:14:34 +08:00
|
|
|
add_subdirectory(src/lib/third_party)
|
|
|
|
|
|
|
|
if(GEOGRAM_WITH_GRAPHICS)
|
|
|
|
+ find_package(GLFW3 REQUIRED)
|
|
|
|
add_subdirectory(src/lib/geogram_gfx)
|
|
|
|
endif()
|
|
|
|
|
2023-03-25 13:59:15 +08:00
|
|
|
@@ -145,7 +146,44 @@ file(REMOVE ${CMAKE_BINARY_DIR}/doc/LICENSE.txt)
|
2021-10-17 03:14:34 +08:00
|
|
|
|
|
|
|
# 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
|
2023-03-25 13:59:15 +08:00
|
|
|
index ed2dca0..30f87b7 100644
|
2021-10-17 03:14:34 +08:00
|
|
|
--- a/src/lib/geogram/CMakeLists.txt
|
|
|
|
+++ b/src/lib/geogram/CMakeLists.txt
|
2023-03-25 13:59:15 +08:00
|
|
|
@@ -45,7 +45,7 @@ target_include_directories(geogram PRIVATE
|
|
|
|
# path for targets that depend on geogram.
|
|
|
|
# See: https://cmake.org/cmake/help/v3.3/command/target_include_directories.html
|
|
|
|
# https://stackoverflow.com/questions/26243169/cmake-target-include-directories-meaning-of-scope
|
|
|
|
-target_include_directories(geogram PUBLIC ${PROJECT_SOURCE_DIR}/src/lib)
|
|
|
|
+target_include_directories(geogram PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/lib>)
|
|
|
|
|
|
|
|
if(ANDROID)
|
|
|
|
target_include_directories(geogram PRIVATE
|
|
|
|
@@ -72,8 +72,19 @@ if(WIN32)
|
2021-10-17 03:14:34 +08:00
|
|
|
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
|
2023-03-25 13:59:15 +08:00
|
|
|
index a6f8372..195b1e2 100644
|
2021-10-17 03:14:34 +08:00
|
|
|
--- a/src/lib/geogram_gfx/CMakeLists.txt
|
|
|
|
+++ b/src/lib/geogram_gfx/CMakeLists.txt
|
2023-03-25 13:59:15 +08:00
|
|
|
@@ -52,14 +52,21 @@ if(VORPALINE_BUILD_DYNAMIC)
|
2021-10-17 03:14:34 +08:00
|
|
|
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
|
2023-03-25 13:59:15 +08:00
|
|
|
@@ -67,7 +74,7 @@ install(
|
2021-10-17 03:14:34 +08:00
|
|
|
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
|
2023-03-25 13:59:15 +08:00
|
|
|
index 5faf2fa..33c9bdd 100644
|
2021-10-17 03:14:34 +08:00
|
|
|
--- a/src/lib/third_party/numerics/CMakeLists.txt
|
|
|
|
+++ b/src/lib/third_party/numerics/CMakeLists.txt
|
2023-03-25 13:59:15 +08:00
|
|
|
@@ -14,10 +14,11 @@ endif()
|
2021-10-17 03:14:34 +08:00
|
|
|
|
|
|
|
include_directories(${GEOGRAM_SOURCE_DIR}/src/lib/third_party/numerics/INCLUDE)
|
|
|
|
|
|
|
|
+set(LAPACK_lapack_WORKS TRUE)
|
|
|
|
+find_package(BLAS REQUIRED)
|
|
|
|
+find_package(LAPACK REQUIRED)
|
2023-03-25 13:59:15 +08:00
|
|
|
aux_source_directories(SOURCES "Source Files" .)
|
2021-10-17 03:14:34 +08:00
|
|
|
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)
|
2023-03-25 13:59:15 +08:00
|
|
|
@@ -28,6 +29,7 @@ list(REMOVE_ITEM SOURCES "LIBF2C/system_.c")
|
2021-10-17 03:14:34 +08:00
|
|
|
|
|
|
|
add_library(geogram_num_3rdparty ${SOURCES})
|
|
|
|
|
|
|
|
+target_link_libraries(geogram_num_3rdparty ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES})
|
2023-03-25 13:59:15 +08:00
|
|
|
if(UNIX)
|
2021-10-17 03:14:34 +08:00
|
|
|
target_link_libraries(geogram_num_3rdparty m)
|
|
|
|
endif()
|
2023-03-25 13:59:15 +08:00
|
|
|
diff --git a/src/lib/third_party/numerics/LIBF2C/libf2c_getarg_.c b/src/lib/third_party/numerics/LIBF2C/libf2c_getarg_.c
|
|
|
|
index 2b69a1e..a4b4c55 100644
|
|
|
|
--- a/src/lib/third_party/numerics/LIBF2C/libf2c_getarg_.c
|
|
|
|
+++ b/src/lib/third_party/numerics/LIBF2C/libf2c_getarg_.c
|
|
|
|
@@ -17,20 +17,21 @@ VOID getarg_(n, s, ls) ftnint *n; char *s; ftnlen ls;
|
2021-10-17 03:14:34 +08:00
|
|
|
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)
|
2023-03-25 13:59:15 +08:00
|
|
|
+ // t = xargv[*n];
|
2021-10-17 03:14:34 +08:00
|
|
|
+ // else
|
2023-03-25 13:59:15 +08:00
|
|
|
+ // t = "";
|
2021-10-17 03:14:34 +08:00
|
|
|
+ // for(i = 0; i<ls && *t!='\0' ; ++i)
|
2023-03-25 13:59:15 +08:00
|
|
|
+ // *s++ = *t++;
|
2021-10-17 03:14:34 +08:00
|
|
|
+ // for( ; i<ls ; ++i)
|
2023-03-25 13:59:15 +08:00
|
|
|
+ // *s++ = ' ';
|
|
|
|
+ // }
|
2021-10-17 03:14:34 +08:00
|
|
|
+}
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
2023-03-25 13:59:15 +08:00
|
|
|
diff --git a/src/lib/third_party/numerics/LIBF2C/libf2c_iargc_.c b/src/lib/third_party/numerics/LIBF2C/libf2c_iargc_.c
|
2021-10-17 03:14:34 +08:00
|
|
|
index 2f29da0..48dfd9f 100644
|
2023-03-25 13:59:15 +08:00
|
|
|
--- a/src/lib/third_party/numerics/LIBF2C/libf2c_iargc_.c
|
|
|
|
+++ b/src/lib/third_party/numerics/LIBF2C/libf2c_iargc_.c
|
2021-10-17 03:14:34 +08:00
|
|
|
@@ -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
|
|
|
|
}
|