mirror of
https://github.com/QIDITECH/QIDISlicer.git
synced 2026-01-30 23:48:44 +03:00
QIDISlicer1.0.0
This commit is contained in:
28
deps/Blosc/Blosc.cmake
vendored
Normal file
28
deps/Blosc/Blosc.cmake
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
if(BUILD_SHARED_LIBS)
|
||||
set(_build_shared ON)
|
||||
set(_build_static OFF)
|
||||
else()
|
||||
set(_build_shared OFF)
|
||||
set(_build_static ON)
|
||||
endif()
|
||||
|
||||
qidislicer_add_cmake_project(Blosc
|
||||
#URL https://github.com/Blosc/c-blosc/archive/refs/tags/v1.17.0.zip
|
||||
#URL_HASH SHA256=7463a1df566704f212263312717ab2c36b45d45cba6cd0dccebf91b2cc4b4da9
|
||||
URL https://github.com/tamasmeszaros/c-blosc/archive/refs/heads/v1.17.0_tm.zip
|
||||
URL_HASH SHA256=dcb48bf43a672fa3de6a4b1de2c4c238709dad5893d1e097b8374ad84b1fc3b3
|
||||
DEPENDS ${ZLIB_PKG}
|
||||
# Patching upstream does not work this way with git version 2.28 installed on mac worker
|
||||
# PATCH_COMMAND ${GIT_EXECUTABLE} apply --ignore-space-change --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/blosc-mods.patch
|
||||
CMAKE_ARGS
|
||||
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
|
||||
-DBUILD_SHARED=${_build_shared}
|
||||
-DBUILD_STATIC=${_build_static}
|
||||
-DBUILD_TESTS=OFF
|
||||
-DBUILD_BENCHMARKS=OFF
|
||||
-DPREFER_EXTERNAL_ZLIB=ON
|
||||
)
|
||||
|
||||
if (MSVC)
|
||||
add_debug_dep(dep_Blosc)
|
||||
endif ()
|
||||
469
deps/Blosc/blosc-mods.patch
vendored
Normal file
469
deps/Blosc/blosc-mods.patch
vendored
Normal file
@@ -0,0 +1,469 @@
|
||||
From 7cf6c014a36f1712efbdbe9bc52d2d4922b54673 Mon Sep 17 00:00:00 2001
|
||||
From: tamasmeszaros <meszaros.q@gmail.com>
|
||||
Date: Wed, 30 Oct 2019 12:54:52 +0100
|
||||
Subject: [PATCH] Blosc 1.17 fixes and cmake config script
|
||||
|
||||
Signed-off-by: tamasmeszaros <meszaros.q@gmail.com>
|
||||
---
|
||||
CMakeLists.txt | 105 +++++++++++++++++-----------------
|
||||
blosc/CMakeLists.txt | 118 +++++++++------------------------------
|
||||
cmake/FindLZ4.cmake | 6 +-
|
||||
cmake/FindSnappy.cmake | 8 ++-
|
||||
cmake/FindZstd.cmake | 8 ++-
|
||||
cmake_config.cmake.in | 24 ++++++++
|
||||
internal-complibs/CMakeLists.txt | 35 ++++++++++++
|
||||
7 files changed, 157 insertions(+), 147 deletions(-)
|
||||
create mode 100644 cmake_config.cmake.in
|
||||
create mode 100644 internal-complibs/CMakeLists.txt
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 59d9fab..e9134c2 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -71,7 +71,7 @@
|
||||
# DEV: static includes blosc.a and blosc.h
|
||||
|
||||
|
||||
-cmake_minimum_required(VERSION 2.8.12)
|
||||
+cmake_minimum_required(VERSION 3.1) # Threads::Threads target available from 3.1
|
||||
if (NOT CMAKE_VERSION VERSION_LESS 3.3)
|
||||
cmake_policy(SET CMP0063 NEW)
|
||||
endif()
|
||||
@@ -124,55 +124,30 @@ option(PREFER_EXTERNAL_ZSTD
|
||||
|
||||
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
|
||||
|
||||
-
|
||||
-if(NOT DEACTIVATE_LZ4)
|
||||
- if(PREFER_EXTERNAL_LZ4)
|
||||
- find_package(LZ4)
|
||||
- else()
|
||||
- message(STATUS "Using LZ4 internal sources.")
|
||||
- endif(PREFER_EXTERNAL_LZ4)
|
||||
- # HAVE_LZ4 will be set to true because even if the library is
|
||||
- # not found, we will use the included sources for it
|
||||
- set(HAVE_LZ4 TRUE)
|
||||
-endif(NOT DEACTIVATE_LZ4)
|
||||
-
|
||||
-if(NOT DEACTIVATE_SNAPPY)
|
||||
- if(PREFER_EXTERNAL_SNAPPY)
|
||||
- find_package(Snappy)
|
||||
- else()
|
||||
- message(STATUS "Using Snappy internal sources.")
|
||||
- endif(PREFER_EXTERNAL_SNAPPY)
|
||||
- # HAVE_SNAPPY will be set to true because even if the library is not found,
|
||||
- # we will use the included sources for it
|
||||
- set(HAVE_SNAPPY TRUE)
|
||||
-endif(NOT DEACTIVATE_SNAPPY)
|
||||
-
|
||||
-if(NOT DEACTIVATE_ZLIB)
|
||||
- # import the ZLIB_ROOT environment variable to help finding the zlib library
|
||||
- if(PREFER_EXTERNAL_ZLIB)
|
||||
- set(ZLIB_ROOT $ENV{ZLIB_ROOT})
|
||||
- find_package(ZLIB)
|
||||
- if (NOT ZLIB_FOUND )
|
||||
- message(STATUS "No zlib found. Using internal sources.")
|
||||
- endif (NOT ZLIB_FOUND )
|
||||
- else()
|
||||
- message(STATUS "Using zlib internal sources.")
|
||||
- endif(PREFER_EXTERNAL_ZLIB)
|
||||
- # HAVE_ZLIB will be set to true because even if the library is not found,
|
||||
- # we will use the included sources for it
|
||||
- set(HAVE_ZLIB TRUE)
|
||||
-endif(NOT DEACTIVATE_ZLIB)
|
||||
-
|
||||
-if (NOT DEACTIVATE_ZSTD)
|
||||
- if (PREFER_EXTERNAL_ZSTD)
|
||||
- find_package(Zstd)
|
||||
- else ()
|
||||
- message(STATUS "Using ZSTD internal sources.")
|
||||
- endif (PREFER_EXTERNAL_ZSTD)
|
||||
- # HAVE_ZSTD will be set to true because even if the library is
|
||||
- # not found, we will use the included sources for it
|
||||
- set(HAVE_ZSTD TRUE)
|
||||
-endif (NOT DEACTIVATE_ZSTD)
|
||||
+set(LIBS "")
|
||||
+macro(use_package _pkg _tgt)
|
||||
+ string(TOUPPER ${_pkg} _PKG)
|
||||
+ if(NOT DEACTIVATE_${_PKG})
|
||||
+ if(PREFER_EXTERNAL_${_PKG})
|
||||
+ find_package(${_pkg})
|
||||
+ if (NOT ${_pkg}_FOUND )
|
||||
+ message(STATUS "No ${_pkg} found. Using internal sources.")
|
||||
+ endif()
|
||||
+ else()
|
||||
+ message(STATUS "Using ${_pkg} internal sources.")
|
||||
+ endif(PREFER_EXTERNAL_${_PKG})
|
||||
+ # HAVE_${_pkg} will be set to true because even if the library is
|
||||
+ # not found, we will use the included sources for it
|
||||
+ set(HAVE_${_PKG} TRUE)
|
||||
+ list(APPEND LIBS ${_pkg}::${_tgt})
|
||||
+ endif(NOT DEACTIVATE_${_PKG})
|
||||
+endmacro()
|
||||
+
|
||||
+set(ZLIB_ROOT $ENV{ZLIB_ROOT})
|
||||
+use_package(ZLIB ZLIB)
|
||||
+use_package(LZ4 LZ4)
|
||||
+use_package(Snappy snappy)
|
||||
+use_package(Zstd Zstd)
|
||||
|
||||
# create the config.h file
|
||||
configure_file ("blosc/config.h.in" "blosc/config.h" )
|
||||
@@ -316,6 +291,7 @@ endif()
|
||||
|
||||
|
||||
# subdirectories
|
||||
+add_subdirectory(internal-complibs)
|
||||
add_subdirectory(blosc)
|
||||
|
||||
if(BUILD_TESTS)
|
||||
@@ -328,7 +304,6 @@ if(BUILD_BENCHMARKS)
|
||||
add_subdirectory(bench)
|
||||
endif(BUILD_BENCHMARKS)
|
||||
|
||||
-
|
||||
# uninstall target
|
||||
if (BLOSC_INSTALL)
|
||||
configure_file(
|
||||
@@ -338,10 +313,38 @@ if (BLOSC_INSTALL)
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/blosc.pc"
|
||||
DESTINATION lib/pkgconfig COMPONENT DEV)
|
||||
|
||||
+ configure_file(
|
||||
+ "${CMAKE_CURRENT_SOURCE_DIR}/cmake_config.cmake.in"
|
||||
+ "${CMAKE_CURRENT_BINARY_DIR}/cmakeexports/BloscConfig.cmake"
|
||||
+ @ONLY)
|
||||
+
|
||||
configure_file(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
||||
IMMEDIATE @ONLY)
|
||||
+
|
||||
+ include(CMakePackageConfigHelpers)
|
||||
+ write_basic_package_version_file(
|
||||
+ "${CMAKE_CURRENT_BINARY_DIR}/cmakeexports/BloscConfigVersion.cmake"
|
||||
+ VERSION ${BLOSC_VERSION_MAJOR}.${BLOSC_VERSION_MINOR}.${BLOSC_VERSION_PATCH}
|
||||
+ COMPATIBILITY AnyNewerVersion
|
||||
+ )
|
||||
+
|
||||
+ export(EXPORT BloscTargets
|
||||
+ FILE "${CMAKE_CURRENT_BINARY_DIR}/cmakeexports/BloscTargets.cmake"
|
||||
+ NAMESPACE Blosc::)
|
||||
+
|
||||
+ install(EXPORT BloscTargets
|
||||
+ FILE BloscTargets.cmake
|
||||
+ NAMESPACE Blosc::
|
||||
+ DESTINATION lib/cmake/Blosc
|
||||
+ EXPORT_LINK_INTERFACE_LIBRARIES)
|
||||
+
|
||||
+ install(FILES
|
||||
+ "${CMAKE_CURRENT_BINARY_DIR}/cmakeexports/BloscConfig.cmake"
|
||||
+ "${CMAKE_CURRENT_BINARY_DIR}/cmakeexports/BloscConfigVersion.cmake"
|
||||
+ DESTINATION lib/cmake/Blosc COMPONENT DEV)
|
||||
+
|
||||
add_custom_target(uninstall
|
||||
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
|
||||
endif()
|
||||
diff --git a/blosc/CMakeLists.txt b/blosc/CMakeLists.txt
|
||||
index 1d1bebe..f554abe 100644
|
||||
--- a/blosc/CMakeLists.txt
|
||||
+++ b/blosc/CMakeLists.txt
|
||||
@@ -1,52 +1,11 @@
|
||||
# a simple way to detect that we are using CMAKE
|
||||
add_definitions(-DUSING_CMAKE)
|
||||
|
||||
-set(INTERNAL_LIBS ${PROJECT_SOURCE_DIR}/internal-complibs)
|
||||
-
|
||||
# Hide symbols by default unless they're specifically exported.
|
||||
# This makes it easier to keep the set of exported symbols the
|
||||
# same across all compilers/platforms.
|
||||
set(CMAKE_C_VISIBILITY_PRESET hidden)
|
||||
|
||||
-# includes
|
||||
-set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
-if(NOT DEACTIVATE_LZ4)
|
||||
- if (LZ4_FOUND)
|
||||
- set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${LZ4_INCLUDE_DIR})
|
||||
- else(LZ4_FOUND)
|
||||
- set(LZ4_LOCAL_DIR ${INTERNAL_LIBS}/lz4-1.9.1)
|
||||
- set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${LZ4_LOCAL_DIR})
|
||||
- endif(LZ4_FOUND)
|
||||
-endif(NOT DEACTIVATE_LZ4)
|
||||
-
|
||||
-if(NOT DEACTIVATE_SNAPPY)
|
||||
- if (SNAPPY_FOUND)
|
||||
- set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${SNAPPY_INCLUDE_DIR})
|
||||
- else(SNAPPY_FOUND)
|
||||
- set(SNAPPY_LOCAL_DIR ${INTERNAL_LIBS}/snappy-1.1.1)
|
||||
- set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${SNAPPY_LOCAL_DIR})
|
||||
- endif(SNAPPY_FOUND)
|
||||
-endif(NOT DEACTIVATE_SNAPPY)
|
||||
-
|
||||
-if(NOT DEACTIVATE_ZLIB)
|
||||
- if (ZLIB_FOUND)
|
||||
- set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIR})
|
||||
- else(ZLIB_FOUND)
|
||||
- set(ZLIB_LOCAL_DIR ${INTERNAL_LIBS}/zlib-1.2.8)
|
||||
- set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${ZLIB_LOCAL_DIR})
|
||||
- endif(ZLIB_FOUND)
|
||||
-endif(NOT DEACTIVATE_ZLIB)
|
||||
-
|
||||
-if (NOT DEACTIVATE_ZSTD)
|
||||
- if (ZSTD_FOUND)
|
||||
- set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${ZSTD_INCLUDE_DIR})
|
||||
- else (ZSTD_FOUND)
|
||||
- set(ZSTD_LOCAL_DIR ${INTERNAL_LIBS}/zstd-1.4.1)
|
||||
- set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${ZSTD_LOCAL_DIR} ${ZSTD_LOCAL_DIR}/common)
|
||||
- endif (ZSTD_FOUND)
|
||||
-endif (NOT DEACTIVATE_ZSTD)
|
||||
-
|
||||
-include_directories(${BLOSC_INCLUDE_DIRS})
|
||||
|
||||
# library sources
|
||||
set(SOURCES blosc.c blosclz.c fastcopy.c shuffle-generic.c bitshuffle-generic.c
|
||||
@@ -73,53 +32,13 @@ if(WIN32)
|
||||
message(STATUS "using the internal pthread library for win32 systems.")
|
||||
set(SOURCES ${SOURCES} win32/pthread.c)
|
||||
else(NOT Threads_FOUND)
|
||||
- set(LIBS ${LIBS} ${CMAKE_THREAD_LIBS_INIT})
|
||||
+ list(APPEND LIBS Threads::Threads)
|
||||
endif(NOT Threads_FOUND)
|
||||
else(WIN32)
|
||||
find_package(Threads REQUIRED)
|
||||
- set(LIBS ${LIBS} ${CMAKE_THREAD_LIBS_INIT})
|
||||
+ list(APPEND LIBS Threads::Threads)
|
||||
endif(WIN32)
|
||||
|
||||
-if(NOT DEACTIVATE_LZ4)
|
||||
- if(LZ4_FOUND)
|
||||
- set(LIBS ${LIBS} ${LZ4_LIBRARY})
|
||||
- else(LZ4_FOUND)
|
||||
- file(GLOB LZ4_FILES ${LZ4_LOCAL_DIR}/*.c)
|
||||
- set(SOURCES ${SOURCES} ${LZ4_FILES})
|
||||
- endif(LZ4_FOUND)
|
||||
-endif(NOT DEACTIVATE_LZ4)
|
||||
-
|
||||
-if(NOT DEACTIVATE_SNAPPY)
|
||||
- if(SNAPPY_FOUND)
|
||||
- set(LIBS ${LIBS} ${SNAPPY_LIBRARY})
|
||||
- else(SNAPPY_FOUND)
|
||||
- file(GLOB SNAPPY_FILES ${SNAPPY_LOCAL_DIR}/*.cc)
|
||||
- set(SOURCES ${SOURCES} ${SNAPPY_FILES})
|
||||
- endif(SNAPPY_FOUND)
|
||||
-endif(NOT DEACTIVATE_SNAPPY)
|
||||
-
|
||||
-if(NOT DEACTIVATE_ZLIB)
|
||||
- if(ZLIB_FOUND)
|
||||
- set(LIBS ${LIBS} ${ZLIB_LIBRARY})
|
||||
- else(ZLIB_FOUND)
|
||||
- file(GLOB ZLIB_FILES ${ZLIB_LOCAL_DIR}/*.c)
|
||||
- set(SOURCES ${SOURCES} ${ZLIB_FILES})
|
||||
- endif(ZLIB_FOUND)
|
||||
-endif(NOT DEACTIVATE_ZLIB)
|
||||
-
|
||||
-if (NOT DEACTIVATE_ZSTD)
|
||||
- if (ZSTD_FOUND)
|
||||
- set(LIBS ${LIBS} ${ZSTD_LIBRARY})
|
||||
- else (ZSTD_FOUND)
|
||||
- file(GLOB ZSTD_FILES
|
||||
- ${ZSTD_LOCAL_DIR}/common/*.c
|
||||
- ${ZSTD_LOCAL_DIR}/compress/*.c
|
||||
- ${ZSTD_LOCAL_DIR}/decompress/*.c)
|
||||
- set(SOURCES ${SOURCES} ${ZSTD_FILES})
|
||||
- endif (ZSTD_FOUND)
|
||||
-endif (NOT DEACTIVATE_ZSTD)
|
||||
-
|
||||
-
|
||||
# targets
|
||||
if (BUILD_SHARED)
|
||||
add_library(blosc_shared SHARED ${SOURCES})
|
||||
@@ -191,14 +110,17 @@ if (BUILD_TESTS)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
+add_library(blosc INTERFACE)
|
||||
+
|
||||
if (BUILD_SHARED)
|
||||
- target_link_libraries(blosc_shared ${LIBS})
|
||||
- target_include_directories(blosc_shared PUBLIC ${BLOSC_INCLUDE_DIRS})
|
||||
+ target_link_libraries(blosc_shared PRIVATE ${LIBS})
|
||||
+ target_include_directories(blosc_shared PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
|
||||
+ target_link_libraries(blosc INTERFACE blosc_shared)
|
||||
endif()
|
||||
|
||||
if (BUILD_TESTS)
|
||||
- target_link_libraries(blosc_shared_testing ${LIBS})
|
||||
- target_include_directories(blosc_shared_testing PUBLIC ${BLOSC_INCLUDE_DIRS})
|
||||
+ target_link_libraries(blosc_shared_testing PRIVATE ${LIBS})
|
||||
+ target_include_directories(blosc_shared_testing PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
endif()
|
||||
|
||||
if(BUILD_STATIC)
|
||||
@@ -207,17 +129,31 @@ if(BUILD_STATIC)
|
||||
if (MSVC)
|
||||
set_target_properties(blosc_static PROPERTIES PREFIX lib)
|
||||
endif()
|
||||
- target_link_libraries(blosc_static ${LIBS})
|
||||
- target_include_directories(blosc_static PUBLIC ${BLOSC_INCLUDE_DIRS})
|
||||
+ # With the static library, cmake has to deal with transitive dependencies
|
||||
+ target_link_libraries(blosc_static PRIVATE ${LIBS})
|
||||
+ target_include_directories(blosc_static PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
|
||||
+ if (NOT BUILD_SHARED)
|
||||
+ target_link_libraries(blosc INTERFACE blosc_static)
|
||||
+ endif()
|
||||
endif(BUILD_STATIC)
|
||||
|
||||
+
|
||||
# install
|
||||
if(BLOSC_INSTALL)
|
||||
install(FILES blosc.h blosc-export.h DESTINATION include COMPONENT DEV)
|
||||
+ set(_inst_libs "blosc")
|
||||
if(BUILD_SHARED)
|
||||
- install(TARGETS blosc_shared DESTINATION ${lib_dir} COMPONENT LIB)
|
||||
+ list(APPEND _inst_libs blosc_shared)
|
||||
endif(BUILD_SHARED)
|
||||
if(BUILD_STATIC)
|
||||
- install(TARGETS blosc_static DESTINATION ${lib_dir} COMPONENT DEV)
|
||||
+ list(APPEND _inst_libs blosc_static)
|
||||
endif(BUILD_STATIC)
|
||||
+
|
||||
+ install(TARGETS ${_inst_libs}
|
||||
+ EXPORT BloscTargets
|
||||
+ LIBRARY DESTINATION ${lib_dir}
|
||||
+ ARCHIVE DESTINATION ${lib_dir}
|
||||
+ RUNTIME DESTINATION bin
|
||||
+ COMPONENT DEV
|
||||
+ INCLUDES DESTINATION include)
|
||||
endif(BLOSC_INSTALL)
|
||||
diff --git a/cmake/FindLZ4.cmake b/cmake/FindLZ4.cmake
|
||||
index e581a80..05de6ef 100644
|
||||
--- a/cmake/FindLZ4.cmake
|
||||
+++ b/cmake/FindLZ4.cmake
|
||||
@@ -5,6 +5,10 @@ find_library(LZ4_LIBRARY NAMES lz4)
|
||||
if (LZ4_INCLUDE_DIR AND LZ4_LIBRARY)
|
||||
set(LZ4_FOUND TRUE)
|
||||
message(STATUS "Found LZ4 library: ${LZ4_LIBRARY}")
|
||||
+ add_library(LZ4::LZ4 UNKNOWN IMPORTED)
|
||||
+ set_target_properties(LZ4::LZ4 PROPERTIES
|
||||
+ IMPORTED_LOCATION ${LZ4_LIBRARY}
|
||||
+ INTERFACE_INCLUDE_DIRECTORIES ${LZ4_INCLUDE_DIR})
|
||||
else ()
|
||||
message(STATUS "No LZ4 library found. Using internal sources.")
|
||||
-endif ()
|
||||
+endif ()
|
||||
\ No newline at end of file
|
||||
diff --git a/cmake/FindSnappy.cmake b/cmake/FindSnappy.cmake
|
||||
index 688d4d5..21dbee1 100644
|
||||
--- a/cmake/FindSnappy.cmake
|
||||
+++ b/cmake/FindSnappy.cmake
|
||||
@@ -3,8 +3,12 @@ find_path(SNAPPY_INCLUDE_DIR snappy-c.h)
|
||||
find_library(SNAPPY_LIBRARY NAMES snappy)
|
||||
|
||||
if (SNAPPY_INCLUDE_DIR AND SNAPPY_LIBRARY)
|
||||
- set(SNAPPY_FOUND TRUE)
|
||||
+ set(Snappy_FOUND TRUE)
|
||||
+ add_library(Snappy::snappy UNKNOWN IMPORTED)
|
||||
+ set_target_properties(Snappy::snappy PROPERTIES
|
||||
+ IMPORTED_LOCATION ${SNAPPY_LIBRARY}
|
||||
+ INTERFACE_INCLUDE_DIRECTORIES ${SNAPPY_INCLUDE_DIR})
|
||||
message(STATUS "Found SNAPPY library: ${SNAPPY_LIBRARY}")
|
||||
else ()
|
||||
message(STATUS "No snappy found. Using internal sources.")
|
||||
-endif ()
|
||||
+endif ()
|
||||
\ No newline at end of file
|
||||
diff --git a/cmake/FindZstd.cmake b/cmake/FindZstd.cmake
|
||||
index 7db4bb9..cabc2f8 100644
|
||||
--- a/cmake/FindZstd.cmake
|
||||
+++ b/cmake/FindZstd.cmake
|
||||
@@ -3,8 +3,12 @@ find_path(ZSTD_INCLUDE_DIR zstd.h)
|
||||
find_library(ZSTD_LIBRARY NAMES zstd)
|
||||
|
||||
if (ZSTD_INCLUDE_DIR AND ZSTD_LIBRARY)
|
||||
- set(ZSTD_FOUND TRUE)
|
||||
+ set(Zstd_FOUND TRUE)
|
||||
+ add_library(Zstd::Zstd UNKNOWN IMPORTED)
|
||||
+ set_target_properties(Zstd::Zstd PROPERTIES
|
||||
+ IMPORTED_LOCATION ${ZSTD_LIBRARY}
|
||||
+ INTERFACE_INCLUDE_DIRECTORIES ${ZSTD_INCLUDE_DIR})
|
||||
message(STATUS "Found Zstd library: ${ZSTD_LIBRARY}")
|
||||
else ()
|
||||
message(STATUS "No Zstd library found. Using internal sources.")
|
||||
-endif ()
|
||||
+endif ()
|
||||
\ No newline at end of file
|
||||
diff --git a/cmake_config.cmake.in b/cmake_config.cmake.in
|
||||
new file mode 100644
|
||||
index 0000000..0f6af24
|
||||
--- /dev/null
|
||||
+++ b/cmake_config.cmake.in
|
||||
@@ -0,0 +1,24 @@
|
||||
+include(CMakeFindDependencyMacro)
|
||||
+
|
||||
+include("${CMAKE_CURRENT_LIST_DIR}/BloscTargets.cmake")
|
||||
+
|
||||
+function(_blosc_remap_configs from_Cfg to_Cfg)
|
||||
+ string(TOUPPER ${from_Cfg} from_CFG)
|
||||
+ string(TOLOWER ${from_Cfg} from_cfg)
|
||||
+
|
||||
+ if(NOT EXISTS ${CMAKE_CURRENT_LIST_DIR}/BloscTargets-${from_cfg}.cmake)
|
||||
+ foreach(tgt IN ITEMS blosc_static blosc_shared blosc)
|
||||
+ if(TARGET Blosc::${tgt})
|
||||
+ set_target_properties(Blosc::${tgt} PROPERTIES
|
||||
+ MAP_IMPORTED_CONFIG_${from_CFG} ${to_Cfg})
|
||||
+ endif()
|
||||
+ endforeach()
|
||||
+ endif()
|
||||
+endfunction()
|
||||
+
|
||||
+# MSVC will try to link RelWithDebInfo or MinSizeRel target with debug config
|
||||
+# if no matching installation is present which would result in link errors.
|
||||
+if(MSVC)
|
||||
+ _blosc_remap_configs(RelWithDebInfo Release)
|
||||
+ _blosc_remap_configs(MinSizeRel Release)
|
||||
+endif()
|
||||
diff --git a/internal-complibs/CMakeLists.txt b/internal-complibs/CMakeLists.txt
|
||||
new file mode 100644
|
||||
index 0000000..4586efa
|
||||
--- /dev/null
|
||||
+++ b/internal-complibs/CMakeLists.txt
|
||||
@@ -0,0 +1,35 @@
|
||||
+macro(add_lib_target pkg tgt incdir files)
|
||||
+ string(TOUPPER ${pkg} TGT)
|
||||
+ if(NOT DEACTIVATE_${TGT} AND NOT ${pkg}_FOUND)
|
||||
+ add_library(${tgt}_objs OBJECT ${files})
|
||||
+ add_library(${tgt} INTERFACE)
|
||||
+ target_include_directories(${tgt}_objs PRIVATE $<BUILD_INTERFACE:${incdir}>)
|
||||
+ target_include_directories(${tgt} INTERFACE $<BUILD_INTERFACE:${incdir}>)
|
||||
+ #set_target_properties(${tgt} PROPERTIES INTERFACE_SOURCES "$<TARGET_OBJECTS:${tgt}_objs>")
|
||||
+ set_target_properties(${tgt}_objs PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
||||
+ target_sources(${tgt} INTERFACE "$<BUILD_INTERFACE:$<TARGET_OBJECTS:${tgt}_objs>>")
|
||||
+ add_library(${pkg}::${tgt} ALIAS ${tgt})
|
||||
+
|
||||
+ # This creates dummy (empty) interface targets in the exported config.
|
||||
+ install(TARGETS ${tgt} EXPORT BloscTargets INCLUDES DESTINATION include)
|
||||
+ endif()
|
||||
+ unset(TGT)
|
||||
+endmacro()
|
||||
+
|
||||
+set(ZLIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/zlib-1.2.8)
|
||||
+file(GLOB ZLIB_FILES ${ZLIB_DIR}/*.c)
|
||||
+add_lib_target(ZLIB ZLIB ${ZLIB_DIR} "${ZLIB_FILES}")
|
||||
+
|
||||
+set(SNAPPY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/snappy-1.1.1)
|
||||
+file(GLOB SNAPPY_FILES ${SNAPPY_DIR}/*.cc)
|
||||
+add_lib_target(Snappy snappy ${SNAPPY_DIR} "${SNAPPY_FILES}")
|
||||
+
|
||||
+set(LZ4_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lz4-1.9.1)
|
||||
+file(GLOB LZ4_FILES ${LZ4_DIR}/*.c)
|
||||
+add_lib_target(LZ4 LZ4 ${LZ4_DIR} "${LZ4_FILES}")
|
||||
+
|
||||
+set(ZSTD_DIR ${CMAKE_CURRENT_SOURCE_DIR}/zstd-1.4.1)
|
||||
+file(GLOB ZSTD_FILES ${ZSTD_DIR}/common/*.c ${ZSTD_DIR}/compress/*.c ${ZSTD_DIR}/decompress/*.c)
|
||||
+add_lib_target(Zstd Zstd ${ZSTD_DIR} "${ZSTD_FILES}")
|
||||
+target_include_directories(Zstd INTERFACE $<BUILD_INTERFACE:${ZSTD_DIR}/common>)
|
||||
+target_include_directories(Zstd_objs PRIVATE $<BUILD_INTERFACE:${ZSTD_DIR}/common>)
|
||||
\ No newline at end of file
|
||||
--
|
||||
2.16.2.windows.1
|
||||
|
||||
168
deps/Boost/Boost.cmake
vendored
Normal file
168
deps/Boost/Boost.cmake
vendored
Normal file
@@ -0,0 +1,168 @@
|
||||
include(ExternalProject)
|
||||
|
||||
if (WIN32)
|
||||
set(_bootstrap_cmd bootstrap.bat)
|
||||
set(_build_cmd b2.exe)
|
||||
else()
|
||||
set(_bootstrap_cmd ./bootstrap.sh)
|
||||
set(_build_cmd ./b2)
|
||||
endif()
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
set(_boost_toolset gcc)
|
||||
configure_file(${CMAKE_CURRENT_LIST_DIR}/user-config.jam boost-user-config.jam)
|
||||
set(_patch_command ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/boost-user-config.jam ./tools/build/src/tools/user-config.jam)
|
||||
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
# https://cmake.org/cmake/help/latest/variable/MSVC_VERSION.html
|
||||
if (MSVC_VERSION EQUAL 1800)
|
||||
# 1800 = VS 12.0 (v120 toolset)
|
||||
set(_boost_toolset "msvc-12.0")
|
||||
elseif (MSVC_VERSION EQUAL 1900)
|
||||
# 1900 = VS 14.0 (v140 toolset)
|
||||
set(_boost_toolset "msvc-14.0")
|
||||
elseif (MSVC_VERSION LESS 1920)
|
||||
# 1910-1919 = VS 15.0 (v141 toolset)
|
||||
set(_boost_toolset "msvc-14.1")
|
||||
elseif (MSVC_VERSION LESS 1930)
|
||||
# 1920-1929 = VS 16.0 (v142 toolset)
|
||||
set(_boost_toolset "msvc-14.2")
|
||||
elseif (MSVC_VERSION LESS 1940)
|
||||
# 1930-1939 = VS 17.0 (v143 toolset)
|
||||
set(_boost_toolset "msvc-14.3")
|
||||
else ()
|
||||
message(FATAL_ERROR "Unsupported MSVC version")
|
||||
endif ()
|
||||
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
if (WIN32)
|
||||
set(_boost_toolset "clang-win")
|
||||
elseif (APPLE)
|
||||
set(_boost_toolset "clang")
|
||||
else()
|
||||
set(_boost_toolset clang)
|
||||
configure_file(${CMAKE_CURRENT_LIST_DIR}/user-config.jam boost-user-config.jam)
|
||||
set(_patch_command ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/boost-user-config.jam ./tools/build/src/tools/user-config.jam)
|
||||
endif()
|
||||
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
set(_boost_toolset "intel")
|
||||
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
|
||||
set(_boost_toolset "clang")
|
||||
endif()
|
||||
|
||||
message(STATUS "Deduced boost toolset: ${_boost_toolset} based on ${CMAKE_CXX_COMPILER_ID} compiler")
|
||||
|
||||
set(_libs "")
|
||||
foreach(_comp ${DEP_Boost_COMPONENTS})
|
||||
list(APPEND _libs "--with-${_comp}")
|
||||
endforeach()
|
||||
|
||||
if (BUILD_SHARED_LIBS)
|
||||
set(_link shared)
|
||||
else()
|
||||
set(_link static)
|
||||
endif()
|
||||
|
||||
set(_bits "")
|
||||
if ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
|
||||
set(_bits 64)
|
||||
elseif ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4")
|
||||
set(_bits 32)
|
||||
endif ()
|
||||
|
||||
include(ProcessorCount)
|
||||
ProcessorCount(NPROC)
|
||||
file(TO_NATIVE_PATH ${DESTDIR}/usr/local/ _prefix)
|
||||
|
||||
set(_boost_flags "")
|
||||
if (UNIX)
|
||||
set(_boost_flags "cflags=-fPIC;cxxflags=-fPIC")
|
||||
endif ()
|
||||
|
||||
if(APPLE)
|
||||
set(_boost_flags
|
||||
"cflags=-fPIC -mmacosx-version-min=${DEP_OSX_TARGET};"
|
||||
"cxxflags=-fPIC -mmacosx-version-min=${DEP_OSX_TARGET};"
|
||||
"mflags=-fPIC -mmacosx-version-min=${DEP_OSX_TARGET};"
|
||||
"mmflags=-fPIC -mmacosx-version-min=${DEP_OSX_TARGET}")
|
||||
endif()
|
||||
|
||||
set(_boost_variants "")
|
||||
if(CMAKE_BUILD_TYPE)
|
||||
list(APPEND CMAKE_CONFIGURATION_TYPES ${CMAKE_BUILD_TYPE})
|
||||
list(REMOVE_DUPLICATES CMAKE_CONFIGURATION_TYPES)
|
||||
endif()
|
||||
list(FIND CMAKE_CONFIGURATION_TYPES "Release" _cfg_rel)
|
||||
list(FIND CMAKE_CONFIGURATION_TYPES "RelWithDebInfo" _cfg_relwdeb)
|
||||
list(FIND CMAKE_CONFIGURATION_TYPES "MinSizeRel" _cfg_minsizerel)
|
||||
list(FIND CMAKE_CONFIGURATION_TYPES "Debug" _cfg_deb)
|
||||
|
||||
if (_cfg_rel GREATER -1 OR _cfg_relwdeb GREATER -1 OR _cfg_minsizerel GREATER -1)
|
||||
list(APPEND _boost_variants release)
|
||||
endif()
|
||||
|
||||
if ( (NOT MSVC AND _cfg_deb GREATER -1) OR (MSVC AND ${DEP_DEBUG}) )
|
||||
list(APPEND _boost_variants debug)
|
||||
endif()
|
||||
|
||||
if (NOT _boost_variants)
|
||||
set(_boost_variants release)
|
||||
endif()
|
||||
|
||||
set(_boost_layout system)
|
||||
if (MSVC)
|
||||
set(_boost_layout versioned)
|
||||
endif ()
|
||||
|
||||
set(_build_cmd ${_build_cmd}
|
||||
${_boost_flags}
|
||||
-j${NPROC}
|
||||
${_libs}
|
||||
--layout=${_boost_layout}
|
||||
--debug-configuration
|
||||
toolset=${_boost_toolset}
|
||||
address-model=${_bits}
|
||||
link=${_link}
|
||||
threading=multi
|
||||
boost.locale.icu=off
|
||||
--disable-icu
|
||||
${_boost_variants}
|
||||
stage)
|
||||
|
||||
set(_install_cmd ${_build_cmd} --prefix=${_prefix} install)
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
# When Clang is used with enabled UndefinedBehaviorSanitizer, it produces "undefined reference to '__muloti4'" when __int128 is used.
|
||||
# Because of that, UndefinedBehaviorSanitizer is disabled for those functions that use __int128.
|
||||
list(APPEND _patch_command COMMAND ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/Boost.patch)
|
||||
endif ()
|
||||
|
||||
ExternalProject_Add(
|
||||
dep_Boost
|
||||
URL "https://boostorg.jfrog.io/artifactory/main/release/1.78.0/source/boost_1_78_0.zip"
|
||||
URL_HASH SHA256=f22143b5528e081123c3c5ed437e92f648fe69748e95fa6e2bd41484e2986cc3
|
||||
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/Boost
|
||||
CONFIGURE_COMMAND "${_bootstrap_cmd}"
|
||||
PATCH_COMMAND ${_patch_command}
|
||||
BUILD_COMMAND "${_build_cmd}"
|
||||
BUILD_IN_SOURCE ON
|
||||
INSTALL_COMMAND "${_install_cmd}"
|
||||
)
|
||||
|
||||
if ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
|
||||
# Patch the boost::polygon library with a custom one.
|
||||
ExternalProject_Add(dep_boost_polygon
|
||||
EXCLUDE_FROM_ALL ON
|
||||
# GIT_REPOSITORY "https://github.com/qidi3d/polygon"
|
||||
# GIT_TAG qidislicer_gmp
|
||||
URL https://github.com/qidi3d/polygon/archive/refs/heads/qidislicer_gmp.zip
|
||||
URL_HASH SHA256=abeb9710f0a7069fb9b22181ae5c56f6066002f125db210e7ffb27032aed6824
|
||||
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/boost_polygon
|
||||
DEPENDS dep_Boost
|
||||
CONFIGURE_COMMAND ""
|
||||
BUILD_COMMAND ""
|
||||
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/dep_boost_polygon-prefix/src/dep_boost_polygon/include/boost/polygon"
|
||||
"${DESTDIR}/usr/local/include/boost/polygon"
|
||||
)
|
||||
# Only override boost::Polygon Voronoi implementation with Vojtech's GMP hacks on 64bit platforms.
|
||||
list(APPEND _dep_list "dep_boost_polygon")
|
||||
endif ()
|
||||
23
deps/Boost/Boost.patch
vendored
Normal file
23
deps/Boost/Boost.patch
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
diff -u ../boost_1_75_0-orig/boost/rational.hpp ./boost/rational.hpp
|
||||
--- ../boost_1_75_0-orig/boost/rational.hpp 2020-12-03 06:02:19.000000000 +0100
|
||||
+++ ./boost/rational.hpp 2022-01-27 16:02:27.993848905 +0100
|
||||
@@ -302,6 +302,9 @@
|
||||
return *this;
|
||||
}
|
||||
template <class T>
|
||||
+ #if defined(__clang__)
|
||||
+ __attribute__((no_sanitize("undefined")))
|
||||
+ #endif
|
||||
BOOST_CXX14_CONSTEXPR typename boost::enable_if_c<rational_detail::is_compatible_integer<T, IntType>::value, rational&>::type operator*= (const T& i)
|
||||
{
|
||||
// Avoid overflow and preserve normalization
|
||||
@@ -311,6 +314,9 @@
|
||||
return *this;
|
||||
}
|
||||
template <class T>
|
||||
+ #if defined(__clang__)
|
||||
+ __attribute__((no_sanitize("undefined")))
|
||||
+ #endif
|
||||
BOOST_CXX14_CONSTEXPR typename boost::enable_if_c<rational_detail::is_compatible_integer<T, IntType>::value, rational&>::type operator/= (const T& i)
|
||||
{
|
||||
// Avoid repeated construction
|
||||
1
deps/Boost/user-config.jam
vendored
Normal file
1
deps/Boost/user-config.jam
vendored
Normal file
@@ -0,0 +1 @@
|
||||
using @_boost_toolset@ : : @CMAKE_CXX_COMPILER@ ;
|
||||
11
deps/CGAL/CGAL.cmake
vendored
Normal file
11
deps/CGAL/CGAL.cmake
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
qidislicer_add_cmake_project(
|
||||
CGAL
|
||||
# GIT_REPOSITORY https://github.com/CGAL/cgal.git
|
||||
# GIT_TAG bec70a6d52d8aacb0b3d82a7b4edc3caa899184b # releases/CGAL-5.0
|
||||
# For whatever reason, this keeps downloading forever (repeats downloads if finished)
|
||||
URL https://github.com/CGAL/cgal/archive/refs/tags/v5.4.zip
|
||||
URL_HASH SHA256=d7605e0a5a5ca17da7547592f6f6e4a59430a0bc861948974254d0de43eab4c0
|
||||
DEPENDS dep_Boost dep_GMP dep_MPFR
|
||||
)
|
||||
|
||||
include(GNUInstallDirs)
|
||||
25
deps/CGAL/cgal/CGALConfigVersion.cmake
vendored
Normal file
25
deps/CGAL/cgal/CGALConfigVersion.cmake
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
# This is a basic version file for the Config-mode of find_package().
|
||||
# It is used by write_basic_package_version_file() as input file for configure_file()
|
||||
# to create a version-file which can be installed along a config.cmake file.
|
||||
#
|
||||
# The created file sets PACKAGE_VERSION_EXACT if the current version string and
|
||||
# the requested version string are exactly the same and it sets
|
||||
# PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version.
|
||||
# The variable CVF_VERSION must be set before calling configure_file().
|
||||
|
||||
set(PACKAGE_VERSION "5.0.0")
|
||||
|
||||
if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
|
||||
set(PACKAGE_VERSION_COMPATIBLE FALSE)
|
||||
else()
|
||||
set(PACKAGE_VERSION_COMPATIBLE TRUE)
|
||||
if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
|
||||
set(PACKAGE_VERSION_EXACT TRUE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
# if the installed project requested no architecture check, don't perform the check
|
||||
if("FALSE")
|
||||
return()
|
||||
endif()
|
||||
223
deps/CMakeLists.txt
vendored
Normal file
223
deps/CMakeLists.txt
vendored
Normal file
@@ -0,0 +1,223 @@
|
||||
#
|
||||
# This CMake project downloads, configures and builds QIDISlicer dependencies on Unix and Windows.
|
||||
#
|
||||
# When using this script, it's recommended to perform an out-of-source build using CMake.
|
||||
#
|
||||
# All the dependencies are installed in a `destdir` directory in the root of the build directory,
|
||||
# in a traditional Unix-style prefix structure. The destdir can be used directly by CMake
|
||||
# when building QIDISlicer - to do this, set the CMAKE_PREFIX_PATH to ${destdir}/usr/local.
|
||||
# Warning: On UNIX/Linux, you also need to set -DSLIC3R_STATIC=1 when building QIDISlicer.
|
||||
#
|
||||
# For better clarity of console output, it's recommended to _not_ use a parallelized build
|
||||
# for the top-level command, ie. use `make -j 1` or `ninja -j 1` to force single-threaded top-level
|
||||
# build. This doesn't degrade performance as individual dependencies are built in parallel fashion
|
||||
# if supported by the dependency.
|
||||
#
|
||||
# On Windows, architecture (64 vs 32 bits) is judged based on the compiler variant.
|
||||
# To build dependencies for either 64 or 32 bit OS, use the respective compiler command line.
|
||||
#
|
||||
# WARNING: On UNIX platforms wxWidgets hardcode the destdir path into its `wx-conffig` utility,
|
||||
# therefore, unfortunatelly, the installation cannot be copied/moved elsewhere without re-installing wxWidgets.
|
||||
#
|
||||
|
||||
project(QIDISlicer-deps)
|
||||
cmake_minimum_required(VERSION 3.2)
|
||||
|
||||
include(ExternalProject)
|
||||
include(ProcessorCount)
|
||||
|
||||
ProcessorCount(NPROC)
|
||||
if (NPROC EQUAL 0)
|
||||
set(NPROC 1)
|
||||
endif ()
|
||||
|
||||
set(DESTDIR "${CMAKE_CURRENT_BINARY_DIR}/destdir" CACHE PATH "Destination directory")
|
||||
set(DEP_DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE PATH "Path for downloaded source packages.")
|
||||
|
||||
option(DEP_DEBUG "Build debug variants (only applicable on Windows)" ON)
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
option(DEP_WX_GTK3 "Build wxWidgets against GTK3" OFF)
|
||||
endif()
|
||||
|
||||
# On developer machines, it can be enabled to speed up compilation and suppress warnings coming from IGL.
|
||||
# FIXME:
|
||||
# Enabling this option is not safe. IGL will compile itself with its own version of Eigen while
|
||||
# Slic3r compiles with a different version which will cause runtime errors.
|
||||
# option(DEP_BUILD_IGL_STATIC "Build IGL as a static library. Might cause link errors and increase binary size." OFF)
|
||||
|
||||
message(STATUS "QIDISlicer deps DESTDIR: ${DESTDIR}")
|
||||
message(STATUS "QIDISlicer dowload dir for source packages: ${DEP_DOWNLOAD_DIR}")
|
||||
message(STATUS "QIDISlicer deps debug build: ${DEP_DEBUG}")
|
||||
|
||||
find_package(Git REQUIRED)
|
||||
|
||||
# The default command line for patching. Only works for newer
|
||||
set(PATCH_CMD ${GIT_EXECUTABLE} apply --verbose --ignore-space-change --whitespace=fix)
|
||||
|
||||
get_property(_is_multi GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
||||
|
||||
if (NOT _is_multi AND NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE Release)
|
||||
message(STATUS "Forcing CMAKE_BUILD_TYPE to Release as it was not specified.")
|
||||
endif ()
|
||||
|
||||
function(qidislicer_add_cmake_project projectname)
|
||||
cmake_parse_arguments(P_ARGS "" "INSTALL_DIR;BUILD_COMMAND;INSTALL_COMMAND" "CMAKE_ARGS" ${ARGN})
|
||||
|
||||
set(_configs_line -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE})
|
||||
if (_is_multi OR MSVC)
|
||||
set(_configs_line "")
|
||||
endif ()
|
||||
|
||||
set(_gen "")
|
||||
set(_build_j "-j${NPROC}")
|
||||
if (MSVC)
|
||||
set(_gen CMAKE_GENERATOR "${DEP_MSVC_GEN}" CMAKE_GENERATOR_PLATFORM "${DEP_PLATFORM}")
|
||||
set(_build_j "/m")
|
||||
if (${projectname} STREQUAL "OCCT")
|
||||
set(_build_j "/m:1")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
ExternalProject_Add(
|
||||
dep_${projectname}
|
||||
EXCLUDE_FROM_ALL ON
|
||||
INSTALL_DIR ${DESTDIR}/usr/local
|
||||
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/${projectname}
|
||||
${_gen}
|
||||
CMAKE_ARGS
|
||||
-DCMAKE_INSTALL_PREFIX:STRING=${DESTDIR}/usr/local
|
||||
-DCMAKE_MODULE_PATH:STRING=${PROJECT_SOURCE_DIR}/../cmake/modules
|
||||
-DCMAKE_PREFIX_PATH:STRING=${DESTDIR}/usr/local
|
||||
-DCMAKE_DEBUG_POSTFIX:STRING=d
|
||||
-DCMAKE_C_COMPILER:STRING=${CMAKE_C_COMPILER}
|
||||
-DCMAKE_CXX_COMPILER:STRING=${CMAKE_CXX_COMPILER}
|
||||
-DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE}
|
||||
-DBUILD_SHARED_LIBS:BOOL=OFF
|
||||
"${_configs_line}"
|
||||
${DEP_CMAKE_OPTS}
|
||||
${P_ARGS_CMAKE_ARGS}
|
||||
${P_ARGS_UNPARSED_ARGUMENTS}
|
||||
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config Release -- ${_build_j}
|
||||
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config Release
|
||||
)
|
||||
|
||||
endfunction(qidislicer_add_cmake_project)
|
||||
|
||||
|
||||
if (MSVC)
|
||||
if ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
|
||||
message(STATUS "\nDetected 64-bit compiler => building 64-bit deps bundle\n")
|
||||
set(DEPS_BITS 64)
|
||||
include("deps-windows.cmake")
|
||||
elseif ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4")
|
||||
message(STATUS "\nDetected 32-bit compiler => building 32-bit deps bundle\n")
|
||||
set(DEPS_BITS 32)
|
||||
include("deps-windows.cmake")
|
||||
else ()
|
||||
message(FATAL_ERROR "Unable to detect architecture")
|
||||
endif ()
|
||||
elseif (APPLE)
|
||||
message("OS X SDK Path: ${CMAKE_OSX_SYSROOT}")
|
||||
if (CMAKE_OSX_DEPLOYMENT_TARGET)
|
||||
set(DEP_OSX_TARGET "${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
||||
message("OS X Deployment Target: ${DEP_OSX_TARGET}")
|
||||
else ()
|
||||
# Attempt to infer the SDK version from the CMAKE_OSX_SYSROOT,
|
||||
# this is done because wxWidgets need the min version explicitly set
|
||||
string(REGEX MATCH "[0-9]+[.][0-9]+[.]sdk$" DEP_OSX_TARGET "${CMAKE_OSX_SYSROOT}")
|
||||
string(REGEX MATCH "^[0-9]+[.][0-9]+" DEP_OSX_TARGET "${DEP_OSX_TARGET}")
|
||||
|
||||
if (NOT DEP_OSX_TARGET)
|
||||
message(FATAL_ERROR "Could not determine OS X SDK version. Please use -DCMAKE_OSX_DEPLOYMENT_TARGET=<version>")
|
||||
endif ()
|
||||
|
||||
message("OS X Deployment Target (inferred from SDK): ${DEP_OSX_TARGET}")
|
||||
endif ()
|
||||
|
||||
include("deps-macos.cmake")
|
||||
elseif (MINGW)
|
||||
message(STATUS "Building for MinGW...")
|
||||
include("deps-mingw.cmake")
|
||||
else()
|
||||
include("deps-linux.cmake")
|
||||
endif()
|
||||
|
||||
set(ZLIB_PKG "")
|
||||
if (NOT ZLIB_FOUND)
|
||||
include(ZLIB/ZLIB.cmake)
|
||||
set(ZLIB_PKG dep_ZLIB)
|
||||
endif ()
|
||||
set(PNG_PKG "")
|
||||
if (NOT PNG_FOUND)
|
||||
include(PNG/PNG.cmake)
|
||||
set(PNG_PKG dep_PNG)
|
||||
endif ()
|
||||
set(EXPAT_PKG "")
|
||||
if (NOT EXPAT_FOUND)
|
||||
include(EXPAT/EXPAT.cmake)
|
||||
set(EXPAT_PKG dep_EXPAT)
|
||||
endif ()
|
||||
|
||||
set(DEP_Boost_COMPONENTS system iostreams filesystem thread log locale regex date_time)
|
||||
include(Boost/Boost.cmake)
|
||||
|
||||
# The order of includes respects the dependencies between libraries
|
||||
include(Cereal/Cereal.cmake)
|
||||
include(Qhull/Qhull.cmake)
|
||||
include(GLEW/GLEW.cmake)
|
||||
include(OpenCSG/OpenCSG.cmake)
|
||||
|
||||
include(TBB/TBB.cmake)
|
||||
|
||||
include(Blosc/Blosc.cmake)
|
||||
include(OpenEXR/OpenEXR.cmake)
|
||||
include(OpenVDB/OpenVDB.cmake)
|
||||
|
||||
include(GMP/GMP.cmake)
|
||||
include(MPFR/MPFR.cmake)
|
||||
include(CGAL/CGAL.cmake)
|
||||
|
||||
include(NLopt/NLopt.cmake)
|
||||
|
||||
include(OpenSSL/OpenSSL.cmake)
|
||||
|
||||
set(CURL_PKG "")
|
||||
if (NOT CURL_FOUND)
|
||||
include(CURL/CURL.cmake)
|
||||
set(CURL_PKG dep_CURL)
|
||||
endif ()
|
||||
|
||||
include(JPEG/JPEG.cmake)
|
||||
include(TIFF/TIFF.cmake)
|
||||
include(NanoSVG/NanoSVG.cmake)
|
||||
include(wxWidgets/wxWidgets.cmake)
|
||||
include(OCCT/OCCT.cmake)
|
||||
|
||||
set(_dep_list
|
||||
dep_Boost
|
||||
dep_TBB
|
||||
${CURL_PKG}
|
||||
dep_wxWidgets
|
||||
dep_Cereal
|
||||
dep_NLopt
|
||||
dep_OpenVDB
|
||||
dep_OpenCSG
|
||||
dep_CGAL
|
||||
dep_Qhull
|
||||
dep_OCCT
|
||||
${PNG_PKG}
|
||||
${ZLIB_PKG}
|
||||
${EXPAT_PKG}
|
||||
)
|
||||
|
||||
# if (NOT MSVC)
|
||||
# Not working, static build has different Eigen
|
||||
#list(APPEND _dep_list "dep_libigl")
|
||||
# endif()
|
||||
|
||||
add_custom_target(deps ALL DEPENDS ${_dep_list})
|
||||
|
||||
# Note: I'm not using any of the LOG_xxx options in ExternalProject_Add() commands
|
||||
# because they seem to generate bogus build files (possibly a bug in ExternalProject).
|
||||
80
deps/CURL/CURL.cmake
vendored
Normal file
80
deps/CURL/CURL.cmake
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
set(_curl_platform_flags
|
||||
-DENABLE_IPV6:BOOL=ON
|
||||
-DENABLE_VERSIONED_SYMBOLS:BOOL=ON
|
||||
-DENABLE_THREADED_RESOLVER:BOOL=ON
|
||||
|
||||
# -DCURL_DISABLE_LDAP:BOOL=ON
|
||||
# -DCURL_DISABLE_LDAPS:BOOL=ON
|
||||
-DENABLE_MANUAL:BOOL=OFF
|
||||
# -DCURL_DISABLE_RTSP:BOOL=ON
|
||||
# -DCURL_DISABLE_DICT:BOOL=ON
|
||||
# -DCURL_DISABLE_TELNET:BOOL=ON
|
||||
# -DCURL_DISABLE_POP3:BOOL=ON
|
||||
# -DCURL_DISABLE_IMAP:BOOL=ON
|
||||
# -DCURL_DISABLE_SMB:BOOL=ON
|
||||
# -DCURL_DISABLE_SMTP:BOOL=ON
|
||||
# -DCURL_DISABLE_GOPHER:BOOL=ON
|
||||
-DHTTP_ONLY=ON
|
||||
|
||||
-DCMAKE_USE_GSSAPI:BOOL=OFF
|
||||
-DCMAKE_USE_LIBSSH2:BOOL=OFF
|
||||
-DUSE_RTMP:BOOL=OFF
|
||||
-DUSE_NGHTTP2:BOOL=OFF
|
||||
-DUSE_MBEDTLS:BOOL=OFF
|
||||
)
|
||||
|
||||
if (WIN32)
|
||||
set(_curl_platform_flags ${_curl_platform_flags} -DCMAKE_USE_SCHANNEL=ON)
|
||||
elseif (APPLE)
|
||||
set(_curl_platform_flags
|
||||
|
||||
${_curl_platform_flags}
|
||||
|
||||
-DCMAKE_USE_SECTRANSP:BOOL=ON
|
||||
-DCMAKE_USE_OPENSSL:BOOL=OFF
|
||||
|
||||
-DCURL_CA_PATH:STRING=none
|
||||
)
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
set(_curl_platform_flags
|
||||
|
||||
${_curl_platform_flags}
|
||||
|
||||
-DCMAKE_USE_OPENSSL:BOOL=ON
|
||||
|
||||
-DCURL_CA_PATH:STRING=none
|
||||
-DCURL_CA_BUNDLE:STRING=none
|
||||
-DCURL_CA_FALLBACK:BOOL=ON
|
||||
)
|
||||
endif ()
|
||||
|
||||
set(_patch_command "")
|
||||
if (UNIX AND NOT APPLE)
|
||||
# On non-apple UNIX platforms, finding the location of OpenSSL certificates is necessary at runtime, as there is no standard location usable across platforms.
|
||||
# The OPENSSL_CERT_OVERRIDE flag is understood by QIDISlicer and will trigger the search of certificates at initial application launch.
|
||||
# Then ask the user for consent about the correctness of the found location.
|
||||
set (_patch_command echo set_target_properties(CURL::libcurl PROPERTIES INTERFACE_COMPILE_DEFINITIONS OPENSSL_CERT_OVERRIDE) >> CMake/curl-config.cmake.in)
|
||||
endif ()
|
||||
|
||||
qidislicer_add_cmake_project(CURL
|
||||
# GIT_REPOSITORY https://github.com/curl/curl.git
|
||||
# GIT_TAG curl-7_75_0
|
||||
URL https://github.com/curl/curl/archive/refs/tags/curl-7_75_0.zip
|
||||
URL_HASH SHA256=a63ae025bb0a14f119e73250f2c923f4bf89aa93b8d4fafa4a9f5353a96a765a
|
||||
DEPENDS ${ZLIB_PKG}
|
||||
# PATCH_COMMAND ${GIT_EXECUTABLE} checkout -f -- . && git clean -df &&
|
||||
# ${GIT_EXECUTABLE} apply --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/curl-mods.patch
|
||||
PATCH_COMMAND "${_patch_command}"
|
||||
CMAKE_ARGS
|
||||
-DBUILD_TESTING:BOOL=OFF
|
||||
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
|
||||
${_curl_platform_flags}
|
||||
)
|
||||
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
add_dependencies(dep_CURL dep_OpenSSL)
|
||||
endif ()
|
||||
|
||||
if (MSVC)
|
||||
add_debug_dep(dep_CURL)
|
||||
endif ()
|
||||
8
deps/Cereal/Cereal.cmake
vendored
Normal file
8
deps/Cereal/Cereal.cmake
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
qidislicer_add_cmake_project(Cereal
|
||||
URL "https://github.com/USCiLab/cereal/archive/refs/tags/v1.3.0.zip"
|
||||
URL_HASH SHA256=71642cb54658e98c8f07a0f0d08bf9766f1c3771496936f6014169d3726d9657
|
||||
CMAKE_ARGS
|
||||
-DJUST_INSTALL_CEREAL=ON
|
||||
-DSKIP_PERFORMANCE_COMPARISON=ON
|
||||
-DBUILD_TESTS=OFF
|
||||
)
|
||||
21
deps/EXPAT/EXPAT.cmake
vendored
Normal file
21
deps/EXPAT/EXPAT.cmake
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
#qidislicer_add_cmake_project(EXPAT
|
||||
# # GIT_REPOSITORY https://github.com/nigels-com/glew.git
|
||||
# # GIT_TAG 3a8eff7 # 2.1.0
|
||||
# SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/expat
|
||||
#)
|
||||
|
||||
qidislicer_add_cmake_project(EXPAT
|
||||
URL https://github.com/libexpat/libexpat/archive/refs/tags/R_2_4_3.zip
|
||||
URL_HASH SHA256=8851e199d763dc785277d6d414ed3e70ff683915158b51b8d8781df0e3af950a
|
||||
SOURCE_SUBDIR expat
|
||||
CMAKE_ARGS
|
||||
-DEXPAT_BUILD_TOOLS:BOOL=OFF
|
||||
-DEXPAT_BUILD_EXAMPLES:BOOL=OFF
|
||||
-DEXPAT_BUILD_TESTS:BOOL=OFF
|
||||
-DEXPAT_BUILD_DOCS=OFF
|
||||
-DEXPAT_BUILD_PKGCONFIG=OFF
|
||||
)
|
||||
|
||||
if (MSVC)
|
||||
add_debug_dep(dep_EXPAT)
|
||||
endif ()
|
||||
16
deps/GLEW/GLEW.cmake
vendored
Normal file
16
deps/GLEW/GLEW.cmake
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
# We have to check for OpenGL to compile GLEW
|
||||
set(OpenGL_GL_PREFERENCE "LEGACY") # to prevent a nasty warning by cmake
|
||||
find_package(OpenGL QUIET REQUIRED)
|
||||
|
||||
qidislicer_add_cmake_project(
|
||||
GLEW
|
||||
URL https://sourceforge.net/projects/glew/files/glew/2.2.0/glew-2.2.0.zip
|
||||
URL_HASH SHA256=a9046a913774395a095edcc0b0ac2d81c3aacca61787b39839b941e9be14e0d4
|
||||
SOURCE_SUBDIR build/cmake
|
||||
CMAKE_ARGS
|
||||
-DBUILD_UTILS=OFF
|
||||
)
|
||||
|
||||
if (MSVC)
|
||||
add_debug_dep(dep_GLEW)
|
||||
endif ()
|
||||
54
deps/GMP/GMP.cmake
vendored
Normal file
54
deps/GMP/GMP.cmake
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
|
||||
set(_srcdir ${CMAKE_CURRENT_LIST_DIR}/gmp)
|
||||
set(_dstdir ${DESTDIR}/usr/local)
|
||||
|
||||
if (MSVC)
|
||||
set(_output ${_dstdir}/include/gmp.h
|
||||
${_dstdir}/lib/libgmp-10.lib
|
||||
${_dstdir}/bin/libgmp-10.dll)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${_output}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/include/gmp.h ${_dstdir}/include/
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/lib/win${DEPS_BITS}/libgmp-10.lib ${_dstdir}/lib/
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/lib/win${DEPS_BITS}/libgmp-10.dll ${_dstdir}/bin/
|
||||
)
|
||||
|
||||
add_custom_target(dep_GMP SOURCES ${_output})
|
||||
|
||||
else ()
|
||||
set(_gmp_ccflags "-O2 -DNDEBUG -fPIC -DPIC -Wall -Wmissing-prototypes -Wpointer-arith -pedantic -fomit-frame-pointer -fno-common")
|
||||
set(_gmp_build_tgt "${CMAKE_SYSTEM_PROCESSOR}")
|
||||
|
||||
if (APPLE)
|
||||
if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm")
|
||||
set(_gmp_build_tgt aarch64)
|
||||
endif()
|
||||
set(_gmp_ccflags "${_gmp_ccflags} -mmacosx-version-min=${DEP_OSX_TARGET}")
|
||||
set(_gmp_build_tgt "--build=${_gmp_build_tgt}-apple-darwin")
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm")
|
||||
set(_gmp_ccflags "${_gmp_ccflags} -march=armv7-a") # Works on RPi-4
|
||||
set(_gmp_build_tgt armv7)
|
||||
endif()
|
||||
set(_gmp_build_tgt "--build=${_gmp_build_tgt}-pc-linux-gnu")
|
||||
else ()
|
||||
set(_gmp_build_tgt "") # let it guess
|
||||
endif()
|
||||
|
||||
set(_cross_compile_arg "")
|
||||
if (CMAKE_CROSSCOMPILING)
|
||||
# TOOLCHAIN_PREFIX should be defined in the toolchain file
|
||||
set(_cross_compile_arg --host=${TOOLCHAIN_PREFIX})
|
||||
endif ()
|
||||
|
||||
ExternalProject_Add(dep_GMP
|
||||
URL https://gmplib.org/download/gmp/gmp-6.2.1.tar.bz2
|
||||
URL_HASH SHA256=eae9326beb4158c386e39a356818031bd28f3124cf915f8c5b1dc4c7a36b4d7c
|
||||
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/GMP
|
||||
BUILD_IN_SOURCE ON
|
||||
CONFIGURE_COMMAND env "CFLAGS=${_gmp_ccflags}" "CXXFLAGS=${_gmp_ccflags}" ./configure ${_cross_compile_arg} --enable-shared=no --enable-cxx=yes --enable-static=yes "--prefix=${DESTDIR}/usr/local" ${_gmp_build_tgt}
|
||||
BUILD_COMMAND make -j
|
||||
INSTALL_COMMAND make install
|
||||
)
|
||||
endif ()
|
||||
674
deps/GMP/gmp/gmp.COPYING
vendored
Normal file
674
deps/GMP/gmp/gmp.COPYING
vendored
Normal file
@@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
105
deps/GMP/gmp/gmp.README
vendored
Normal file
105
deps/GMP/gmp/gmp.README
vendored
Normal file
@@ -0,0 +1,105 @@
|
||||
Copyright 1991, 1996, 1999, 2000, 2007 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU MP Library.
|
||||
|
||||
The GNU MP Library is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
The GNU MP Library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
||||
License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
THE GNU MP LIBRARY
|
||||
|
||||
|
||||
GNU MP is a library for arbitrary precision arithmetic, operating on signed
|
||||
integers, rational numbers, and floating point numbers. It has a rich set of
|
||||
functions, and the functions have a regular interface.
|
||||
|
||||
GNU MP is designed to be as fast as possible, both for small operands and huge
|
||||
operands. The speed is achieved by using fullwords as the basic arithmetic
|
||||
type, by using fast algorithms, with carefully optimized assembly code for the
|
||||
most common inner loops for lots of CPUs, and by a general emphasis on speed
|
||||
(instead of simplicity or elegance).
|
||||
|
||||
GNU MP is believed to be faster than any other similar library. Its advantage
|
||||
increases with operand sizes for certain operations, since GNU MP in many
|
||||
cases has asymptotically faster algorithms.
|
||||
|
||||
GNU MP is free software and may be freely copied on the terms contained in the
|
||||
files COPYING.LIB and COPYING (most of GNU MP is under the former, some under
|
||||
the latter).
|
||||
|
||||
|
||||
|
||||
OVERVIEW OF GNU MP
|
||||
|
||||
There are five classes of functions in GNU MP.
|
||||
|
||||
1. Signed integer arithmetic functions (mpz). These functions are intended
|
||||
to be easy to use, with their regular interface. The associated type is
|
||||
`mpz_t'.
|
||||
|
||||
2. Rational arithmetic functions (mpq). For now, just a small set of
|
||||
functions necessary for basic rational arithmetics. The associated type
|
||||
is `mpq_t'.
|
||||
|
||||
3. Floating-point arithmetic functions (mpf). If the C type `double'
|
||||
doesn't give enough precision for your application, declare your
|
||||
variables as `mpf_t' instead, set the precision to any number desired,
|
||||
and call the functions in the mpf class for the arithmetic operations.
|
||||
|
||||
4. Positive-integer, hard-to-use, very low overhead functions are in the
|
||||
mpn class. No memory management is performed. The caller must ensure
|
||||
enough space is available for the results. The set of functions is not
|
||||
regular, nor is the calling interface. These functions accept input
|
||||
arguments in the form of pairs consisting of a pointer to the least
|
||||
significant word, and an integral size telling how many limbs (= words)
|
||||
the pointer points to.
|
||||
|
||||
Almost all calculations, in the entire package, are made by calling these
|
||||
low-level functions.
|
||||
|
||||
5. Berkeley MP compatible functions.
|
||||
|
||||
To use these functions, include the file "mp.h". You can test if you are
|
||||
using the GNU version by testing if the symbol __GNU_MP__ is defined.
|
||||
|
||||
For more information on how to use GNU MP, please refer to the documentation.
|
||||
It is composed from the file doc/gmp.texi, and can be displayed on the screen
|
||||
or printed. How to do that, as well how to build the library, is described in
|
||||
the INSTALL file in this directory.
|
||||
|
||||
|
||||
|
||||
REPORTING BUGS
|
||||
|
||||
If you find a bug in the library, please make sure to tell us about it!
|
||||
|
||||
You should first check the GNU MP web pages at http://gmplib.org/, under
|
||||
"Status of the current release". There will be patches for all known serious
|
||||
bugs there.
|
||||
|
||||
Report bugs to gmp-bugs@gmplib.org. What information is needed in a useful bug
|
||||
report is described in the manual. The same address can be used for suggesting
|
||||
modifications and enhancements.
|
||||
|
||||
|
||||
|
||||
|
||||
----------------
|
||||
Local variables:
|
||||
mode: text
|
||||
fill-column: 78
|
||||
End:
|
||||
2280
deps/GMP/gmp/include/gmp.h
vendored
Normal file
2280
deps/GMP/gmp/include/gmp.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
8
deps/JPEG/JPEG.cmake
vendored
Normal file
8
deps/JPEG/JPEG.cmake
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
qidislicer_add_cmake_project(JPEG
|
||||
URL https://github.com/libjpeg-turbo/libjpeg-turbo/archive/refs/tags/2.0.6.zip
|
||||
URL_HASH SHA256=017bdc33ff3a72e11301c0feb4657cb27719d7f97fa67a78ed506c594218bbf1
|
||||
DEPENDS ${ZLIB_PKG}
|
||||
CMAKE_ARGS
|
||||
-DENABLE_SHARED=OFF
|
||||
-DENABLE_STATIC=ON
|
||||
)
|
||||
38
deps/MPFR/MPFR.cmake
vendored
Normal file
38
deps/MPFR/MPFR.cmake
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
set(_srcdir ${CMAKE_CURRENT_LIST_DIR}/mpfr)
|
||||
set(_dstdir ${DESTDIR}/usr/local)
|
||||
|
||||
if (MSVC)
|
||||
set(_output ${_dstdir}/include/mpfr.h
|
||||
${_dstdir}/include/mpf2mpfr.h
|
||||
${_dstdir}/lib/libmpfr-4.lib
|
||||
${_dstdir}/bin/libmpfr-4.dll)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${_output}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/include/mpfr.h ${_dstdir}/include/
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/include/mpf2mpfr.h ${_dstdir}/include/
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/lib/win${DEPS_BITS}/libmpfr-4.lib ${_dstdir}/lib/
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/lib/win${DEPS_BITS}/libmpfr-4.dll ${_dstdir}/bin/
|
||||
)
|
||||
|
||||
add_custom_target(dep_MPFR SOURCES ${_output})
|
||||
|
||||
else ()
|
||||
|
||||
set(_cross_compile_arg "")
|
||||
if (CMAKE_CROSSCOMPILING)
|
||||
# TOOLCHAIN_PREFIX should be defined in the toolchain file
|
||||
set(_cross_compile_arg --host=${TOOLCHAIN_PREFIX})
|
||||
endif ()
|
||||
|
||||
ExternalProject_Add(dep_MPFR
|
||||
URL http://ftp.vim.org/ftp/gnu/mpfr/mpfr-3.1.6.tar.bz2 https://www.mpfr.org/mpfr-3.1.6/mpfr-3.1.6.tar.bz2 # mirrors are allowed
|
||||
URL_HASH SHA256=cf4f4b2d80abb79e820e78c8077b6725bbbb4e8f41896783c899087be0e94068
|
||||
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/MPFR
|
||||
BUILD_IN_SOURCE ON
|
||||
CONFIGURE_COMMAND env "CFLAGS=${_gmp_ccflags}" "CXXFLAGS=${_gmp_ccflags}" ./configure ${_cross_compile_arg} --prefix=${DESTDIR}/usr/local --enable-shared=no --enable-static=yes --with-gmp=${DESTDIR}/usr/local ${_gmp_build_tgt}
|
||||
BUILD_COMMAND make -j
|
||||
INSTALL_COMMAND make install
|
||||
DEPENDS dep_GMP
|
||||
)
|
||||
endif ()
|
||||
175
deps/MPFR/mpfr/include/mpf2mpfr.h
vendored
Normal file
175
deps/MPFR/mpfr/include/mpf2mpfr.h
vendored
Normal file
@@ -0,0 +1,175 @@
|
||||
/* mpf2mpfr.h -- Compatibility include file with mpf.
|
||||
|
||||
Copyright 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
|
||||
Contributed by the Arenaire and Cacao projects, INRIA.
|
||||
|
||||
This file is part of the GNU MPFR Library.
|
||||
|
||||
The GNU MPFR Library is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
The GNU MPFR Library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
||||
License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
|
||||
http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
|
||||
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifndef __MPFR_FROM_MPF__
|
||||
#define __MPFR_FROM_MPF__
|
||||
|
||||
/* types */
|
||||
#define mpf_t mpfr_t
|
||||
#define mpf_srcptr mpfr_srcptr
|
||||
#define mpf_ptr mpfr_ptr
|
||||
|
||||
/* Get current Rounding Mode */
|
||||
#ifndef MPFR_DEFAULT_RND
|
||||
# define MPFR_DEFAULT_RND mpfr_get_default_rounding_mode ()
|
||||
#endif
|
||||
|
||||
/* mpf_init initalizes at 0 */
|
||||
#undef mpf_init
|
||||
#define mpf_init(x) mpfr_init_set_ui ((x), 0, MPFR_DEFAULT_RND)
|
||||
#undef mpf_init2
|
||||
#define mpf_init2(x,p) (mpfr_init2((x),(p)), mpfr_set_ui ((x), 0, MPFR_DEFAULT_RND))
|
||||
|
||||
/* functions which don't take as argument the rounding mode */
|
||||
#undef mpf_ceil
|
||||
#define mpf_ceil mpfr_ceil
|
||||
#undef mpf_clear
|
||||
#define mpf_clear mpfr_clear
|
||||
#undef mpf_cmp
|
||||
#define mpf_cmp mpfr_cmp
|
||||
#undef mpf_cmp_si
|
||||
#define mpf_cmp_si mpfr_cmp_si
|
||||
#undef mpf_cmp_ui
|
||||
#define mpf_cmp_ui mpfr_cmp_ui
|
||||
#undef mpf_cmp_d
|
||||
#define mpf_cmp_d mpfr_cmp_d
|
||||
#undef mpf_eq
|
||||
#define mpf_eq mpfr_eq
|
||||
#undef mpf_floor
|
||||
#define mpf_floor mpfr_floor
|
||||
#undef mpf_get_prec
|
||||
#define mpf_get_prec mpfr_get_prec
|
||||
#undef mpf_integer_p
|
||||
#define mpf_integer_p mpfr_integer_p
|
||||
#undef mpf_random2
|
||||
#define mpf_random2 mpfr_random2
|
||||
#undef mpf_set_default_prec
|
||||
#define mpf_set_default_prec mpfr_set_default_prec
|
||||
#undef mpf_get_default_prec
|
||||
#define mpf_get_default_prec mpfr_get_default_prec
|
||||
#undef mpf_set_prec
|
||||
#define mpf_set_prec mpfr_set_prec
|
||||
#undef mpf_set_prec_raw
|
||||
#define mpf_set_prec_raw(x,p) mpfr_prec_round(x,p,MPFR_DEFAULT_RND)
|
||||
#undef mpf_trunc
|
||||
#define mpf_trunc mpfr_trunc
|
||||
#undef mpf_sgn
|
||||
#define mpf_sgn mpfr_sgn
|
||||
#undef mpf_swap
|
||||
#define mpf_swap mpfr_swap
|
||||
#undef mpf_dump
|
||||
#define mpf_dump mpfr_dump
|
||||
|
||||
/* functions which take as argument the rounding mode */
|
||||
#undef mpf_abs
|
||||
#define mpf_abs(x,y) mpfr_abs(x,y,MPFR_DEFAULT_RND)
|
||||
#undef mpf_add
|
||||
#define mpf_add(x,y,z) mpfr_add(x,y,z,MPFR_DEFAULT_RND)
|
||||
#undef mpf_add_ui
|
||||
#define mpf_add_ui(x,y,z) mpfr_add_ui(x,y,z,MPFR_DEFAULT_RND)
|
||||
#undef mpf_div
|
||||
#define mpf_div(x,y,z) mpfr_div(x,y,z,MPFR_DEFAULT_RND)
|
||||
#undef mpf_div_ui
|
||||
#define mpf_div_ui(x,y,z) mpfr_div_ui(x,y,z,MPFR_DEFAULT_RND)
|
||||
#undef mpf_div_2exp
|
||||
#define mpf_div_2exp(x,y,z) mpfr_div_2exp(x,y,z,MPFR_DEFAULT_RND)
|
||||
#undef mpf_fits_slong_p
|
||||
#define mpf_fits_slong_p(x) mpfr_fits_ulong_p(x,MPFR_DEFAULT_RND)
|
||||
#undef mpf_fits_ulong_p
|
||||
#define mpf_fits_ulong_p(x) mpfr_fits_ulong_p(x,MPFR_DEFAULT_RND)
|
||||
#undef mpf_fits_sint_p
|
||||
#define mpf_fits_sint_p(x) mpfr_fits_uint_p(x,MPFR_DEFAULT_RND)
|
||||
#undef mpf_fits_uint_p
|
||||
#define mpf_fits_uint_p(x) mpfr_fits_uint_p(x,MPFR_DEFAULT_RND)
|
||||
#undef mpf_fits_sshort_p
|
||||
#define mpf_fits_sshort_p(x) mpfr_fits_ushort_p(x,MPFR_DEFAULT_RND)
|
||||
#undef mpf_fits_ushort_p
|
||||
#define mpf_fits_ushort_p(x) mpfr_fits_ushort_p(x,MPFR_DEFAULT_RND)
|
||||
#undef mpf_get_str
|
||||
#define mpf_get_str(x,y,z,t,u) mpfr_get_str(x,y,z,t,u,MPFR_DEFAULT_RND)
|
||||
#undef mpf_get_d
|
||||
#define mpf_get_d(x) mpfr_get_d(x,MPFR_DEFAULT_RND)
|
||||
#undef mpf_get_d_2exp
|
||||
#define mpf_get_d_2exp(e,x) mpfr_get_d_2exp(e,x,MPFR_DEFAULT_RND)
|
||||
#undef mpf_get_ui
|
||||
#define mpf_get_ui(x) mpfr_get_ui(x,MPFR_DEFAULT_RND)
|
||||
#undef mpf_get_si
|
||||
#define mpf_get_si(x) mpfr_get_ui(x,MPFR_DEFAULT_RND)
|
||||
#undef mpf_inp_str
|
||||
#define mpf_inp_str(x,y,z) mpfr_inp_str(x,y,z,MPFR_DEFAULT_RND)
|
||||
#undef mpf_set_str
|
||||
#define mpf_set_str(x,y,z) mpfr_set_str(x,y,z,MPFR_DEFAULT_RND)
|
||||
#undef mpf_init_set
|
||||
#define mpf_init_set(x,y) mpfr_init_set(x,y,MPFR_DEFAULT_RND)
|
||||
#undef mpf_init_set_d
|
||||
#define mpf_init_set_d(x,y) mpfr_init_set_d(x,y,MPFR_DEFAULT_RND)
|
||||
#undef mpf_init_set_si
|
||||
#define mpf_init_set_si(x,y) mpfr_init_set_si(x,y,MPFR_DEFAULT_RND)
|
||||
#undef mpf_init_set_str
|
||||
#define mpf_init_set_str(x,y,z) mpfr_init_set_str(x,y,z,MPFR_DEFAULT_RND)
|
||||
#undef mpf_init_set_ui
|
||||
#define mpf_init_set_ui(x,y) mpfr_init_set_ui(x,y,MPFR_DEFAULT_RND)
|
||||
#undef mpf_mul
|
||||
#define mpf_mul(x,y,z) mpfr_mul(x,y,z,MPFR_DEFAULT_RND)
|
||||
#undef mpf_mul_2exp
|
||||
#define mpf_mul_2exp(x,y,z) mpfr_mul_2exp(x,y,z,MPFR_DEFAULT_RND)
|
||||
#undef mpf_mul_ui
|
||||
#define mpf_mul_ui(x,y,z) mpfr_mul_ui(x,y,z,MPFR_DEFAULT_RND)
|
||||
#undef mpf_neg
|
||||
#define mpf_neg(x,y) mpfr_neg(x,y,MPFR_DEFAULT_RND)
|
||||
#undef mpf_out_str
|
||||
#define mpf_out_str(x,y,z,t) mpfr_out_str(x,y,z,t,MPFR_DEFAULT_RND)
|
||||
#undef mpf_pow_ui
|
||||
#define mpf_pow_ui(x,y,z) mpfr_pow_ui(x,y,z,MPFR_DEFAULT_RND)
|
||||
#undef mpf_reldiff
|
||||
#define mpf_reldiff(x,y,z) mpfr_reldiff(x,y,z,MPFR_DEFAULT_RND)
|
||||
#undef mpf_set
|
||||
#define mpf_set(x,y) mpfr_set(x,y,MPFR_DEFAULT_RND)
|
||||
#undef mpf_set_d
|
||||
#define mpf_set_d(x,y) mpfr_set_d(x,y,MPFR_DEFAULT_RND)
|
||||
#undef mpf_set_q
|
||||
#define mpf_set_q(x,y) mpfr_set_q(x,y,MPFR_DEFAULT_RND)
|
||||
#undef mpf_set_si
|
||||
#define mpf_set_si(x,y) mpfr_set_si(x,y,MPFR_DEFAULT_RND)
|
||||
#undef mpf_set_ui
|
||||
#define mpf_set_ui(x,y) mpfr_set_ui(x,y,MPFR_DEFAULT_RND)
|
||||
#undef mpf_set_z
|
||||
#define mpf_set_z(x,y) mpfr_set_z(x,y,MPFR_DEFAULT_RND)
|
||||
#undef mpf_sqrt
|
||||
#define mpf_sqrt(x,y) mpfr_sqrt(x,y,MPFR_DEFAULT_RND)
|
||||
#undef mpf_sqrt_ui
|
||||
#define mpf_sqrt_ui(x,y) mpfr_sqrt_ui(x,y,MPFR_DEFAULT_RND)
|
||||
#undef mpf_sub
|
||||
#define mpf_sub(x,y,z) mpfr_sub(x,y,z,MPFR_DEFAULT_RND)
|
||||
#undef mpf_sub_ui
|
||||
#define mpf_sub_ui(x,y,z) mpfr_sub_ui(x,y,z,MPFR_DEFAULT_RND)
|
||||
#undef mpf_ui_div
|
||||
#define mpf_ui_div(x,y,z) mpfr_ui_div(x,y,z,MPFR_DEFAULT_RND)
|
||||
#undef mpf_ui_sub
|
||||
#define mpf_ui_sub(x,y,z) mpfr_ui_sub(x,y,z,MPFR_DEFAULT_RND)
|
||||
#undef mpf_urandomb
|
||||
#define mpf_urandomb(x,y,n) mpfr_urandomb(x,y)
|
||||
|
||||
#undef mpz_set_f
|
||||
#define mpz_set_f(z,f) mpfr_get_z(z,f,MPFR_DEFAULT_RND)
|
||||
|
||||
#endif /* __MPFR_FROM_MPF__ */
|
||||
910
deps/MPFR/mpfr/include/mpfr.h
vendored
Normal file
910
deps/MPFR/mpfr/include/mpfr.h
vendored
Normal file
@@ -0,0 +1,910 @@
|
||||
/* mpfr.h -- Include file for mpfr.
|
||||
|
||||
Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
|
||||
Contributed by the Arenaire and Cacao projects, INRIA.
|
||||
|
||||
This file is part of the GNU MPFR Library.
|
||||
|
||||
The GNU MPFR Library is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
The GNU MPFR Library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
||||
License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
|
||||
http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
|
||||
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifndef __MPFR_H
|
||||
#define __MPFR_H
|
||||
|
||||
/* Define MPFR version number */
|
||||
#define MPFR_VERSION_MAJOR 3
|
||||
#define MPFR_VERSION_MINOR 0
|
||||
#define MPFR_VERSION_PATCHLEVEL 0
|
||||
#define MPFR_VERSION_STRING "3.0.0"
|
||||
|
||||
/* Macros dealing with MPFR VERSION */
|
||||
#define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
|
||||
#define MPFR_VERSION \
|
||||
MPFR_VERSION_NUM(MPFR_VERSION_MAJOR,MPFR_VERSION_MINOR,MPFR_VERSION_PATCHLEVEL)
|
||||
|
||||
/* Check if GMP is included, and try to include it (Works with local GMP) */
|
||||
#ifndef __GMP_H__
|
||||
# include <gmp.h>
|
||||
#endif
|
||||
|
||||
/* Check if stdio.h is included or if the user wants FILE */
|
||||
#if defined (_GMP_H_HAVE_FILE) || defined (MPFR_USE_FILE)
|
||||
# define _MPFR_H_HAVE_FILE 1
|
||||
#endif
|
||||
|
||||
#if defined (_GMP_H_HAVE_VA_LIST)
|
||||
# define _MPFR_H_HAVE_VA_LIST 1
|
||||
#endif
|
||||
|
||||
/* Check if <stdint.h> / <inttypes.h> is included or if the user
|
||||
explicitly wants intmax_t. Automatical detection is done by
|
||||
checking:
|
||||
- INTMAX_C and UINTMAX_C, but not if the compiler is a C++ one
|
||||
(as suggested by Patrick Pelissier) because the test does not
|
||||
work well in this case. See:
|
||||
http://websympa.loria.fr/wwsympa/arc/mpfr/2010-02/msg00025.html
|
||||
We do not check INTMAX_MAX and UINTMAX_MAX because under Solaris,
|
||||
these macros are always defined by <limits.h> (i.e. even when
|
||||
<stdint.h> and <inttypes.h> are not included).
|
||||
- _STDINT_H (defined by the glibc) and _STDINT_H_ (defined under
|
||||
Mac OS X), but this test may not work with all implementations.
|
||||
Portable software should not rely on these tests.
|
||||
*/
|
||||
#if (defined (INTMAX_C) && defined (UINTMAX_C) && !defined(__cplusplus)) || \
|
||||
defined (MPFR_USE_INTMAX_T) || defined (_STDINT_H) || defined (_STDINT_H_)
|
||||
# define _MPFR_H_HAVE_INTMAX_T 1
|
||||
#endif
|
||||
|
||||
/* Definition of rounding modes (DON'T USE MPFR_RNDNA!).
|
||||
Warning! Changing the contents of this enum should be seen as an
|
||||
interface change since the old and the new types are not compatible
|
||||
(the integer type compatible with the enumerated type can even change,
|
||||
see ISO C99, 6.7.2.2#4), and in Makefile.am, AGE should be set to 0.
|
||||
|
||||
MPFR_RNDU must appear just before MPFR_RNDD (see
|
||||
MPFR_IS_RNDUTEST_OR_RNDDNOTTEST in mpfr-impl.h).
|
||||
|
||||
MPFR_RNDF has been added, though not implemented yet, in order to avoid
|
||||
to break the ABI once faithful rounding gets implemented.
|
||||
|
||||
If you change the order of the rounding modes, please update the routines
|
||||
in texceptions.c which assume 0=RNDN, 1=RNDZ, 2=RNDU, 3=RNDD, 4=RNDA.
|
||||
*/
|
||||
typedef enum {
|
||||
MPFR_RNDN=0, /* round to nearest, with ties to even */
|
||||
MPFR_RNDZ, /* round toward zero */
|
||||
MPFR_RNDU, /* round toward +Inf */
|
||||
MPFR_RNDD, /* round toward -Inf */
|
||||
MPFR_RNDA, /* round away from zero */
|
||||
MPFR_RNDF, /* faithful rounding (not implemented yet) */
|
||||
MPFR_RNDNA=-1 /* round to nearest, with ties away from zero (mpfr_round) */
|
||||
} mpfr_rnd_t;
|
||||
|
||||
/* kept for compatibility with MPFR 2.4.x and before */
|
||||
#define GMP_RNDN MPFR_RNDN
|
||||
#define GMP_RNDZ MPFR_RNDZ
|
||||
#define GMP_RNDU MPFR_RNDU
|
||||
#define GMP_RNDD MPFR_RNDD
|
||||
|
||||
/* Define precision : 1 (short), 2 (int) or 3 (long) (DON'T USE IT!)*/
|
||||
#ifndef _MPFR_PREC_FORMAT
|
||||
# if __GMP_MP_SIZE_T_INT == 1
|
||||
# define _MPFR_PREC_FORMAT 2
|
||||
# else
|
||||
# define _MPFR_PREC_FORMAT 3
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Let's make mpfr_prec_t signed in order to avoid problems due to the
|
||||
usual arithmetic conversions when mixing mpfr_prec_t and mpfr_exp_t
|
||||
in an expression (for error analysis) if casts are forgotten. */
|
||||
#if _MPFR_PREC_FORMAT == 1
|
||||
typedef short mpfr_prec_t;
|
||||
typedef unsigned short mpfr_uprec_t;
|
||||
#elif _MPFR_PREC_FORMAT == 2
|
||||
typedef int mpfr_prec_t;
|
||||
typedef unsigned int mpfr_uprec_t;
|
||||
#elif _MPFR_PREC_FORMAT == 3
|
||||
typedef long mpfr_prec_t;
|
||||
typedef unsigned long mpfr_uprec_t;
|
||||
#else
|
||||
# error "Invalid MPFR Prec format"
|
||||
#endif
|
||||
|
||||
/* Definition of precision limits without needing <limits.h> */
|
||||
/* Note: the casts allows the expression to yield the wanted behavior
|
||||
for _MPFR_PREC_FORMAT == 1 (due to integer promotion rules). */
|
||||
#define MPFR_PREC_MIN 2
|
||||
#define MPFR_PREC_MAX ((mpfr_prec_t)((mpfr_uprec_t)(~(mpfr_uprec_t)0)>>1))
|
||||
|
||||
/* Definition of sign */
|
||||
typedef int mpfr_sign_t;
|
||||
|
||||
/* Definition of the exponent: same as in GMP. */
|
||||
typedef mp_exp_t mpfr_exp_t;
|
||||
|
||||
/* Definition of the standard exponent limits */
|
||||
#define MPFR_EMAX_DEFAULT ((mpfr_exp_t) (((unsigned long) 1 << 30) - 1))
|
||||
#define MPFR_EMIN_DEFAULT (-(MPFR_EMAX_DEFAULT))
|
||||
|
||||
/* Definition of the main structure */
|
||||
typedef struct {
|
||||
mpfr_prec_t _mpfr_prec;
|
||||
mpfr_sign_t _mpfr_sign;
|
||||
mpfr_exp_t _mpfr_exp;
|
||||
mp_limb_t *_mpfr_d;
|
||||
} __mpfr_struct;
|
||||
|
||||
/* Compatibility with previous types of MPFR */
|
||||
#ifndef mp_rnd_t
|
||||
# define mp_rnd_t mpfr_rnd_t
|
||||
#endif
|
||||
#ifndef mp_prec_t
|
||||
# define mp_prec_t mpfr_prec_t
|
||||
#endif
|
||||
|
||||
/*
|
||||
The represented number is
|
||||
_sign*(_d[k-1]/B+_d[k-2]/B^2+...+_d[0]/B^k)*2^_exp
|
||||
where k=ceil(_mp_prec/GMP_NUMB_BITS) and B=2^GMP_NUMB_BITS.
|
||||
|
||||
For the msb (most significant bit) normalized representation, we must have
|
||||
_d[k-1]>=B/2, unless the number is singular.
|
||||
|
||||
We must also have the last k*GMP_NUMB_BITS-_prec bits set to zero.
|
||||
*/
|
||||
|
||||
typedef __mpfr_struct mpfr_t[1];
|
||||
typedef __mpfr_struct *mpfr_ptr;
|
||||
typedef __gmp_const __mpfr_struct *mpfr_srcptr;
|
||||
|
||||
/* For those who need a direct and fast access to the sign field.
|
||||
However it is not in the API, thus use it at your own risk: it might
|
||||
not be supported, or change name, in further versions!
|
||||
Unfortunately, it must be defined here (instead of MPFR's internal
|
||||
header file mpfr-impl.h) because it is used by some macros below.
|
||||
*/
|
||||
#define MPFR_SIGN(x) ((x)->_mpfr_sign)
|
||||
|
||||
/* Stack interface */
|
||||
typedef enum {
|
||||
MPFR_NAN_KIND = 0,
|
||||
MPFR_INF_KIND = 1, MPFR_ZERO_KIND = 2, MPFR_REGULAR_KIND = 3
|
||||
} mpfr_kind_t;
|
||||
|
||||
/* GMP defines:
|
||||
+ size_t: Standard size_t
|
||||
+ __GMP_ATTRIBUTE_PURE Attribute for math functions.
|
||||
+ __GMP_NOTHROW For C++: can't throw .
|
||||
+ __GMP_EXTERN_INLINE Attribute for inline function.
|
||||
* __gmp_const const (Supports for K&R compiler only for mpfr.h).
|
||||
+ __GMP_DECLSPEC_EXPORT compiling to go into a DLL
|
||||
+ __GMP_DECLSPEC_IMPORT compiling to go into a application
|
||||
*/
|
||||
/* Extra MPFR defines */
|
||||
#define __MPFR_SENTINEL_ATTR
|
||||
#if defined (__GNUC__)
|
||||
# if __GNUC__ >= 4
|
||||
# undef __MPFR_SENTINEL_ATTR
|
||||
# define __MPFR_SENTINEL_ATTR __attribute__ ((sentinel))
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Prototypes: Support of K&R compiler */
|
||||
#if defined (__GMP_PROTO)
|
||||
# define _MPFR_PROTO __GMP_PROTO
|
||||
#elif defined (__STDC__) || defined (__cplusplus)
|
||||
# define _MPFR_PROTO(x) x
|
||||
#else
|
||||
# define _MPFR_PROTO(x) ()
|
||||
#endif
|
||||
/* Support for WINDOWS Dll:
|
||||
Check if we are inside a MPFR build, and if so export the functions.
|
||||
Otherwise does the same thing as GMP */
|
||||
#if defined(__MPFR_WITHIN_MPFR) && __GMP_LIBGMP_DLL
|
||||
# define __MPFR_DECLSPEC __GMP_DECLSPEC_EXPORT
|
||||
#else
|
||||
# define __MPFR_DECLSPEC __GMP_DECLSPEC
|
||||
#endif
|
||||
|
||||
/* Note: In order to be declared, some functions need a specific
|
||||
system header to be included *before* "mpfr.h". If the user
|
||||
forgets to include the header, the MPFR function prototype in
|
||||
the user object file is not correct. To avoid wrong results,
|
||||
we raise a linker error in that case by changing their internal
|
||||
name in the library (prefixed by __gmpfr instead of mpfr). See
|
||||
the lines of the form "#define mpfr_xxx __gmpfr_xxx" below. */
|
||||
|
||||
#if defined (__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
__MPFR_DECLSPEC __gmp_const char * mpfr_get_version _MPFR_PROTO ((void));
|
||||
__MPFR_DECLSPEC __gmp_const char * mpfr_get_patches _MPFR_PROTO ((void));
|
||||
__MPFR_DECLSPEC int mpfr_buildopt_tls_p _MPFR_PROTO ((void));
|
||||
__MPFR_DECLSPEC int mpfr_buildopt_decimal_p _MPFR_PROTO ((void));
|
||||
|
||||
__MPFR_DECLSPEC mpfr_exp_t mpfr_get_emin _MPFR_PROTO ((void));
|
||||
__MPFR_DECLSPEC int mpfr_set_emin _MPFR_PROTO ((mpfr_exp_t));
|
||||
__MPFR_DECLSPEC mpfr_exp_t mpfr_get_emin_min _MPFR_PROTO ((void));
|
||||
__MPFR_DECLSPEC mpfr_exp_t mpfr_get_emin_max _MPFR_PROTO ((void));
|
||||
__MPFR_DECLSPEC mpfr_exp_t mpfr_get_emax _MPFR_PROTO ((void));
|
||||
__MPFR_DECLSPEC int mpfr_set_emax _MPFR_PROTO ((mpfr_exp_t));
|
||||
__MPFR_DECLSPEC mpfr_exp_t mpfr_get_emax_min _MPFR_PROTO ((void));
|
||||
__MPFR_DECLSPEC mpfr_exp_t mpfr_get_emax_max _MPFR_PROTO ((void));
|
||||
|
||||
__MPFR_DECLSPEC void mpfr_set_default_rounding_mode _MPFR_PROTO((mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC mpfr_rnd_t mpfr_get_default_rounding_mode _MPFR_PROTO((void));
|
||||
__MPFR_DECLSPEC __gmp_const char *
|
||||
mpfr_print_rnd_mode _MPFR_PROTO((mpfr_rnd_t));
|
||||
|
||||
__MPFR_DECLSPEC void mpfr_clear_flags _MPFR_PROTO ((void));
|
||||
__MPFR_DECLSPEC void mpfr_clear_underflow _MPFR_PROTO ((void));
|
||||
__MPFR_DECLSPEC void mpfr_clear_overflow _MPFR_PROTO ((void));
|
||||
__MPFR_DECLSPEC void mpfr_clear_nanflag _MPFR_PROTO ((void));
|
||||
__MPFR_DECLSPEC void mpfr_clear_inexflag _MPFR_PROTO ((void));
|
||||
__MPFR_DECLSPEC void mpfr_clear_erangeflag _MPFR_PROTO ((void));
|
||||
|
||||
__MPFR_DECLSPEC void mpfr_set_underflow _MPFR_PROTO ((void));
|
||||
__MPFR_DECLSPEC void mpfr_set_overflow _MPFR_PROTO ((void));
|
||||
__MPFR_DECLSPEC void mpfr_set_nanflag _MPFR_PROTO ((void));
|
||||
__MPFR_DECLSPEC void mpfr_set_inexflag _MPFR_PROTO ((void));
|
||||
__MPFR_DECLSPEC void mpfr_set_erangeflag _MPFR_PROTO ((void));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_underflow_p _MPFR_PROTO ((void));
|
||||
__MPFR_DECLSPEC int mpfr_overflow_p _MPFR_PROTO ((void));
|
||||
__MPFR_DECLSPEC int mpfr_nanflag_p _MPFR_PROTO ((void));
|
||||
__MPFR_DECLSPEC int mpfr_inexflag_p _MPFR_PROTO ((void));
|
||||
__MPFR_DECLSPEC int mpfr_erangeflag_p _MPFR_PROTO ((void));
|
||||
|
||||
__MPFR_DECLSPEC int
|
||||
mpfr_check_range _MPFR_PROTO ((mpfr_ptr, int, mpfr_rnd_t));
|
||||
|
||||
__MPFR_DECLSPEC void mpfr_init2 _MPFR_PROTO ((mpfr_ptr, mpfr_prec_t));
|
||||
__MPFR_DECLSPEC void mpfr_init _MPFR_PROTO ((mpfr_ptr));
|
||||
__MPFR_DECLSPEC void mpfr_clear _MPFR_PROTO ((mpfr_ptr));
|
||||
|
||||
__MPFR_DECLSPEC void
|
||||
mpfr_inits2 _MPFR_PROTO ((mpfr_prec_t, mpfr_ptr, ...)) __MPFR_SENTINEL_ATTR;
|
||||
__MPFR_DECLSPEC void
|
||||
mpfr_inits _MPFR_PROTO ((mpfr_ptr, ...)) __MPFR_SENTINEL_ATTR;
|
||||
__MPFR_DECLSPEC void
|
||||
mpfr_clears _MPFR_PROTO ((mpfr_ptr, ...)) __MPFR_SENTINEL_ATTR;
|
||||
|
||||
__MPFR_DECLSPEC int
|
||||
mpfr_prec_round _MPFR_PROTO ((mpfr_ptr, mpfr_prec_t, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int
|
||||
mpfr_can_round _MPFR_PROTO ((mpfr_srcptr, mpfr_exp_t, mpfr_rnd_t, mpfr_rnd_t,
|
||||
mpfr_prec_t));
|
||||
__MPFR_DECLSPEC mpfr_prec_t mpfr_min_prec _MPFR_PROTO ((mpfr_srcptr));
|
||||
|
||||
__MPFR_DECLSPEC mpfr_exp_t mpfr_get_exp _MPFR_PROTO ((mpfr_srcptr));
|
||||
__MPFR_DECLSPEC int mpfr_set_exp _MPFR_PROTO ((mpfr_ptr, mpfr_exp_t));
|
||||
__MPFR_DECLSPEC mpfr_prec_t mpfr_get_prec _MPFR_PROTO((mpfr_srcptr));
|
||||
__MPFR_DECLSPEC void mpfr_set_prec _MPFR_PROTO((mpfr_ptr, mpfr_prec_t));
|
||||
__MPFR_DECLSPEC void mpfr_set_prec_raw _MPFR_PROTO((mpfr_ptr, mpfr_prec_t));
|
||||
__MPFR_DECLSPEC void mpfr_set_default_prec _MPFR_PROTO((mpfr_prec_t));
|
||||
__MPFR_DECLSPEC mpfr_prec_t mpfr_get_default_prec _MPFR_PROTO((void));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_set_d _MPFR_PROTO ((mpfr_ptr, double, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_set_flt _MPFR_PROTO ((mpfr_ptr, float, mpfr_rnd_t));
|
||||
#ifdef MPFR_WANT_DECIMAL_FLOATS
|
||||
__MPFR_DECLSPEC int mpfr_set_decimal64 _MPFR_PROTO ((mpfr_ptr, _Decimal64,
|
||||
mpfr_rnd_t));
|
||||
#endif
|
||||
__MPFR_DECLSPEC int
|
||||
mpfr_set_ld _MPFR_PROTO ((mpfr_ptr, long double, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int
|
||||
mpfr_set_z _MPFR_PROTO ((mpfr_ptr, mpz_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int
|
||||
mpfr_set_z_2exp _MPFR_PROTO ((mpfr_ptr, mpz_srcptr, mpfr_exp_t, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC void mpfr_set_nan _MPFR_PROTO ((mpfr_ptr));
|
||||
__MPFR_DECLSPEC void mpfr_set_inf _MPFR_PROTO ((mpfr_ptr, int));
|
||||
__MPFR_DECLSPEC void mpfr_set_zero _MPFR_PROTO ((mpfr_ptr, int));
|
||||
__MPFR_DECLSPEC int
|
||||
mpfr_set_f _MPFR_PROTO ((mpfr_ptr, mpf_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int
|
||||
mpfr_get_f _MPFR_PROTO ((mpf_ptr, mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_set_si _MPFR_PROTO ((mpfr_ptr, long, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int
|
||||
mpfr_set_ui _MPFR_PROTO ((mpfr_ptr, unsigned long, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int
|
||||
mpfr_set_si_2exp _MPFR_PROTO ((mpfr_ptr, long, mpfr_exp_t, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int
|
||||
mpfr_set_ui_2exp _MPFR_PROTO ((mpfr_ptr,unsigned long,mpfr_exp_t,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int
|
||||
mpfr_set_q _MPFR_PROTO ((mpfr_ptr, mpq_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int
|
||||
mpfr_set_str _MPFR_PROTO ((mpfr_ptr, __gmp_const char *, int, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int
|
||||
mpfr_init_set_str _MPFR_PROTO ((mpfr_ptr, __gmp_const char *, int,
|
||||
mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int
|
||||
mpfr_set4 _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_rnd_t, int));
|
||||
__MPFR_DECLSPEC int
|
||||
mpfr_abs _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int
|
||||
mpfr_set _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_neg _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_signbit _MPFR_PROTO ((mpfr_srcptr));
|
||||
__MPFR_DECLSPEC int
|
||||
mpfr_setsign _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, int, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int
|
||||
mpfr_copysign _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_srcptr, mpfr_rnd_t));
|
||||
|
||||
#ifdef _MPFR_H_HAVE_INTMAX_T
|
||||
#define mpfr_set_sj __gmpfr_set_sj
|
||||
#define mpfr_set_sj_2exp __gmpfr_set_sj_2exp
|
||||
#define mpfr_set_uj __gmpfr_set_uj
|
||||
#define mpfr_set_uj_2exp __gmpfr_set_uj_2exp
|
||||
#define mpfr_get_sj __gmpfr_mpfr_get_sj
|
||||
#define mpfr_get_uj __gmpfr_mpfr_get_uj
|
||||
__MPFR_DECLSPEC int mpfr_set_sj _MPFR_PROTO ((mpfr_t, intmax_t, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int
|
||||
mpfr_set_sj_2exp _MPFR_PROTO ((mpfr_t, intmax_t, intmax_t, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_set_uj _MPFR_PROTO ((mpfr_t, uintmax_t, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int
|
||||
mpfr_set_uj_2exp _MPFR_PROTO ((mpfr_t, uintmax_t, intmax_t, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC intmax_t mpfr_get_sj _MPFR_PROTO ((mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC uintmax_t mpfr_get_uj _MPFR_PROTO ((mpfr_srcptr, mpfr_rnd_t));
|
||||
#endif
|
||||
|
||||
__MPFR_DECLSPEC mpfr_exp_t mpfr_get_z_2exp _MPFR_PROTO ((mpz_ptr, mpfr_srcptr));
|
||||
__MPFR_DECLSPEC float mpfr_get_flt _MPFR_PROTO ((mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC double mpfr_get_d _MPFR_PROTO ((mpfr_srcptr, mpfr_rnd_t));
|
||||
#ifdef MPFR_WANT_DECIMAL_FLOATS
|
||||
__MPFR_DECLSPEC _Decimal64 mpfr_get_decimal64 _MPFR_PROTO ((mpfr_srcptr,
|
||||
mpfr_rnd_t));
|
||||
#endif
|
||||
__MPFR_DECLSPEC long double mpfr_get_ld _MPFR_PROTO ((mpfr_srcptr,
|
||||
mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC double mpfr_get_d1 _MPFR_PROTO ((mpfr_srcptr));
|
||||
__MPFR_DECLSPEC double mpfr_get_d_2exp _MPFR_PROTO ((long*, mpfr_srcptr,
|
||||
mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC long double mpfr_get_ld_2exp _MPFR_PROTO ((long*, mpfr_srcptr,
|
||||
mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC long mpfr_get_si _MPFR_PROTO ((mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC unsigned long mpfr_get_ui _MPFR_PROTO ((mpfr_srcptr,
|
||||
mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC char*mpfr_get_str _MPFR_PROTO ((char*, mpfr_exp_t*, int, size_t,
|
||||
mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_get_z _MPFR_PROTO ((mpz_ptr z, mpfr_srcptr f,
|
||||
mpfr_rnd_t));
|
||||
|
||||
__MPFR_DECLSPEC void mpfr_free_str _MPFR_PROTO ((char *));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_urandom _MPFR_PROTO ((mpfr_ptr, gmp_randstate_t,
|
||||
mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_urandomb _MPFR_PROTO ((mpfr_ptr, gmp_randstate_t));
|
||||
|
||||
__MPFR_DECLSPEC void mpfr_nextabove _MPFR_PROTO ((mpfr_ptr));
|
||||
__MPFR_DECLSPEC void mpfr_nextbelow _MPFR_PROTO ((mpfr_ptr));
|
||||
__MPFR_DECLSPEC void mpfr_nexttoward _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr));
|
||||
|
||||
#ifdef _MPFR_H_HAVE_FILE
|
||||
#define mpfr_inp_str __gmpfr_inp_str
|
||||
#define mpfr_out_str __gmpfr_out_str
|
||||
__MPFR_DECLSPEC size_t mpfr_inp_str _MPFR_PROTO ((mpfr_ptr, FILE*, int,
|
||||
mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC size_t mpfr_out_str _MPFR_PROTO ((FILE*, int, size_t,
|
||||
mpfr_srcptr, mpfr_rnd_t));
|
||||
#define mpfr_fprintf __gmpfr_fprintf
|
||||
__MPFR_DECLSPEC int mpfr_fprintf _MPFR_PROTO ((FILE*, __gmp_const char*,
|
||||
...));
|
||||
#endif
|
||||
__MPFR_DECLSPEC int mpfr_printf _MPFR_PROTO ((__gmp_const char*, ...));
|
||||
__MPFR_DECLSPEC int mpfr_asprintf _MPFR_PROTO ((char**, __gmp_const char*,
|
||||
...));
|
||||
__MPFR_DECLSPEC int mpfr_sprintf _MPFR_PROTO ((char*, __gmp_const char*,
|
||||
...));
|
||||
__MPFR_DECLSPEC int mpfr_snprintf _MPFR_PROTO ((char*, size_t,
|
||||
__gmp_const char*, ...));
|
||||
|
||||
#ifdef _MPFR_H_HAVE_VA_LIST
|
||||
#ifdef _MPFR_H_HAVE_FILE
|
||||
#define mpfr_vfprintf __gmpfr_vfprintf
|
||||
__MPFR_DECLSPEC int mpfr_vfprintf _MPFR_PROTO ((FILE*, __gmp_const char*,
|
||||
va_list));
|
||||
#endif /* _MPFR_H_HAVE_FILE */
|
||||
#define mpfr_vprintf __gmpfr_vprintf
|
||||
#define mpfr_vasprintf __gmpfr_vasprintf
|
||||
#define mpfr_vsprintf __gmpfr_vsprintf
|
||||
#define mpfr_vsnprintf __gmpfr_vsnprintf
|
||||
__MPFR_DECLSPEC int mpfr_vprintf _MPFR_PROTO ((__gmp_const char*, va_list));
|
||||
__MPFR_DECLSPEC int mpfr_vasprintf _MPFR_PROTO ((char**, __gmp_const char*,
|
||||
va_list));
|
||||
__MPFR_DECLSPEC int mpfr_vsprintf _MPFR_PROTO ((char*, __gmp_const char*,
|
||||
va_list));
|
||||
__MPFR_DECLSPEC int mpfr_vsnprintf _MPFR_PROTO ((char*, size_t,
|
||||
__gmp_const char*, va_list));
|
||||
#endif /* _MPFR_H_HAVE_VA_LIST */
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_pow _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_pow_si _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
long int, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_pow_ui _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
unsigned long int, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_ui_pow_ui _MPFR_PROTO ((mpfr_ptr, unsigned long int,
|
||||
unsigned long int, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_ui_pow _MPFR_PROTO ((mpfr_ptr, unsigned long int,
|
||||
mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_pow_z _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpz_srcptr, mpfr_rnd_t));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_sqrt _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_sqrt_ui _MPFR_PROTO ((mpfr_ptr, unsigned long,
|
||||
mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_rec_sqrt _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpfr_rnd_t));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_add _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_sub _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_mul _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_div _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpfr_srcptr, mpfr_rnd_t));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_add_ui _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
unsigned long, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_sub_ui _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
unsigned long, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_ui_sub _MPFR_PROTO ((mpfr_ptr, unsigned long,
|
||||
mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_mul_ui _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
unsigned long, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_div_ui _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
unsigned long, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_ui_div _MPFR_PROTO ((mpfr_ptr, unsigned long,
|
||||
mpfr_srcptr, mpfr_rnd_t));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_add_si _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
long int, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_sub_si _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
long int, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_si_sub _MPFR_PROTO ((mpfr_ptr, long int,
|
||||
mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_mul_si _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
long int, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_div_si _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
long int, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_si_div _MPFR_PROTO ((mpfr_ptr, long int,
|
||||
mpfr_srcptr, mpfr_rnd_t));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_add_d _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
double, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_sub_d _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
double, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_d_sub _MPFR_PROTO ((mpfr_ptr, double,
|
||||
mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_mul_d _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
double, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_div_d _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
double, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_d_div _MPFR_PROTO ((mpfr_ptr, double,
|
||||
mpfr_srcptr, mpfr_rnd_t));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_sqr _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_const_pi _MPFR_PROTO ((mpfr_ptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_const_log2 _MPFR_PROTO ((mpfr_ptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_const_euler _MPFR_PROTO ((mpfr_ptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_const_catalan _MPFR_PROTO ((mpfr_ptr, mpfr_rnd_t));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_agm _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_srcptr,
|
||||
mpfr_rnd_t));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_log _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_log2 _MPFR_PROTO ((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_log10 _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_log1p _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpfr_rnd_t));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_exp _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_exp2 _MPFR_PROTO ((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_exp10 _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_expm1 _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_eint _MPFR_PROTO ((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_li2 _MPFR_PROTO ((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_cmp _MPFR_PROTO ((mpfr_srcptr, mpfr_srcptr));
|
||||
__MPFR_DECLSPEC int mpfr_cmp3 _MPFR_PROTO ((mpfr_srcptr, mpfr_srcptr, int));
|
||||
__MPFR_DECLSPEC int mpfr_cmp_d _MPFR_PROTO ((mpfr_srcptr, double));
|
||||
__MPFR_DECLSPEC int mpfr_cmp_ld _MPFR_PROTO ((mpfr_srcptr, long double));
|
||||
__MPFR_DECLSPEC int mpfr_cmpabs _MPFR_PROTO ((mpfr_srcptr, mpfr_srcptr));
|
||||
__MPFR_DECLSPEC int mpfr_cmp_ui _MPFR_PROTO ((mpfr_srcptr, unsigned long));
|
||||
__MPFR_DECLSPEC int mpfr_cmp_si _MPFR_PROTO ((mpfr_srcptr, long));
|
||||
__MPFR_DECLSPEC int mpfr_cmp_ui_2exp _MPFR_PROTO ((mpfr_srcptr, unsigned long,
|
||||
mpfr_exp_t));
|
||||
__MPFR_DECLSPEC int mpfr_cmp_si_2exp _MPFR_PROTO ((mpfr_srcptr, long,
|
||||
mpfr_exp_t));
|
||||
__MPFR_DECLSPEC void mpfr_reldiff _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_eq _MPFR_PROTO((mpfr_srcptr, mpfr_srcptr,
|
||||
unsigned long));
|
||||
__MPFR_DECLSPEC int mpfr_sgn _MPFR_PROTO ((mpfr_srcptr));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_mul_2exp _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
unsigned long, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_div_2exp _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
unsigned long, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_mul_2ui _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
unsigned long, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_div_2ui _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
unsigned long, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_mul_2si _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
long, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_div_2si _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
long, mpfr_rnd_t));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_rint _MPFR_PROTO((mpfr_ptr,mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_round _MPFR_PROTO((mpfr_ptr, mpfr_srcptr));
|
||||
__MPFR_DECLSPEC int mpfr_trunc _MPFR_PROTO((mpfr_ptr, mpfr_srcptr));
|
||||
__MPFR_DECLSPEC int mpfr_ceil _MPFR_PROTO((mpfr_ptr, mpfr_srcptr));
|
||||
__MPFR_DECLSPEC int mpfr_floor _MPFR_PROTO((mpfr_ptr, mpfr_srcptr));
|
||||
__MPFR_DECLSPEC int mpfr_rint_round _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_rint_trunc _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_rint_ceil _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_rint_floor _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_frac _MPFR_PROTO ((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_modf _MPFR_PROTO ((mpfr_ptr, mpfr_ptr, mpfr_srcptr,
|
||||
mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_remquo _MPFR_PROTO ((mpfr_ptr, long*, mpfr_srcptr,
|
||||
mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_remainder _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_fmod _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpfr_srcptr, mpfr_rnd_t));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_fits_ulong_p _MPFR_PROTO((mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_fits_slong_p _MPFR_PROTO((mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_fits_uint_p _MPFR_PROTO((mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_fits_sint_p _MPFR_PROTO((mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_fits_ushort_p _MPFR_PROTO((mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_fits_sshort_p _MPFR_PROTO((mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_fits_uintmax_p _MPFR_PROTO((mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_fits_intmax_p _MPFR_PROTO((mpfr_srcptr, mpfr_rnd_t));
|
||||
|
||||
__MPFR_DECLSPEC void mpfr_extract _MPFR_PROTO ((mpz_ptr, mpfr_srcptr,
|
||||
unsigned int));
|
||||
__MPFR_DECLSPEC void mpfr_swap _MPFR_PROTO ((mpfr_ptr, mpfr_ptr));
|
||||
__MPFR_DECLSPEC void mpfr_dump _MPFR_PROTO ((mpfr_srcptr));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_nan_p _MPFR_PROTO((mpfr_srcptr));
|
||||
__MPFR_DECLSPEC int mpfr_inf_p _MPFR_PROTO((mpfr_srcptr));
|
||||
__MPFR_DECLSPEC int mpfr_number_p _MPFR_PROTO((mpfr_srcptr));
|
||||
__MPFR_DECLSPEC int mpfr_integer_p _MPFR_PROTO ((mpfr_srcptr));
|
||||
__MPFR_DECLSPEC int mpfr_zero_p _MPFR_PROTO ((mpfr_srcptr));
|
||||
__MPFR_DECLSPEC int mpfr_regular_p _MPFR_PROTO ((mpfr_srcptr));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_greater_p _MPFR_PROTO ((mpfr_srcptr, mpfr_srcptr));
|
||||
__MPFR_DECLSPEC int mpfr_greaterequal_p _MPFR_PROTO ((mpfr_srcptr,
|
||||
mpfr_srcptr));
|
||||
__MPFR_DECLSPEC int mpfr_less_p _MPFR_PROTO ((mpfr_srcptr, mpfr_srcptr));
|
||||
__MPFR_DECLSPEC int mpfr_lessequal_p _MPFR_PROTO ((mpfr_srcptr, mpfr_srcptr));
|
||||
__MPFR_DECLSPEC int mpfr_lessgreater_p _MPFR_PROTO((mpfr_srcptr,mpfr_srcptr));
|
||||
__MPFR_DECLSPEC int mpfr_equal_p _MPFR_PROTO ((mpfr_srcptr, mpfr_srcptr));
|
||||
__MPFR_DECLSPEC int mpfr_unordered_p _MPFR_PROTO ((mpfr_srcptr, mpfr_srcptr));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_atanh _MPFR_PROTO((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_acosh _MPFR_PROTO((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_asinh _MPFR_PROTO((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_cosh _MPFR_PROTO((mpfr_ptr,mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_sinh _MPFR_PROTO((mpfr_ptr,mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_tanh _MPFR_PROTO((mpfr_ptr,mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_sinh_cosh _MPFR_PROTO ((mpfr_ptr, mpfr_ptr,
|
||||
mpfr_srcptr, mpfr_rnd_t));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_sech _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_csch _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_coth _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_acos _MPFR_PROTO ((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_asin _MPFR_PROTO ((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_atan _MPFR_PROTO ((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_sin _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_sin_cos _MPFR_PROTO ((mpfr_ptr, mpfr_ptr,
|
||||
mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_cos _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_tan _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_atan2 _MPFR_PROTO ((mpfr_ptr,mpfr_srcptr,mpfr_srcptr,
|
||||
mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_sec _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_csc _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_cot _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_hypot _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_erf _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_erfc _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_cbrt _MPFR_PROTO ((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_root _MPFR_PROTO ((mpfr_ptr,mpfr_srcptr,unsigned long,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_gamma _MPFR_PROTO((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_lngamma _MPFR_PROTO((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_lgamma _MPFR_PROTO((mpfr_ptr,int*,mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_digamma _MPFR_PROTO((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_zeta _MPFR_PROTO ((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_zeta_ui _MPFR_PROTO ((mpfr_ptr,unsigned long,mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_fac_ui _MPFR_PROTO ((mpfr_ptr, unsigned long int,
|
||||
mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_j0 _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_j1 _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_jn _MPFR_PROTO ((mpfr_ptr, long, mpfr_srcptr,
|
||||
mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_y0 _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_y1 _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_yn _MPFR_PROTO ((mpfr_ptr, long, mpfr_srcptr,
|
||||
mpfr_rnd_t));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_ai _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_rnd_t));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_min _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_srcptr,
|
||||
mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_max _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_srcptr,
|
||||
mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_dim _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_srcptr,
|
||||
mpfr_rnd_t));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_mul_z _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpz_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_div_z _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpz_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_add_z _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpz_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_sub_z _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpz_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_cmp_z _MPFR_PROTO ((mpfr_srcptr, mpz_srcptr));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_mul_q _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpq_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_div_q _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpq_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_add_q _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpq_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_sub_q _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,
|
||||
mpq_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_cmp_q _MPFR_PROTO ((mpfr_srcptr, mpq_srcptr));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_cmp_f _MPFR_PROTO ((mpfr_srcptr, mpf_srcptr));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_fma _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_srcptr,
|
||||
mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_fms _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_srcptr,
|
||||
mpfr_srcptr, mpfr_rnd_t));
|
||||
__MPFR_DECLSPEC int mpfr_sum _MPFR_PROTO ((mpfr_ptr, mpfr_ptr *__gmp_const,
|
||||
unsigned long, mpfr_rnd_t));
|
||||
|
||||
__MPFR_DECLSPEC void mpfr_free_cache _MPFR_PROTO ((void));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_subnormalize _MPFR_PROTO ((mpfr_ptr, int,
|
||||
mpfr_rnd_t));
|
||||
|
||||
__MPFR_DECLSPEC int mpfr_strtofr _MPFR_PROTO ((mpfr_ptr, __gmp_const char *,
|
||||
char **, int, mpfr_rnd_t));
|
||||
|
||||
__MPFR_DECLSPEC size_t mpfr_custom_get_size _MPFR_PROTO ((mpfr_prec_t));
|
||||
__MPFR_DECLSPEC void mpfr_custom_init _MPFR_PROTO ((void *, mpfr_prec_t));
|
||||
__MPFR_DECLSPEC void * mpfr_custom_get_significand _MPFR_PROTO ((mpfr_srcptr));
|
||||
__MPFR_DECLSPEC mpfr_exp_t mpfr_custom_get_exp _MPFR_PROTO ((mpfr_srcptr));
|
||||
__MPFR_DECLSPEC void mpfr_custom_move _MPFR_PROTO ((mpfr_ptr, void *));
|
||||
__MPFR_DECLSPEC void mpfr_custom_init_set _MPFR_PROTO ((mpfr_ptr, int,
|
||||
mpfr_exp_t, mpfr_prec_t, void *));
|
||||
__MPFR_DECLSPEC int mpfr_custom_get_kind _MPFR_PROTO ((mpfr_srcptr));
|
||||
|
||||
#if defined (__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
/* DON'T USE THIS! (For MPFR-public macros only, see below.)
|
||||
The mpfr_sgn macro uses the fact that __MPFR_EXP_NAN and __MPFR_EXP_ZERO
|
||||
are the smallest values.
|
||||
FIXME: In the following macros, the cast of an unsigned type with MSB set
|
||||
to the signed type mpfr_exp_t yields an integer overflow, which can give
|
||||
unexpected results with future compilers and aggressive optimisations.
|
||||
Why not working only with signed types, using INT_MIN and LONG_MIN? */
|
||||
#if __GMP_MP_SIZE_T_INT
|
||||
#define __MPFR_EXP_NAN ((mpfr_exp_t)((~((~(unsigned int)0)>>1))+2))
|
||||
#define __MPFR_EXP_ZERO ((mpfr_exp_t)((~((~(unsigned int)0)>>1))+1))
|
||||
#define __MPFR_EXP_INF ((mpfr_exp_t)((~((~(unsigned int)0)>>1))+3))
|
||||
#else
|
||||
#define __MPFR_EXP_NAN ((mpfr_exp_t)((~((~(unsigned long)0)>>1))+2))
|
||||
#define __MPFR_EXP_ZERO ((mpfr_exp_t)((~((~(unsigned long)0)>>1))+1))
|
||||
#define __MPFR_EXP_INF ((mpfr_exp_t)((~((~(unsigned long)0)>>1))+3))
|
||||
#endif
|
||||
|
||||
/* Define MPFR_USE_EXTENSION to avoid "gcc -pedantic" warnings. */
|
||||
#ifndef MPFR_EXTENSION
|
||||
# if defined(MPFR_USE_EXTENSION)
|
||||
# define MPFR_EXTENSION __extension__
|
||||
# else
|
||||
# define MPFR_EXTENSION
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Warning! This macro doesn't work with K&R C (e.g., compare the "gcc -E"
|
||||
output with and without -traditional) and shouldn't be used internally.
|
||||
For public use only, but see the MPFR manual. */
|
||||
#define MPFR_DECL_INIT(_x, _p) \
|
||||
MPFR_EXTENSION mp_limb_t __gmpfr_local_tab_##_x[((_p)-1)/GMP_NUMB_BITS+1]; \
|
||||
MPFR_EXTENSION mpfr_t _x = {{(_p),1,__MPFR_EXP_NAN,__gmpfr_local_tab_##_x}}
|
||||
|
||||
/* Fast access macros to replace function interface.
|
||||
If the USER don't want to use the macro interface, let him make happy
|
||||
even if it produces faster and smaller code. */
|
||||
#ifndef MPFR_USE_NO_MACRO
|
||||
|
||||
/* Inlining theses functions is both faster and smaller */
|
||||
#define mpfr_nan_p(_x) ((_x)->_mpfr_exp == __MPFR_EXP_NAN)
|
||||
#define mpfr_inf_p(_x) ((_x)->_mpfr_exp == __MPFR_EXP_INF)
|
||||
#define mpfr_zero_p(_x) ((_x)->_mpfr_exp == __MPFR_EXP_ZERO)
|
||||
#define mpfr_regular_p(_x) ((_x)->_mpfr_exp > __MPFR_EXP_INF)
|
||||
#define mpfr_sgn(_x) \
|
||||
((_x)->_mpfr_exp < __MPFR_EXP_INF ? \
|
||||
(mpfr_nan_p (_x) ? mpfr_set_erangeflag () : (void) 0), 0 : \
|
||||
MPFR_SIGN (_x))
|
||||
|
||||
/* Prevent them from using as lvalues */
|
||||
#define MPFR_VALUE_OF(x) (0 ? (x) : (x))
|
||||
#define mpfr_get_prec(_x) MPFR_VALUE_OF((_x)->_mpfr_prec)
|
||||
#define mpfr_get_exp(_x) MPFR_VALUE_OF((_x)->_mpfr_exp)
|
||||
/* Note: if need be, the MPFR_VALUE_OF can be used for other expressions
|
||||
(of any type). Thanks to Wojtek Lerch and Tim Rentsch for the idea. */
|
||||
|
||||
#define mpfr_round(a,b) mpfr_rint((a), (b), MPFR_RNDNA)
|
||||
#define mpfr_trunc(a,b) mpfr_rint((a), (b), MPFR_RNDZ)
|
||||
#define mpfr_ceil(a,b) mpfr_rint((a), (b), MPFR_RNDU)
|
||||
#define mpfr_floor(a,b) mpfr_rint((a), (b), MPFR_RNDD)
|
||||
|
||||
#define mpfr_cmp_ui(b,i) mpfr_cmp_ui_2exp((b),(i),0)
|
||||
#define mpfr_cmp_si(b,i) mpfr_cmp_si_2exp((b),(i),0)
|
||||
#define mpfr_set(a,b,r) mpfr_set4(a,b,r,MPFR_SIGN(b))
|
||||
#define mpfr_abs(a,b,r) mpfr_set4(a,b,r,1)
|
||||
#define mpfr_copysign(a,b,c,r) mpfr_set4(a,b,r,MPFR_SIGN(c))
|
||||
#define mpfr_setsign(a,b,s,r) mpfr_set4(a,b,r,(s) ? -1 : 1)
|
||||
#define mpfr_signbit(x) (MPFR_SIGN(x) < 0)
|
||||
#define mpfr_cmp(b, c) mpfr_cmp3(b, c, 1)
|
||||
#define mpfr_mul_2exp(y,x,n,r) mpfr_mul_2ui((y),(x),(n),(r))
|
||||
#define mpfr_div_2exp(y,x,n,r) mpfr_div_2ui((y),(x),(n),(r))
|
||||
|
||||
|
||||
/* When using GCC, optimize certain common comparisons and affectations.
|
||||
+ Remove ICC since it defines __GNUC__ but produces a
|
||||
huge number of warnings if you use this code.
|
||||
VL: I couldn't reproduce a single warning when enabling these macros
|
||||
with icc 10.1 20080212 on Itanium. But with this version, __ICC isn't
|
||||
defined (__INTEL_COMPILER is, though), so that these macros are enabled
|
||||
anyway. Checking with other ICC versions is needed. Possibly detect
|
||||
whether warnings are produced or not with a configure test.
|
||||
+ Remove C++ too, since it complains too much. */
|
||||
#if defined (__GNUC__) && !defined(__ICC) && !defined(__cplusplus)
|
||||
#if (__GNUC__ >= 2)
|
||||
#undef mpfr_cmp_ui
|
||||
/* We use the fact that mpfr_sgn on NaN sets the erange flag and returns 0. */
|
||||
#define mpfr_cmp_ui(_f,_u) \
|
||||
(__builtin_constant_p (_u) && (_u) == 0 ? \
|
||||
mpfr_sgn (_f) : \
|
||||
mpfr_cmp_ui_2exp ((_f),(_u),0))
|
||||
#undef mpfr_cmp_si
|
||||
#define mpfr_cmp_si(_f,_s) \
|
||||
(__builtin_constant_p (_s) && (_s) >= 0 ? \
|
||||
mpfr_cmp_ui ((_f), (_s)) : \
|
||||
mpfr_cmp_si_2exp ((_f), (_s), 0))
|
||||
#if __GNUC__ > 2 || __GNUC_MINOR__ >= 95
|
||||
#undef mpfr_set_ui
|
||||
#define mpfr_set_ui(_f,_u,_r) \
|
||||
(__builtin_constant_p (_u) && (_u) == 0 ? \
|
||||
__extension__ ({ \
|
||||
mpfr_ptr _p = (_f); \
|
||||
_p->_mpfr_sign = 1; \
|
||||
_p->_mpfr_exp = __MPFR_EXP_ZERO; \
|
||||
(void) (_r); 0; }) : \
|
||||
mpfr_set_ui_2exp ((_f), (_u), 0, (_r)))
|
||||
#endif
|
||||
#undef mpfr_set_si
|
||||
#define mpfr_set_si(_f,_s,_r) \
|
||||
(__builtin_constant_p (_s) && (_s) >= 0 ? \
|
||||
mpfr_set_ui ((_f), (_s), (_r)) : \
|
||||
mpfr_set_si_2exp ((_f), (_s), 0, (_r)))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Macro version of mpfr_stack interface for fast access */
|
||||
#define mpfr_custom_get_size(p) ((size_t) \
|
||||
(((p)+GMP_NUMB_BITS-1)/GMP_NUMB_BITS*sizeof (mp_limb_t)))
|
||||
#define mpfr_custom_init(m,p) do {} while (0)
|
||||
#define mpfr_custom_get_significand(x) ((void*)((x)->_mpfr_d))
|
||||
#define mpfr_custom_get_exp(x) ((x)->_mpfr_exp)
|
||||
#define mpfr_custom_move(x,m) do { ((x)->_mpfr_d = (mp_limb_t*)(m)); } while (0)
|
||||
#define mpfr_custom_init_set(x,k,e,p,m) do { \
|
||||
mpfr_ptr _x = (x); \
|
||||
mpfr_exp_t _e; \
|
||||
mpfr_kind_t _t; \
|
||||
int _s, _k; \
|
||||
_k = (k); \
|
||||
if (_k >= 0) { \
|
||||
_t = (mpfr_kind_t) _k; \
|
||||
_s = 1; \
|
||||
} else { \
|
||||
_t = (mpfr_kind_t) -k; \
|
||||
_s = -1; \
|
||||
} \
|
||||
_e = _t == MPFR_REGULAR_KIND ? (e) : \
|
||||
_t == MPFR_NAN_KIND ? __MPFR_EXP_NAN : \
|
||||
_t == MPFR_INF_KIND ? __MPFR_EXP_INF : __MPFR_EXP_ZERO; \
|
||||
_x->_mpfr_prec = (p); \
|
||||
_x->_mpfr_sign = _s; \
|
||||
_x->_mpfr_exp = _e; \
|
||||
_x->_mpfr_d = (mp_limb_t*) (m); \
|
||||
} while (0)
|
||||
#define mpfr_custom_get_kind(x) \
|
||||
( (x)->_mpfr_exp > __MPFR_EXP_INF ? (int)MPFR_REGULAR_KIND*MPFR_SIGN (x) \
|
||||
: (x)->_mpfr_exp == __MPFR_EXP_INF ? (int)MPFR_INF_KIND*MPFR_SIGN (x) \
|
||||
: (x)->_mpfr_exp == __MPFR_EXP_NAN ? (int)MPFR_NAN_KIND \
|
||||
: (int) MPFR_ZERO_KIND * MPFR_SIGN (x) )
|
||||
|
||||
|
||||
#endif /* MPFR_USE_NO_MACRO */
|
||||
|
||||
/* Theses are defined to be macros */
|
||||
#define mpfr_init_set_si(x, i, rnd) \
|
||||
( mpfr_init(x), mpfr_set_si((x), (i), (rnd)) )
|
||||
#define mpfr_init_set_ui(x, i, rnd) \
|
||||
( mpfr_init(x), mpfr_set_ui((x), (i), (rnd)) )
|
||||
#define mpfr_init_set_d(x, d, rnd) \
|
||||
( mpfr_init(x), mpfr_set_d((x), (d), (rnd)) )
|
||||
#define mpfr_init_set_ld(x, d, rnd) \
|
||||
( mpfr_init(x), mpfr_set_ld((x), (d), (rnd)) )
|
||||
#define mpfr_init_set_z(x, i, rnd) \
|
||||
( mpfr_init(x), mpfr_set_z((x), (i), (rnd)) )
|
||||
#define mpfr_init_set_q(x, i, rnd) \
|
||||
( mpfr_init(x), mpfr_set_q((x), (i), (rnd)) )
|
||||
#define mpfr_init_set(x, y, rnd) \
|
||||
( mpfr_init(x), mpfr_set((x), (y), (rnd)) )
|
||||
#define mpfr_init_set_f(x, y, rnd) \
|
||||
( mpfr_init(x), mpfr_set_f((x), (y), (rnd)) )
|
||||
|
||||
/* Compatibility layer -- obsolete functions and macros */
|
||||
#define mpfr_cmp_abs mpfr_cmpabs
|
||||
#define mpfr_round_prec(x,r,p) mpfr_prec_round(x,p,r)
|
||||
#define __gmp_default_rounding_mode (mpfr_get_default_rounding_mode())
|
||||
#define __mpfr_emin (mpfr_get_emin())
|
||||
#define __mpfr_emax (mpfr_get_emax())
|
||||
#define __mpfr_default_fp_bit_precision (mpfr_get_default_fp_bit_precision())
|
||||
#define MPFR_EMIN_MIN mpfr_get_emin_min()
|
||||
#define MPFR_EMIN_MAX mpfr_get_emin_max()
|
||||
#define MPFR_EMAX_MIN mpfr_get_emax_min()
|
||||
#define MPFR_EMAX_MAX mpfr_get_emax_max()
|
||||
#define mpfr_version (mpfr_get_version())
|
||||
#ifndef mpz_set_fr
|
||||
# define mpz_set_fr mpfr_get_z
|
||||
#endif
|
||||
#define mpfr_add_one_ulp(x,r) \
|
||||
(mpfr_sgn (x) > 0 ? mpfr_nextabove (x) : mpfr_nextbelow (x))
|
||||
#define mpfr_sub_one_ulp(x,r) \
|
||||
(mpfr_sgn (x) > 0 ? mpfr_nextbelow (x) : mpfr_nextabove (x))
|
||||
#define mpfr_get_z_exp mpfr_get_z_2exp
|
||||
#define mpfr_custom_get_mantissa mpfr_custom_get_significand
|
||||
|
||||
#endif /* __MPFR_H*/
|
||||
674
deps/MPFR/mpfr/mpfr.COPYING
vendored
Normal file
674
deps/MPFR/mpfr/mpfr.COPYING
vendored
Normal file
@@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
165
deps/MPFR/mpfr/mpfr.COPYING.LESSER
vendored
Normal file
165
deps/MPFR/mpfr/mpfr.COPYING.LESSER
vendored
Normal file
@@ -0,0 +1,165 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
||||
This version of the GNU Lesser General Public License incorporates
|
||||
the terms and conditions of version 3 of the GNU General Public
|
||||
License, supplemented by the additional permissions listed below.
|
||||
|
||||
0. Additional Definitions.
|
||||
|
||||
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||
General Public License.
|
||||
|
||||
"The Library" refers to a covered work governed by this License,
|
||||
other than an Application or a Combined Work as defined below.
|
||||
|
||||
An "Application" is any work that makes use of an interface provided
|
||||
by the Library, but which is not otherwise based on the Library.
|
||||
Defining a subclass of a class defined by the Library is deemed a mode
|
||||
of using an interface provided by the Library.
|
||||
|
||||
A "Combined Work" is a work produced by combining or linking an
|
||||
Application with the Library. The particular version of the Library
|
||||
with which the Combined Work was made is also called the "Linked
|
||||
Version".
|
||||
|
||||
The "Minimal Corresponding Source" for a Combined Work means the
|
||||
Corresponding Source for the Combined Work, excluding any source code
|
||||
for portions of the Combined Work that, considered in isolation, are
|
||||
based on the Application, and not on the Linked Version.
|
||||
|
||||
The "Corresponding Application Code" for a Combined Work means the
|
||||
object code and/or source code for the Application, including any data
|
||||
and utility programs needed for reproducing the Combined Work from the
|
||||
Application, but excluding the System Libraries of the Combined Work.
|
||||
|
||||
1. Exception to Section 3 of the GNU GPL.
|
||||
|
||||
You may convey a covered work under sections 3 and 4 of this License
|
||||
without being bound by section 3 of the GNU GPL.
|
||||
|
||||
2. Conveying Modified Versions.
|
||||
|
||||
If you modify a copy of the Library, and, in your modifications, a
|
||||
facility refers to a function or data to be supplied by an Application
|
||||
that uses the facility (other than as an argument passed when the
|
||||
facility is invoked), then you may convey a copy of the modified
|
||||
version:
|
||||
|
||||
a) under this License, provided that you make a good faith effort to
|
||||
ensure that, in the event an Application does not supply the
|
||||
function or data, the facility still operates, and performs
|
||||
whatever part of its purpose remains meaningful, or
|
||||
|
||||
b) under the GNU GPL, with none of the additional permissions of
|
||||
this License applicable to that copy.
|
||||
|
||||
3. Object Code Incorporating Material from Library Header Files.
|
||||
|
||||
The object code form of an Application may incorporate material from
|
||||
a header file that is part of the Library. You may convey such object
|
||||
code under terms of your choice, provided that, if the incorporated
|
||||
material is not limited to numerical parameters, data structure
|
||||
layouts and accessors, or small macros, inline functions and templates
|
||||
(ten or fewer lines in length), you do both of the following:
|
||||
|
||||
a) Give prominent notice with each copy of the object code that the
|
||||
Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
4. Combined Works.
|
||||
|
||||
You may convey a Combined Work under terms of your choice that,
|
||||
taken together, effectively do not restrict modification of the
|
||||
portions of the Library contained in the Combined Work and reverse
|
||||
engineering for debugging such modifications, if you also do each of
|
||||
the following:
|
||||
|
||||
a) Give prominent notice with each copy of the Combined Work that
|
||||
the Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
c) For a Combined Work that displays copyright notices during
|
||||
execution, include the copyright notice for the Library among
|
||||
these notices, as well as a reference directing the user to the
|
||||
copies of the GNU GPL and this license document.
|
||||
|
||||
d) Do one of the following:
|
||||
|
||||
0) Convey the Minimal Corresponding Source under the terms of this
|
||||
License, and the Corresponding Application Code in a form
|
||||
suitable for, and under terms that permit, the user to
|
||||
recombine or relink the Application with a modified version of
|
||||
the Linked Version to produce a modified Combined Work, in the
|
||||
manner specified by section 6 of the GNU GPL for conveying
|
||||
Corresponding Source.
|
||||
|
||||
1) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (a) uses at run time
|
||||
a copy of the Library already present on the user's computer
|
||||
system, and (b) will operate properly with a modified version
|
||||
of the Library that is interface-compatible with the Linked
|
||||
Version.
|
||||
|
||||
e) Provide Installation Information, but only if you would otherwise
|
||||
be required to provide such information under section 6 of the
|
||||
GNU GPL, and only to the extent that such information is
|
||||
necessary to install and execute a modified version of the
|
||||
Combined Work produced by recombining or relinking the
|
||||
Application with a modified version of the Linked Version. (If
|
||||
you use option 4d0, the Installation Information must accompany
|
||||
the Minimal Corresponding Source and Corresponding Application
|
||||
Code. If you use option 4d1, you must provide the Installation
|
||||
Information in the manner specified by section 6 of the GNU GPL
|
||||
for conveying Corresponding Source.)
|
||||
|
||||
5. Combined Libraries.
|
||||
|
||||
You may place library facilities that are a work based on the
|
||||
Library side by side in a single library together with other library
|
||||
facilities that are not Applications and are not covered by this
|
||||
License, and convey such a combined library under terms of your
|
||||
choice, if you do both of the following:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work based
|
||||
on the Library, uncombined with any other library facilities,
|
||||
conveyed under the terms of this License.
|
||||
|
||||
b) Give prominent notice with the combined library that part of it
|
||||
is a work based on the Library, and explaining where to find the
|
||||
accompanying uncombined form of the same work.
|
||||
|
||||
6. Revised Versions of the GNU Lesser General Public License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the GNU Lesser General Public License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may
|
||||
differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Library as you received it specifies that a certain numbered version
|
||||
of the GNU Lesser General Public License "or any later version"
|
||||
applies to it, you have the option of following the terms and
|
||||
conditions either of that published version or of any later version
|
||||
published by the Free Software Foundation. If the Library as you
|
||||
received it does not specify a version number of the GNU Lesser
|
||||
General Public License, you may choose any version of the GNU Lesser
|
||||
General Public License ever published by the Free Software Foundation.
|
||||
|
||||
If the Library as you received it specifies that a proxy can decide
|
||||
whether future versions of the GNU Lesser General Public License shall
|
||||
apply, that proxy's public statement of acceptance of any version is
|
||||
permanent authorization for you to choose that version for the
|
||||
Library.
|
||||
91
deps/MPFR/mpfr/mpfr.README
vendored
Normal file
91
deps/MPFR/mpfr/mpfr.README
vendored
Normal file
@@ -0,0 +1,91 @@
|
||||
Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
|
||||
Contributed by the Arenaire and Cacao projects, INRIA.
|
||||
|
||||
This file is part of the GNU MPFR Library.
|
||||
|
||||
The GNU MPFR Library is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
The GNU MPFR Library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
||||
License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
|
||||
http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
|
||||
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
##############################################################################
|
||||
|
||||
The GNU MPFR distribution contains the following files:
|
||||
(This does not apply to code retrieved by Subversion.)
|
||||
|
||||
AUTHORS - the authors of the library
|
||||
BUGS - bugs in MPFR - please read this file!
|
||||
COPYING - the GNU General Public License, version 3
|
||||
COPYING.LESSER - the GNU Lesser General Public License, version 3
|
||||
ChangeLog - the log of changes
|
||||
FAQ.html - frequently asked questions about MPFR
|
||||
INSTALL - how to install MPFR (see also mpfr.texi)
|
||||
Makefile* - files for building the library
|
||||
NEWS - new features with respect to previous versions
|
||||
PATCHES - empty file (until patches are applied)
|
||||
README - this file
|
||||
TODO - what remains to do (any help is welcome!)
|
||||
VERSION - version of MPFR (next release version if taken by Subversion)
|
||||
ac*.m4 - automatic configuration files
|
||||
ansi2knr.* - convert ANSI C to Kernighan & Ritchie C (source and man page)
|
||||
*.c - source files
|
||||
*.h - header files
|
||||
compile - auxiliary installation file
|
||||
config.* - auxiliary installation files
|
||||
configure* - configuration files
|
||||
depcomp - auxiliary installation file
|
||||
examples/ - directory containing examples
|
||||
fdl.texi - the GNU Free Documentation License
|
||||
get_patches.sh - rebuild get_patches.c when patches have been applied
|
||||
install-sh - installation file
|
||||
ltmain.sh - auxiliary installation file
|
||||
m4/ - directory containing additional configuration files
|
||||
missing - auxiliary installation file
|
||||
mparam_h.in - header file template
|
||||
mpfr.info - info file for MPFR
|
||||
mpfr.texi - texinfo documentation for MPFR (source)
|
||||
tests/ - test directory
|
||||
texinfo.tex - TeX macros to handle mpfr.texi
|
||||
|
||||
According to the special exception to the GNU General Public License,
|
||||
the autotools files compile, config.sub, config.guess, ltmain.sh,
|
||||
m4/libtool.m4 and missing are distributed under the same licence of
|
||||
GNU MPFR.
|
||||
|
||||
|
||||
You can get the latest source code by Subversion at InriaGforge:
|
||||
|
||||
svn checkout svn://scm.gforge.inria.fr/svn/mpfr/trunk mpfr
|
||||
|
||||
or
|
||||
|
||||
svn checkout https://scm.gforge.inria.fr/svn/mpfr/trunk mpfr
|
||||
|
||||
(the last argument can be any directory name). You can use
|
||||
|
||||
svn ls svn://scm.gforge.inria.fr/svn/mpfr/branches
|
||||
svn ls svn://scm.gforge.inria.fr/svn/mpfr/tags
|
||||
|
||||
to get the list of branches or tags (releases), then checkout a
|
||||
particular branch or tag instead of the trunk. Alternatively, you
|
||||
can now use the "https:" scheme (a.k.a. DAV) instead of "svn:".
|
||||
For more information about Subversion, please see:
|
||||
|
||||
* http://svnbook.red-bean.com/ (the official Subversion book);
|
||||
* http://gcc.gnu.org/wiki/SvnHelp (written for GCC developers,
|
||||
but interesting general information can be found there);
|
||||
* http://subversion.tigris.org/faq.html (the Subversion FAQ).
|
||||
|
||||
Subversion users should read the file "README.dev".
|
||||
|
||||
Note: the old CVS repository at cvs-sop.inria.fr is now closed.
|
||||
15
deps/NLopt/NLopt.cmake
vendored
Normal file
15
deps/NLopt/NLopt.cmake
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
qidislicer_add_cmake_project(NLopt
|
||||
URL "https://github.com/stevengj/nlopt/archive/v2.5.0.tar.gz"
|
||||
URL_HASH SHA256=c6dd7a5701fff8ad5ebb45a3dc8e757e61d52658de3918e38bab233e7fd3b4ae
|
||||
CMAKE_ARGS
|
||||
-DNLOPT_PYTHON:BOOL=OFF
|
||||
-DNLOPT_OCTAVE:BOOL=OFF
|
||||
-DNLOPT_MATLAB:BOOL=OFF
|
||||
-DNLOPT_GUILE:BOOL=OFF
|
||||
-DNLOPT_SWIG:BOOL=OFF
|
||||
-DNLOPT_TESTS:BOOL=OFF
|
||||
)
|
||||
|
||||
if (MSVC)
|
||||
add_debug_dep(dep_NLopt)
|
||||
endif ()
|
||||
9
deps/NanoSVG/NanoSVG.cmake
vendored
Normal file
9
deps/NanoSVG/NanoSVG.cmake
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
# In QIDISlicer 2.6.0 we switched from https://github.com/memononen/nanosvg to its fork https://github.com/fltk/nanosvg
|
||||
# because this last implements the new function nsvgRasterizeXY() which we now use in GLTexture::load_from_svg()
|
||||
# for rasterizing svg files from their original size to a squared power of two texture on Windows systems using
|
||||
# AMD Radeon graphics cards
|
||||
|
||||
qidislicer_add_cmake_project(NanoSVG
|
||||
URL https://github.com/fltk/nanosvg/archive/abcd277ea45e9098bed752cf9c6875b533c0892f.zip
|
||||
URL_HASH SHA256=e859938fbaee4b351bd8a8b3d3c7a75b40c36885ce00b73faa1ce0b98aa0ad34
|
||||
)
|
||||
27
deps/OCCT/OCCT.cmake
vendored
Normal file
27
deps/OCCT/OCCT.cmake
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
qidislicer_add_cmake_project(OCCT
|
||||
#LMBBS: changed version to 7.6.2
|
||||
URL https://github.com/Open-Cascade-SAS/OCCT/archive/refs/tags/V7_6_2.zip
|
||||
URL_HASH SHA256=c696b923593e8c18d059709717dbf155b3e72fdd283c8522047a790ec3a432c5
|
||||
|
||||
PATCH_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_LIST_DIR}/occt_toolkit.cmake ./adm/cmake/
|
||||
CMAKE_ARGS
|
||||
-DINSTALL_DIR_LAYOUT=Unix # LMBBS
|
||||
-DBUILD_LIBRARY_TYPE=Static
|
||||
-DUSE_TK=OFF
|
||||
-DUSE_TBB=OFF
|
||||
-DUSE_FREETYPE=OFF
|
||||
-DUSE_FFMPEG=OFF
|
||||
-DUSE_VTK=OFF
|
||||
-DUSE_FREETYPE=OFF
|
||||
-DBUILD_MODULE_ApplicationFramework=OFF
|
||||
#-DBUILD_MODULE_DataExchange=OFF
|
||||
-DBUILD_MODULE_Draw=OFF
|
||||
-DBUILD_MODULE_FoundationClasses=OFF
|
||||
-DBUILD_MODULE_ModelingAlgorithms=OFF
|
||||
-DBUILD_MODULE_ModelingData=OFF
|
||||
-DBUILD_MODULE_Visualization=OFF
|
||||
)
|
||||
|
||||
if (MSVC)
|
||||
add_debug_dep(dep_OCCT)
|
||||
endif ()
|
||||
453
deps/OCCT/occt_toolkit.cmake
vendored
Normal file
453
deps/OCCT/occt_toolkit.cmake
vendored
Normal file
@@ -0,0 +1,453 @@
|
||||
# script for each OCCT toolkit
|
||||
|
||||
# filling some variables by default values(src) or using custom(tools, samples)
|
||||
set (RELATIVE_SOURCES_DIR "${RELATIVE_DIR}")
|
||||
if ("${RELATIVE_SOURCES_DIR}" STREQUAL "")
|
||||
#if it is not defined, use default directory
|
||||
set (RELATIVE_SOURCES_DIR "src")
|
||||
endif()
|
||||
|
||||
set (OCC_MODULES_LIST "${MODULES_LIST}")
|
||||
if ("${OCC_MODULES_LIST}" STREQUAL "")
|
||||
set (OCC_MODULES_LIST ${OCCT_MODULES})
|
||||
endif()
|
||||
|
||||
set (OCC_TARGET_FOLDER "${TARGET_FOLDER}")
|
||||
if ("${OCC_TARGET_FOLDER}" STREQUAL "")
|
||||
set (OCC_TARGET_FOLDER "Modules")
|
||||
endif()
|
||||
|
||||
set (OCCT_TOOLKITS_NAME_SUFFIX "${TOOLKITS_NAME_SUFFIX}")
|
||||
if ("${OCCT_TOOLKITS_NAME_SUFFIX}" STREQUAL "")
|
||||
set (OCCT_TOOLKITS_NAME_SUFFIX "TOOLKITS")
|
||||
endif()
|
||||
|
||||
# parse PACKAGES file
|
||||
FILE_TO_LIST ("${RELATIVE_SOURCES_DIR}/${PROJECT_NAME}/PACKAGES" USED_PACKAGES)
|
||||
if ("${USED_PACKAGES}" STREQUAL "")
|
||||
set (USED_PACKAGES ${PROJECT_NAME})
|
||||
endif()
|
||||
|
||||
if (USE_QT)
|
||||
# Qt dependencies
|
||||
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/qt_macro)
|
||||
FIND_QT_PACKAGE(PROJECT_LIBRARIES_DEBUG PROJECT_LIBRARIES_RELEASE PROJECT_INCLUDES)
|
||||
include_directories("${PROJECT_INCLUDES}")
|
||||
endif(USE_QT)
|
||||
|
||||
set (PRECOMPILED_DEFS)
|
||||
|
||||
if (NOT BUILD_SHARED_LIBS)
|
||||
list (APPEND PRECOMPILED_DEFS "-DOCCT_NO_PLUGINS")
|
||||
if (WIN32 AND NOT EXECUTABLE_PROJECT)
|
||||
list (APPEND PRECOMPILED_DEFS "-DOCCT_STATIC_BUILD")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Get all used packages from toolkit
|
||||
UNSET(RESOURCE_FILES)
|
||||
foreach (OCCT_PACKAGE ${USED_PACKAGES})
|
||||
|
||||
#remove part after "/" in the OCCT_PACKAGE variable if exists
|
||||
string (FIND "${OCCT_PACKAGE}" "/" _index)
|
||||
if (_index GREATER -1)
|
||||
math (EXPR _index "${_index}")
|
||||
string (SUBSTRING "${OCCT_PACKAGE}" 0 ${_index} OCCT_PACKAGE_NAME)
|
||||
else()
|
||||
set (OCCT_PACKAGE_NAME "${OCCT_PACKAGE}")
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
list (APPEND PRECOMPILED_DEFS "-D__${OCCT_PACKAGE_NAME}_DLL")
|
||||
endif()
|
||||
|
||||
set (SOURCE_FILES)
|
||||
set (HEADER_FILES)
|
||||
|
||||
# Generate Flex and Bison files
|
||||
if (${BUILD_YACCLEX})
|
||||
# flex files
|
||||
OCCT_ORIGIN_AND_PATCHED_FILES ("${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}" "*[.]lex" SOURCE_FILES_FLEX)
|
||||
list (LENGTH SOURCE_FILES_FLEX SOURCE_FILES_FLEX_LEN)
|
||||
|
||||
# bison files
|
||||
OCCT_ORIGIN_AND_PATCHED_FILES ("${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}" "*[.]yacc" SOURCE_FILES_BISON)
|
||||
list (LENGTH SOURCE_FILES_BISON SOURCE_FILES_BISON_LEN)
|
||||
|
||||
if (${SOURCE_FILES_FLEX_LEN} EQUAL ${SOURCE_FILES_BISON_LEN} AND NOT ${SOURCE_FILES_FLEX_LEN} EQUAL 0)
|
||||
|
||||
list (SORT SOURCE_FILES_FLEX)
|
||||
list (SORT SOURCE_FILES_BISON)
|
||||
|
||||
math (EXPR SOURCE_FILES_FLEX_LEN "${SOURCE_FILES_FLEX_LEN} - 1")
|
||||
foreach (FLEX_FILE_INDEX RANGE ${SOURCE_FILES_FLEX_LEN})
|
||||
|
||||
list (GET SOURCE_FILES_FLEX ${FLEX_FILE_INDEX} CURRENT_FLEX_FILE)
|
||||
get_filename_component (CURRENT_FLEX_FILE_NAME ${CURRENT_FLEX_FILE} NAME_WE)
|
||||
|
||||
list (GET SOURCE_FILES_BISON ${FLEX_FILE_INDEX} CURRENT_BISON_FILE)
|
||||
get_filename_component (CURRENT_BISON_FILE_NAME ${CURRENT_BISON_FILE} NAME_WE)
|
||||
|
||||
string (COMPARE EQUAL ${CURRENT_FLEX_FILE_NAME} ${CURRENT_BISON_FILE_NAME} ARE_FILES_EQUAL)
|
||||
|
||||
if (EXISTS "${CURRENT_FLEX_FILE}" AND EXISTS "${CURRENT_BISON_FILE}" AND ${ARE_FILES_EQUAL})
|
||||
|
||||
# Note: files are generated in original source directory (not in patch!)
|
||||
set (FLEX_BISON_TARGET_DIR "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}")
|
||||
|
||||
# choose appropriate extension for generated files: "cxx" if source file contains
|
||||
# instruction to generate C++ code, "c" otherwise
|
||||
set (BISON_OUTPUT_FILE_EXT "c")
|
||||
set (FLEX_OUTPUT_FILE_EXT "c")
|
||||
file (STRINGS "${CURRENT_BISON_FILE}" FILE_BISON_CONTENT)
|
||||
foreach (FILE_BISON_CONTENT_LINE ${FILE_BISON_CONTENT})
|
||||
string (REGEX MATCH "%language \"C\\+\\+\"" CXX_BISON_LANGUAGE_FOUND ${FILE_BISON_CONTENT_LINE})
|
||||
if (CXX_BISON_LANGUAGE_FOUND)
|
||||
set (BISON_OUTPUT_FILE_EXT "cxx")
|
||||
endif()
|
||||
endforeach()
|
||||
file (STRINGS "${CURRENT_FLEX_FILE}" FILE_FLEX_CONTENT)
|
||||
foreach (FILE_FLEX_CONTENT_LINE ${FILE_FLEX_CONTENT})
|
||||
string (REGEX MATCH "%option c\\+\\+" CXX_FLEX_LANGUAGE_FOUND ${FILE_FLEX_CONTENT_LINE})
|
||||
if (CXX_FLEX_LANGUAGE_FOUND)
|
||||
set (FLEX_OUTPUT_FILE_EXT "cxx")
|
||||
|
||||
# install copy of FlexLexer.h locally to allow further building without flex
|
||||
if (FLEX_INCLUDE_DIR AND EXISTS "${FLEX_INCLUDE_DIR}/FlexLexer.h")
|
||||
configure_file("${FLEX_INCLUDE_DIR}/FlexLexer.h" "${FLEX_BISON_TARGET_DIR}/FlexLexer.h" @ONLY NEWLINE_STYLE LF)
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
set (BISON_OUTPUT_FILE ${CURRENT_BISON_FILE_NAME}.tab.${BISON_OUTPUT_FILE_EXT})
|
||||
set (FLEX_OUTPUT_FILE lex.${CURRENT_FLEX_FILE_NAME}.${FLEX_OUTPUT_FILE_EXT})
|
||||
|
||||
BISON_TARGET (Parser_${CURRENT_BISON_FILE_NAME} ${CURRENT_BISON_FILE} "${FLEX_BISON_TARGET_DIR}/${BISON_OUTPUT_FILE}"
|
||||
COMPILE_FLAGS "-p ${CURRENT_BISON_FILE_NAME} -l -M ${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/=")
|
||||
FLEX_TARGET (Scanner_${CURRENT_FLEX_FILE_NAME} ${CURRENT_FLEX_FILE} "${FLEX_BISON_TARGET_DIR}/${FLEX_OUTPUT_FILE}"
|
||||
COMPILE_FLAGS "-P${CURRENT_FLEX_FILE_NAME} -L")
|
||||
ADD_FLEX_BISON_DEPENDENCY (Scanner_${CURRENT_FLEX_FILE_NAME} Parser_${CURRENT_BISON_FILE_NAME})
|
||||
|
||||
list (APPEND SOURCE_FILES ${BISON_OUTPUT_FILE} ${FLEX_OUTPUT_FILE})
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# header files
|
||||
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES")
|
||||
file (STRINGS "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" HEADER_FILES_M REGEX ".+[.]h")
|
||||
file (STRINGS "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" HEADER_FILES_LXX REGEX ".+[.]lxx")
|
||||
file (STRINGS "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" HEADER_FILES_GXX REGEX ".+[.]gxx")
|
||||
|
||||
file (STRINGS "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" SOURCE_FILES_C REGEX ".+[.]c")
|
||||
if(APPLE)
|
||||
file (STRINGS "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" SOURCE_FILES_M REGEX ".+[.]mm")
|
||||
endif()
|
||||
else()
|
||||
file (STRINGS "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" HEADER_FILES_M REGEX ".+[.]h")
|
||||
file (STRINGS "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" HEADER_FILES_LXX REGEX ".+[.]lxx")
|
||||
file (STRINGS "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" HEADER_FILES_GXX REGEX ".+[.]gxx")
|
||||
|
||||
file (STRINGS "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" SOURCE_FILES_C REGEX ".+[.]c")
|
||||
if(APPLE)
|
||||
file (STRINGS "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" SOURCE_FILES_M REGEX ".+[.]mm")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
list (APPEND HEADER_FILES ${HEADER_FILES_M} ${HEADER_FILES_LXX} ${SOURCE_FILES_GXX})
|
||||
list (APPEND SOURCE_FILES ${SOURCE_FILES_C})
|
||||
if(APPLE)
|
||||
list (APPEND SOURCE_FILES ${SOURCE_FILES_M})
|
||||
endif()
|
||||
|
||||
foreach(HEADER_FILE ${HEADER_FILES})
|
||||
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${HEADER_FILE}")
|
||||
message (STATUS "Info: consider patched file: ${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${HEADER_FILE}")
|
||||
list (APPEND USED_INCFILES "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${HEADER_FILE}")
|
||||
SOURCE_GROUP ("Header Files\\${OCCT_PACKAGE_NAME}" FILES "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${HEADER_FILE}")
|
||||
else()
|
||||
list (APPEND USED_INCFILES "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${HEADER_FILE}")
|
||||
SOURCE_GROUP ("Header Files\\${OCCT_PACKAGE_NAME}" FILES "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${HEADER_FILE}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
foreach(SOURCE_FILE ${SOURCE_FILES})
|
||||
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${SOURCE_FILE}")
|
||||
message (STATUS "Info: consider patched file: ${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${SOURCE_FILE}")
|
||||
list (APPEND USED_SRCFILES "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${SOURCE_FILE}")
|
||||
SOURCE_GROUP ("Source Files\\${OCCT_PACKAGE_NAME}" FILES "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${SOURCE_FILE}")
|
||||
else()
|
||||
list (APPEND USED_SRCFILES "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${SOURCE_FILE}")
|
||||
SOURCE_GROUP ("Source Files\\${OCCT_PACKAGE_NAME}" FILES "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${SOURCE_FILE}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if (USE_QT)
|
||||
FIND_AND_INSTALL_QT_RESOURCES (${OCCT_PACKAGE} RESOURCE_FILES)
|
||||
#message("Qt Resource files are: ${QT_RESOURCE_FILES} in ${OCCT_PACKAGE}")
|
||||
endif(USE_QT)
|
||||
|
||||
#message("Resource files are: ${RESOURCE_FILES} in ${OCCT_PACKAGE}")
|
||||
foreach(RESOURCE_FILE ${RESOURCE_FILES})
|
||||
SOURCE_GROUP ("Resource Files\\${OCCT_PACKAGE_NAME}" FILES "${RESOURCE_FILE}")
|
||||
endforeach()
|
||||
endforeach()
|
||||
string (REGEX REPLACE ";" " " PRECOMPILED_DEFS "${PRECOMPILED_DEFS}")
|
||||
|
||||
set (USED_RCFILE "")
|
||||
if (MSVC)
|
||||
set (USED_RCFILE "${CMAKE_BINARY_DIR}/resources/${PROJECT_NAME}.rc")
|
||||
|
||||
if (APPLY_OCCT_PATCH_DIR AND EXISTS "${APPLY_OCCT_PATCH_DIR}/adm/templates/occt_toolkit.rc.in")
|
||||
configure_file("${APPLY_OCCT_PATCH_DIR}/adm/templates/occt_toolkit.rc.in" "${USED_RCFILE}" @ONLY)
|
||||
else()
|
||||
configure_file("${CMAKE_SOURCE_DIR}/adm/templates/occt_toolkit.rc.in" "${USED_RCFILE}" @ONLY)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set (CURRENT_MODULE)
|
||||
foreach (OCCT_MODULE ${OCC_MODULES_LIST})
|
||||
list (FIND ${OCCT_MODULE}_${OCCT_TOOLKITS_NAME_SUFFIX} ${PROJECT_NAME} CURRENT_PROJECT_IS_BUILT)
|
||||
|
||||
if (NOT ${CURRENT_PROJECT_IS_BUILT} EQUAL -1)
|
||||
set (CURRENT_MODULE ${OCCT_MODULE})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if (MSVC)
|
||||
OCCT_INSERT_CODE_FOR_TARGET ()
|
||||
endif()
|
||||
|
||||
if (USE_QT)
|
||||
FIND_AND_WRAP_MOC_FILES("${USED_INCFILES}" "${PROJECT_NAME}_MOC_FILES")
|
||||
#message("MOC files: ${${PROJECT_NAME}_MOC_FILES}")
|
||||
endif (USE_QT)
|
||||
|
||||
if (EXECUTABLE_PROJECT)
|
||||
add_executable (${PROJECT_NAME} ${USED_SRCFILES} ${USED_INCFILES} ${USED_RCFILE} ${RESOURCE_FILES} ${${PROJECT_NAME}_MOC_FILES})
|
||||
|
||||
install (TARGETS ${PROJECT_NAME}
|
||||
DESTINATION "${INSTALL_DIR_BIN}\${OCCT_INSTALL_BIN_LETTER}")
|
||||
|
||||
if (EMSCRIPTEN)
|
||||
install(FILES ${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin\${OCCT_INSTALL_BIN_LETTER}/${PROJECT_NAME}.wasm DESTINATION "${INSTALL_DIR_BIN}/${OCCT_INSTALL_BIN_LETTER}")
|
||||
endif()
|
||||
else()
|
||||
add_library (${PROJECT_NAME} ${USED_SRCFILES} ${USED_INCFILES} ${USED_RCFILE} ${RESOURCE_FILES} ${${PROJECT_NAME}_MOC_FILES})
|
||||
|
||||
if (MSVC)
|
||||
if (BUILD_FORCE_RelWithDebInfo)
|
||||
set (aReleasePdbConf "Release")
|
||||
else()
|
||||
set (aReleasePdbConf)
|
||||
endif()
|
||||
# install (FILES ${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin\${OCCT_INSTALL_BIN_LETTER}/${PROJECT_NAME}.pdb
|
||||
# CONFIGURATIONS Debug ${aReleasePdbConf} RelWithDebInfo
|
||||
# DESTINATION "${INSTALL_DIR_BIN}\${OCCT_INSTALL_BIN_LETTER}")
|
||||
endif()
|
||||
|
||||
if (BUILD_SHARED_LIBS AND NOT "${BUILD_SHARED_LIBRARY_NAME_POSTFIX}" STREQUAL "")
|
||||
set (CMAKE_SHARED_LIBRARY_SUFFIX_DEFAULT ${CMAKE_SHARED_LIBRARY_SUFFIX})
|
||||
set (CMAKE_SHARED_LIBRARY_SUFFIX "${BUILD_SHARED_LIBRARY_NAME_POSTFIX}${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||
endif()
|
||||
|
||||
install (TARGETS ${PROJECT_NAME}
|
||||
EXPORT OpenCASCADE${CURRENT_MODULE}Targets
|
||||
RUNTIME DESTINATION "${INSTALL_DIR_BIN}\${OCCT_INSTALL_BIN_LETTER}"
|
||||
ARCHIVE DESTINATION "${INSTALL_DIR_LIB}\${OCCT_INSTALL_BIN_LETTER}"
|
||||
LIBRARY DESTINATION "${INSTALL_DIR_LIB}\${OCCT_INSTALL_BIN_LETTER}")
|
||||
|
||||
if (NOT WIN32)
|
||||
if (BUILD_SHARED_LIBS AND NOT "${BUILD_SHARED_LIBRARY_NAME_POSTFIX}" STREQUAL "")
|
||||
set (LINK_NAME "${INSTALL_DIR}/${INSTALL_DIR_LIB}\${OCCT_INSTALL_BIN_LETTER}/lib${PROJECT_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX_DEFAULT}")
|
||||
set (LIBRARY_NAME "${INSTALL_DIR}/${INSTALL_DIR_LIB}\${OCCT_INSTALL_BIN_LETTER}/lib${PROJECT_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||
OCCT_CREATE_SYMLINK_TO_FILE (${LIBRARY_NAME} ${LINK_NAME})
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (CURRENT_MODULE)
|
||||
set_target_properties (${PROJECT_NAME} PROPERTIES FOLDER "${OCC_TARGET_FOLDER}/${CURRENT_MODULE}")
|
||||
set_target_properties (${PROJECT_NAME} PROPERTIES MODULE "${CURRENT_MODULE}")
|
||||
if (APPLE)
|
||||
if (NOT "${INSTALL_NAME_DIR}" STREQUAL "")
|
||||
set_target_properties (${PROJECT_NAME} PROPERTIES BUILD_WITH_INSTALL_RPATH 1 INSTALL_NAME_DIR "${INSTALL_NAME_DIR}")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
get_property (OCC_VERSION_MAJOR GLOBAL PROPERTY OCC_VERSION_MAJOR)
|
||||
get_property (OCC_VERSION_MINOR GLOBAL PROPERTY OCC_VERSION_MINOR)
|
||||
get_property (OCC_VERSION_MAINTENANCE GLOBAL PROPERTY OCC_VERSION_MAINTENANCE)
|
||||
|
||||
if (ANDROID)
|
||||
# do not append version to the filename
|
||||
set_target_properties (${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "${PRECOMPILED_DEFS}")
|
||||
else()
|
||||
set_target_properties (${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "${PRECOMPILED_DEFS}"
|
||||
SOVERSION "${OCC_VERSION_MAJOR}"
|
||||
VERSION "${OCC_VERSION_MAJOR}.${OCC_VERSION_MINOR}.${OCC_VERSION_MAINTENANCE}")
|
||||
endif()
|
||||
|
||||
set (USED_TOOLKITS_BY_CURRENT_PROJECT)
|
||||
set (USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT)
|
||||
|
||||
# parse EXTERNLIB file
|
||||
if (CUSTOM_EXTERNLIB)
|
||||
set (USED_EXTERNLIB_AND_TOOLKITS ${CUSTOM_EXTERNLIB})
|
||||
else()
|
||||
FILE_TO_LIST ("${RELATIVE_SOURCES_DIR}/${PROJECT_NAME}/EXTERNLIB" USED_EXTERNLIB_AND_TOOLKITS)
|
||||
endif()
|
||||
foreach (USED_ITEM ${USED_EXTERNLIB_AND_TOOLKITS})
|
||||
string (REGEX MATCH "^ *#" COMMENT_FOUND ${USED_ITEM})
|
||||
if (NOT COMMENT_FOUND)
|
||||
string (REGEX MATCH "^TK" TK_FOUND ${USED_ITEM})
|
||||
string (REGEX MATCH "^vtk" VTK_FOUND ${USED_ITEM})
|
||||
|
||||
if (NOT "${TK_FOUND}" STREQUAL "" OR NOT "${VTK_FOUND}" STREQUAL "")
|
||||
list (APPEND USED_TOOLKITS_BY_CURRENT_PROJECT ${USED_ITEM})
|
||||
if (NOT "${VTK_FOUND}" STREQUAL "" AND BUILD_SHARED_LIBS AND INSTALL_VTK AND COMMAND OCCT_INSTALL_VTK)
|
||||
OCCT_INSTALL_VTK(${USED_ITEM})
|
||||
endif()
|
||||
else()
|
||||
string (REGEX MATCH "^CSF_" CSF_FOUND ${USED_ITEM})
|
||||
if ("${CSF_FOUND}" STREQUAL "")
|
||||
message (STATUS "Info: ${USED_ITEM} from ${PROJECT_NAME} skipped due to it is empty")
|
||||
else() # get CSF_ value
|
||||
set (CURRENT_CSF ${${USED_ITEM}})
|
||||
if (NOT "x${CURRENT_CSF}" STREQUAL "x")
|
||||
if ("${CURRENT_CSF}" STREQUAL "CSF_OpenGlLibs")
|
||||
add_definitions (-DHAVE_OPENGL)
|
||||
endif()
|
||||
if ("${CURRENT_CSF}" STREQUAL "CSF_OpenGlesLibs")
|
||||
add_definitions (-DHAVE_GLES2)
|
||||
endif()
|
||||
|
||||
set (LIBRARY_FROM_CACHE 0)
|
||||
separate_arguments (CURRENT_CSF)
|
||||
foreach (CSF_LIBRARY ${CURRENT_CSF})
|
||||
string (TOLOWER "${CSF_LIBRARY}" CSF_LIBRARY)
|
||||
string (REPLACE "+" "[+]" CSF_LIBRARY "${CSF_LIBRARY}")
|
||||
string (REPLACE "." "" CSF_LIBRARY "${CSF_LIBRARY}")
|
||||
get_cmake_property(ALL_CACHE_VARIABLES CACHE_VARIABLES)
|
||||
string (REGEX MATCHALL "(^|;)3RDPARTY_[^;]+_LIBRARY[^;]*" ALL_CACHE_VARIABLES "${ALL_CACHE_VARIABLES}")
|
||||
foreach (CACHE_VARIABLE ${ALL_CACHE_VARIABLES})
|
||||
set (CURRENT_CACHE_LIBRARY ${${CACHE_VARIABLE}})
|
||||
string (TOLOWER "${CACHE_VARIABLE}" CACHE_VARIABLE)
|
||||
|
||||
if (EXISTS "${CURRENT_CACHE_LIBRARY}" AND NOT IS_DIRECTORY "${CURRENT_CACHE_LIBRARY}")
|
||||
string (REGEX MATCH "_${CSF_LIBRARY}$" IS_ENDING "${CACHE_VARIABLE}")
|
||||
string (REGEX MATCH "^([a-z]+)" CSF_WO_VERSION "${CSF_LIBRARY}")
|
||||
string (REGEX MATCH "_${CSF_WO_VERSION}$" IS_ENDING_WO_VERSION "${CACHE_VARIABLE}")
|
||||
if ("3rdparty_${CSF_LIBRARY}_library" STREQUAL "${CACHE_VARIABLE}" OR
|
||||
"3rdparty_${CSF_WO_VERSION}_library" STREQUAL "${CACHE_VARIABLE}" OR
|
||||
NOT "x${IS_ENDING}" STREQUAL "x" OR
|
||||
NOT "x${IS_ENDING_WO_VERSION}" STREQUAL "x")
|
||||
list (APPEND USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT "${CURRENT_CACHE_LIBRARY}")
|
||||
set (LIBRARY_FROM_CACHE 1)
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
endforeach()
|
||||
|
||||
if (NOT ${LIBRARY_FROM_CACHE})
|
||||
# prepare a list from a string with whitespaces
|
||||
separate_arguments (CURRENT_CSF)
|
||||
list (APPEND USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT ${CURRENT_CSF})
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if (APPLE)
|
||||
list (FIND USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT X11 IS_X11_FOUND)
|
||||
if (NOT ${IS_X11_FOUND} EQUAL -1)
|
||||
find_package (X11 COMPONENTS X11)
|
||||
if (NOT X11_FOUND)
|
||||
message (STATUS "Warning: X11 is not found. It's required to install The XQuartz project: http://www.xquartz.org")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Update list of used VTK libraries if OpenGL2 Rendering BackEnd is used.
|
||||
# Add VTK_OPENGL2_BACKEND definition.
|
||||
if("${VTK_RENDERING_BACKEND}" STREQUAL "OpenGL2" OR IS_VTK_9XX)
|
||||
add_definitions(-DVTK_OPENGL2_BACKEND)
|
||||
foreach (VTK_EXCLUDE_LIBRARY vtkRenderingOpenGL vtkRenderingFreeTypeOpenGL)
|
||||
list (FIND USED_TOOLKITS_BY_CURRENT_PROJECT "${VTK_EXCLUDE_LIBRARY}" IS_VTK_OPENGL_FOUND)
|
||||
if (NOT ${IS_VTK_OPENGL_FOUND} EQUAL -1)
|
||||
list (REMOVE_ITEM USED_TOOLKITS_BY_CURRENT_PROJECT ${VTK_EXCLUDE_LIBRARY})
|
||||
if (${VTK_EXCLUDE_LIBRARY} STREQUAL vtkRenderingOpenGL)
|
||||
list (APPEND USED_TOOLKITS_BY_CURRENT_PROJECT vtkRenderingOpenGL2)
|
||||
if(VTK_MAJOR_VERSION GREATER 6)
|
||||
list (APPEND USED_TOOLKITS_BY_CURRENT_PROJECT vtkRenderingGL2PSOpenGL2)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
else()
|
||||
if(VTK_MAJOR_VERSION EQUAL 6 AND VTK_MINOR_VERSION GREATER 2 OR VTK_MAJOR_VERSION GREATER 6)
|
||||
list (FIND USED_TOOLKITS_BY_CURRENT_PROJECT "vtkRenderingFreeTypeOpenGL" IS_VTK_RENDER_FREETYPE_FOUND)
|
||||
if (NOT ${IS_VTK_RENDER_FREETYPE_FOUND} EQUAL -1)
|
||||
list (REMOVE_ITEM USED_TOOLKITS_BY_CURRENT_PROJECT "vtkRenderingFreeTypeOpenGL")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (BUILD_SHARED_LIBS OR EXECUTABLE_PROJECT)
|
||||
if(IS_VTK_9XX)
|
||||
string (REGEX REPLACE "vtk" "VTK::" USED_TOOLKITS_BY_CURRENT_PROJECT "${USED_TOOLKITS_BY_CURRENT_PROJECT}")
|
||||
endif()
|
||||
target_link_libraries (${PROJECT_NAME} ${USED_TOOLKITS_BY_CURRENT_PROJECT} ${USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT})
|
||||
endif()
|
||||
|
||||
if (USE_QT)
|
||||
foreach (PROJECT_LIBRARY_DEBUG ${PROJECT_LIBRARIES_DEBUG})
|
||||
target_link_libraries (${PROJECT_NAME} debug ${PROJECT_LIBRARY_DEBUG})
|
||||
endforeach()
|
||||
foreach (PROJECT_LIBRARY_RELEASE ${PROJECT_LIBRARIES_RELEASE})
|
||||
target_link_libraries (${PROJECT_NAME} optimized ${PROJECT_LIBRARY_RELEASE})
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
# suppress deprecation warnings inside OCCT itself for old gcc versions with unavailable Standard_DISABLE_DEPRECATION_WARNINGS
|
||||
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
|
||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6.0)
|
||||
add_definitions("-DOCCT_NO_DEPRECATED")
|
||||
message (STATUS "Warning: internal deprecation warnings by Standard_DEPRECATED have been disabled due to old gcc version being used")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# use Cotire to accelerate build via usage of precompiled headers
|
||||
if (BUILD_USE_PCH)
|
||||
if (WIN32)
|
||||
# prevent definition of min and max macros through inclusion of Windows.h
|
||||
# (for cotire builds)
|
||||
add_definitions("-DNOMINMAX")
|
||||
# avoid warnings on deprecated names from standard C library (see strsafe.h)
|
||||
add_definitions("-DSTRSAFE_NO_DEPRECATE")
|
||||
# avoid "std::Equal1" warning in QANCollection_Stl.cxx in debug mode
|
||||
# suggesting using msvc "Checked Iterators"
|
||||
add_definitions("-D_SCL_SECURE_NO_WARNINGS")
|
||||
endif()
|
||||
|
||||
# Exclude system-provided glext.h.
|
||||
# These macros are already defined within OpenGl_GlFunctions.hxx,
|
||||
# however we have to duplicate them here for building TKOpenGl with PCH.
|
||||
add_definitions("-DGL_GLEXT_LEGACY")
|
||||
add_definitions("-DGLX_GLXEXT_LEGACY")
|
||||
|
||||
# workaround for old gcc
|
||||
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
|
||||
add_definitions("-D__STDC_CONSTANT_MACROS")
|
||||
add_definitions("-D__STDC_FORMAT_MACROS")
|
||||
endif()
|
||||
|
||||
# unity builds are not used since they do not add speed but cause conflicts
|
||||
# in TKV3d
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE)
|
||||
|
||||
cotire(${PROJECT_NAME})
|
||||
endif()
|
||||
101
deps/OpenCSG/CMakeLists.txt.in
vendored
Normal file
101
deps/OpenCSG/CMakeLists.txt.in
vendored
Normal file
@@ -0,0 +1,101 @@
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
|
||||
project(OpenCSG)
|
||||
|
||||
if (NOT BUILD_SHARED_LIBS)
|
||||
set(GLEW_USE_STATIC_LIBS ON)
|
||||
elseif (MSVC)
|
||||
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
||||
endif()
|
||||
|
||||
find_package(OpenGL REQUIRED)
|
||||
|
||||
set(GLEW_VERBOSE ON)
|
||||
find_package(GLEW REQUIRED)
|
||||
|
||||
set(_srcfiles
|
||||
src/area.cpp
|
||||
src/batch.cpp
|
||||
src/context.cpp
|
||||
src/channelManager.cpp
|
||||
src/frameBufferObject.cpp
|
||||
src/frameBufferObjectExt.cpp
|
||||
src/occlusionQuery.cpp
|
||||
src/opencsgRender.cpp
|
||||
src/openglHelper.cpp
|
||||
src/pBufferTexture.cpp
|
||||
src/primitive.cpp
|
||||
src/primitiveHelper.cpp
|
||||
src/renderGoldfeather.cpp
|
||||
src/renderSCS.cpp
|
||||
src/scissorMemo.cpp
|
||||
src/settings.cpp
|
||||
src/stencilManager.cpp
|
||||
RenderTexture/RenderTexture.cpp
|
||||
include/opencsg.h
|
||||
src/opencsgConfig.h
|
||||
src/area.h
|
||||
src/batch.h
|
||||
src/context.h
|
||||
src/channelManager.h
|
||||
src/frameBufferObject.h
|
||||
src/frameBufferObjectExt.h
|
||||
src/occlusionQuery.h
|
||||
src/offscreenBuffer.h
|
||||
src/opencsgRender.h
|
||||
src/openglHelper.h
|
||||
src/pBufferTexture.h
|
||||
src/primitiveHelper.h
|
||||
src/scissorMemo.h
|
||||
src/settings.h
|
||||
src/stencilManager.h
|
||||
)
|
||||
|
||||
add_library(opencsg ${_srcfiles})
|
||||
target_include_directories(opencsg PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>)
|
||||
target_include_directories(opencsg PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>)
|
||||
target_link_libraries(opencsg PRIVATE GLEW::GLEW OpenGL::GL)
|
||||
|
||||
include(CMakePackageConfigHelpers)
|
||||
|
||||
include(GNUInstallDirs)
|
||||
|
||||
write_basic_package_version_file(
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
|
||||
VERSION 1.4.2
|
||||
COMPATIBILITY AnyNewerVersion
|
||||
)
|
||||
|
||||
install(TARGETS opencsg
|
||||
EXPORT ${PROJECT_NAME}Targets
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
||||
|
||||
export(EXPORT ${PROJECT_NAME}Targets
|
||||
FILE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
|
||||
NAMESPACE ${PROJECT_NAME}:: )
|
||||
|
||||
set(ConfigPackageLocation ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
|
||||
|
||||
install(EXPORT ${PROJECT_NAME}Targets
|
||||
FILE
|
||||
"${PROJECT_NAME}Config.cmake"
|
||||
NAMESPACE
|
||||
${PROJECT_NAME}::
|
||||
DESTINATION
|
||||
${ConfigPackageLocation}
|
||||
)
|
||||
install(
|
||||
FILES
|
||||
${PROJECT_SOURCE_DIR}/include/opencsg.h
|
||||
DESTINATION
|
||||
${CMAKE_INSTALL_INCLUDEDIR}/opencsg
|
||||
)
|
||||
install(
|
||||
FILES
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
|
||||
DESTINATION
|
||||
${ConfigPackageLocation}
|
||||
)
|
||||
17
deps/OpenCSG/OpenCSG.cmake
vendored
Normal file
17
deps/OpenCSG/OpenCSG.cmake
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
qidislicer_add_cmake_project(OpenCSG
|
||||
# GIT_REPOSITORY https://github.com/floriankirsch/OpenCSG.git
|
||||
# GIT_TAG 83e274457b46c9ad11a4ee599203250b1618f3b9 #v1.4.2
|
||||
URL https://github.com/floriankirsch/OpenCSG/archive/refs/tags/opencsg-1-4-2-release.zip
|
||||
URL_HASH SHA256=51afe0db79af8386e2027d56d685177135581e0ee82ade9d7f2caff8deab5ec5
|
||||
PATCH_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt.in ./CMakeLists.txt
|
||||
DEPENDS dep_GLEW
|
||||
)
|
||||
|
||||
if (TARGET ${ZLIB_PKG})
|
||||
add_dependencies(dep_OpenCSG ${ZLIB_PKG})
|
||||
endif()
|
||||
|
||||
if (MSVC)
|
||||
add_debug_dep(dep_OpenCSG)
|
||||
endif ()
|
||||
17
deps/OpenEXR/OpenEXR.cmake
vendored
Normal file
17
deps/OpenEXR/OpenEXR.cmake
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
qidislicer_add_cmake_project(OpenEXR
|
||||
# GIT_REPOSITORY https://github.com/openexr/openexr.git
|
||||
URL https://github.com/AcademySoftwareFoundation/openexr/archive/refs/tags/v2.5.5.zip
|
||||
URL_HASH SHA256=0307a3d7e1fa1e77e9d84d7e9a8694583fbbbfd50bdc6884e2c96b8ef6b902de
|
||||
DEPENDS ${ZLIB_PKG}
|
||||
GIT_TAG v2.5.5
|
||||
CMAKE_ARGS
|
||||
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
|
||||
-DBUILD_TESTING=OFF
|
||||
-DPYILMBASE_ENABLE:BOOL=OFF
|
||||
-DOPENEXR_VIEWERS_ENABLE:BOOL=OFF
|
||||
-DOPENEXR_BUILD_UTILS:BOOL=OFF
|
||||
)
|
||||
|
||||
if (MSVC)
|
||||
add_debug_dep(dep_OpenEXR)
|
||||
endif ()
|
||||
35
deps/OpenSSL/OpenSSL.cmake
vendored
Normal file
35
deps/OpenSSL/OpenSSL.cmake
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
|
||||
include(ProcessorCount)
|
||||
ProcessorCount(NPROC)
|
||||
|
||||
set(_conf_cmd "./config")
|
||||
set(_cross_arch "")
|
||||
set(_cross_comp_prefix_line "")
|
||||
if (CMAKE_CROSSCOMPILING)
|
||||
set(_conf_cmd "./Configure")
|
||||
set(_cross_comp_prefix_line "--cross-compile-prefix=${TOOLCHAIN_PREFIX}-")
|
||||
|
||||
if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64" OR ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "arm64")
|
||||
set(_cross_arch "linux-aarch64")
|
||||
elseif (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "armhf") # For raspbian
|
||||
# TODO: verify
|
||||
set(_cross_arch "linux-armv4")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
ExternalProject_Add(dep_OpenSSL
|
||||
EXCLUDE_FROM_ALL ON
|
||||
URL "https://github.com/openssl/openssl/archive/OpenSSL_1_1_0l.tar.gz"
|
||||
URL_HASH SHA256=e2acf0cf58d9bff2b42f2dc0aee79340c8ffe2c5e45d3ca4533dd5d4f5775b1d
|
||||
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/OpenSSL
|
||||
BUILD_IN_SOURCE ON
|
||||
CONFIGURE_COMMAND ${_conf_cmd} ${_cross_arch}
|
||||
"--prefix=${DESTDIR}/usr/local"
|
||||
${_cross_comp_prefix_line}
|
||||
no-shared
|
||||
no-ssl3-method
|
||||
no-dynamic-engine
|
||||
-Wa,--noexecstack
|
||||
BUILD_COMMAND make depend && make "-j${NPROC}"
|
||||
INSTALL_COMMAND make install_sw
|
||||
)
|
||||
44
deps/OpenVDB/OpenVDB.cmake
vendored
Normal file
44
deps/OpenVDB/OpenVDB.cmake
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
if(BUILD_SHARED_LIBS)
|
||||
set(_build_shared ON)
|
||||
set(_build_static OFF)
|
||||
else()
|
||||
set(_build_shared OFF)
|
||||
set(_build_static ON)
|
||||
endif()
|
||||
|
||||
set (_openvdb_vdbprint ON)
|
||||
if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm")
|
||||
# Build fails on raspberry pi due to missing link directive to latomic
|
||||
# Let's hope it will be fixed soon.
|
||||
set (_openvdb_vdbprint OFF)
|
||||
endif ()
|
||||
|
||||
qidislicer_add_cmake_project(OpenVDB
|
||||
# 8.2 patched
|
||||
URL https://github.com/tamasmeszaros/openvdb/archive/a68fd58d0e2b85f01adeb8b13d7555183ab10aa5.zip
|
||||
URL_HASH SHA256=f353e7b99bd0cbfc27ac9082de51acf32a8bc0b3e21ff9661ecca6f205ec1d81
|
||||
DEPENDS dep_TBB dep_Blosc dep_OpenEXR dep_Boost
|
||||
CMAKE_ARGS
|
||||
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
|
||||
-DOPENVDB_BUILD_PYTHON_MODULE=OFF
|
||||
-DUSE_BLOSC=ON
|
||||
-DOPENVDB_CORE_SHARED=${_build_shared}
|
||||
-DOPENVDB_CORE_STATIC=${_build_static}
|
||||
-DOPENVDB_ENABLE_RPATH:BOOL=OFF
|
||||
-DTBB_STATIC=${_build_static}
|
||||
-DOPENVDB_BUILD_VDB_PRINT=${_openvdb_vdbprint}
|
||||
-DDISABLE_DEPENDENCY_VERSION_CHECKS=ON # Centos6 has old zlib
|
||||
)
|
||||
|
||||
if (MSVC)
|
||||
if (${DEP_DEBUG})
|
||||
ExternalProject_Get_Property(dep_OpenVDB BINARY_DIR)
|
||||
ExternalProject_Add_Step(dep_OpenVDB build_debug
|
||||
DEPENDEES build
|
||||
DEPENDERS install
|
||||
COMMAND ${CMAKE_COMMAND} ../dep_OpenVDB -DOPENVDB_BUILD_VDB_PRINT=OFF
|
||||
COMMAND msbuild /m /P:Configuration=Debug INSTALL.vcxproj
|
||||
WORKING_DIRECTORY "${BINARY_DIR}"
|
||||
)
|
||||
endif ()
|
||||
endif ()
|
||||
31
deps/PNG/PNG.cmake
vendored
Normal file
31
deps/PNG/PNG.cmake
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
if (APPLE)
|
||||
# Only disable NEON extension for Apple ARM builds, leave it enabled for Raspberry PI.
|
||||
set(_disable_neon_extension "-DPNG_ARM_NEON=off")
|
||||
else ()
|
||||
set(_disable_neon_extension "")
|
||||
endif ()
|
||||
|
||||
set(_patch_step "")
|
||||
if (APPLE)
|
||||
set(_patch_step PATCH_COMMAND ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/PNG.patch)
|
||||
endif ()
|
||||
|
||||
qidislicer_add_cmake_project(PNG
|
||||
# GIT_REPOSITORY https://github.com/glennrp/libpng.git
|
||||
# GIT_TAG v1.6.35
|
||||
URL https://github.com/glennrp/libpng/archive/refs/tags/v1.6.35.zip
|
||||
URL_HASH SHA256=3d22d46c566b1761a0e15ea397589b3a5f36ac09b7c785382e6470156c04247f
|
||||
DEPENDS ${ZLIB_PKG}
|
||||
"${_patch_step}"
|
||||
CMAKE_ARGS
|
||||
-DPNG_SHARED=OFF
|
||||
-DPNG_STATIC=ON
|
||||
-DPNG_PREFIX=qidislicer_
|
||||
-DPNG_TESTS=OFF
|
||||
-DDISABLE_DEPENDENCY_TRACKING=OFF
|
||||
${_disable_neon_extension}
|
||||
)
|
||||
|
||||
if (MSVC)
|
||||
add_debug_dep(dep_PNG)
|
||||
endif ()
|
||||
26
deps/PNG/PNG.patch
vendored
Normal file
26
deps/PNG/PNG.patch
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
Common subdirectories: ../libpng-1.6.35-orig/arm and ./arm
|
||||
Common subdirectories: ../libpng-1.6.35-orig/contrib and ./contrib
|
||||
Common subdirectories: ../libpng-1.6.35-orig/intel and ./intel
|
||||
Common subdirectories: ../libpng-1.6.35-orig/mips and ./mips
|
||||
Only in ./: PNG.patch
|
||||
diff -u ../libpng-1.6.35-orig/pngrutil.c ./pngrutil.c
|
||||
--- ../libpng-1.6.35-orig/pngrutil.c 2018-07-15 20:58:00.000000000 +0200
|
||||
+++ ./pngrutil.c 2021-03-24 15:59:38.687108444 +0100
|
||||
@@ -422,13 +422,6 @@
|
||||
png_ptr->flags |= PNG_FLAG_ZSTREAM_INITIALIZED;
|
||||
}
|
||||
|
||||
-#if ZLIB_VERNUM >= 0x1290 && \
|
||||
- defined(PNG_SET_OPTION_SUPPORTED) && defined(PNG_IGNORE_ADLER32)
|
||||
- if (((png_ptr->options >> PNG_IGNORE_ADLER32) & 3) == PNG_OPTION_ON)
|
||||
- /* Turn off validation of the ADLER32 checksum in IDAT chunks */
|
||||
- ret = inflateValidate(&png_ptr->zstream, 0);
|
||||
-#endif
|
||||
-
|
||||
if (ret == Z_OK)
|
||||
png_ptr->zowner = owner;
|
||||
|
||||
Common subdirectories: ../libpng-1.6.35-orig/powerpc and ./powerpc
|
||||
Common subdirectories: ../libpng-1.6.35-orig/projects and ./projects
|
||||
Common subdirectories: ../libpng-1.6.35-orig/scripts and ./scripts
|
||||
Common subdirectories: ../libpng-1.6.35-orig/tests and ./tests
|
||||
11
deps/Qhull/Qhull.cmake
vendored
Normal file
11
deps/Qhull/Qhull.cmake
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
include(GNUInstallDirs)
|
||||
qidislicer_add_cmake_project(Qhull
|
||||
URL "https://github.com/qhull/qhull/archive/v8.0.1.zip"
|
||||
URL_HASH SHA256=5287f5edd6a0372588f5d6640799086a4033d89d19711023ef8229dd9301d69b
|
||||
CMAKE_ARGS
|
||||
-DINCLUDE_INSTALL_DIR=${CMAKE_INSTALL_INCLUDEDIR}
|
||||
)
|
||||
|
||||
if (MSVC)
|
||||
add_debug_dep(dep_Qhull)
|
||||
endif ()
|
||||
16
deps/TBB/TBB.cmake
vendored
Normal file
16
deps/TBB/TBB.cmake
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
qidislicer_add_cmake_project(
|
||||
TBB
|
||||
URL "https://github.com/oneapi-src/oneTBB/archive/refs/tags/v2021.5.0.zip"
|
||||
URL_HASH SHA256=83ea786c964a384dd72534f9854b419716f412f9d43c0be88d41874763e7bb47
|
||||
CMAKE_ARGS
|
||||
-DTBB_BUILD_SHARED=OFF
|
||||
-DTBB_TEST=OFF
|
||||
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
|
||||
-DCMAKE_DEBUG_POSTFIX=_debug
|
||||
)
|
||||
|
||||
if (MSVC)
|
||||
add_debug_dep(dep_TBB)
|
||||
endif ()
|
||||
|
||||
|
||||
13
deps/TIFF/TIFF.cmake
vendored
Normal file
13
deps/TIFF/TIFF.cmake
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
find_package(OpenGL QUIET REQUIRED)
|
||||
|
||||
qidislicer_add_cmake_project(TIFF
|
||||
URL https://gitlab.com/libtiff/libtiff/-/archive/v4.1.0/libtiff-v4.1.0.zip
|
||||
URL_HASH SHA256=c56edfacef0a60c0de3e6489194fcb2f24c03dbb550a8a7de5938642d045bd32
|
||||
DEPENDS ${ZLIB_PKG} ${PNG_PKG} dep_JPEG
|
||||
CMAKE_ARGS
|
||||
-Dlzma:BOOL=OFF
|
||||
-Dwebp:BOOL=OFF
|
||||
-Djbig:BOOL=OFF
|
||||
-Dzstd:BOOL=OFF
|
||||
-Dpixarlog:BOOL=OFF
|
||||
)
|
||||
35006
deps/WebView2/include/WebView2.h
vendored
Normal file
35006
deps/WebView2/include/WebView2.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
149
deps/WebView2/include/WebView2EnvironmentOptions.h
vendored
Normal file
149
deps/WebView2/include/WebView2EnvironmentOptions.h
vendored
Normal file
@@ -0,0 +1,149 @@
|
||||
// Copyright (C) Microsoft Corporation. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef __core_webview2_environment_options_h__
|
||||
#define __core_webview2_environment_options_h__
|
||||
|
||||
#include <objbase.h>
|
||||
#include <wrl/implements.h>
|
||||
|
||||
#include "webview2.h"
|
||||
#define CORE_WEBVIEW_TARGET_PRODUCT_VERSION L"107.0.1418.22"
|
||||
|
||||
#define COREWEBVIEW2ENVIRONMENTOPTIONS_STRING_PROPERTY(p) \
|
||||
public: \
|
||||
HRESULT STDMETHODCALLTYPE get_##p(LPWSTR* value) override { \
|
||||
if (!value) \
|
||||
return E_POINTER; \
|
||||
*value = m_##p.Copy(); \
|
||||
if ((*value == nullptr) && (m_##p.Get() != nullptr)) \
|
||||
return HRESULT_FROM_WIN32(GetLastError()); \
|
||||
return S_OK; \
|
||||
} \
|
||||
HRESULT STDMETHODCALLTYPE put_##p(LPCWSTR value) override { \
|
||||
LPCWSTR result = m_##p.Set(value); \
|
||||
if ((result == nullptr) && (value != nullptr)) \
|
||||
return HRESULT_FROM_WIN32(GetLastError()); \
|
||||
return S_OK; \
|
||||
} \
|
||||
\
|
||||
protected: \
|
||||
AutoCoMemString m_##p;
|
||||
|
||||
#define COREWEBVIEW2ENVIRONMENTOPTIONS_BOOL_PROPERTY(p) \
|
||||
public: \
|
||||
HRESULT STDMETHODCALLTYPE get_##p(BOOL* value) override { \
|
||||
if (!value) \
|
||||
return E_POINTER; \
|
||||
*value = m_##p; \
|
||||
return S_OK; \
|
||||
} \
|
||||
HRESULT STDMETHODCALLTYPE put_##p(BOOL value) override { \
|
||||
m_##p = value; \
|
||||
return S_OK; \
|
||||
} \
|
||||
\
|
||||
protected: \
|
||||
BOOL m_##p = FALSE;
|
||||
|
||||
// This is a base COM class that implements ICoreWebView2EnvironmentOptions.
|
||||
template <typename allocate_fn_t,
|
||||
allocate_fn_t allocate_fn,
|
||||
typename deallocate_fn_t,
|
||||
deallocate_fn_t deallocate_fn>
|
||||
class CoreWebView2EnvironmentOptionsBase
|
||||
: public Microsoft::WRL::Implements<
|
||||
Microsoft::WRL::RuntimeClassFlags<Microsoft::WRL::ClassicCom>,
|
||||
ICoreWebView2EnvironmentOptions,
|
||||
ICoreWebView2EnvironmentOptions2> {
|
||||
public:
|
||||
CoreWebView2EnvironmentOptionsBase() {
|
||||
// Initialize the target compatible browser version value to the version of
|
||||
// the browser binaries corresponding to this version of the SDK.
|
||||
m_TargetCompatibleBrowserVersion.Set(CORE_WEBVIEW_TARGET_PRODUCT_VERSION);
|
||||
}
|
||||
|
||||
protected:
|
||||
~CoreWebView2EnvironmentOptionsBase() {}
|
||||
|
||||
class AutoCoMemString {
|
||||
public:
|
||||
AutoCoMemString() {}
|
||||
~AutoCoMemString() { Release(); }
|
||||
void Release() {
|
||||
if (m_string) {
|
||||
deallocate_fn(m_string);
|
||||
m_string = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
LPCWSTR Set(LPCWSTR str) {
|
||||
Release();
|
||||
if (str) {
|
||||
m_string = MakeCoMemString(str);
|
||||
}
|
||||
return m_string;
|
||||
}
|
||||
LPCWSTR Get() { return m_string; }
|
||||
LPWSTR Copy() {
|
||||
if (m_string)
|
||||
return MakeCoMemString(m_string);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
protected:
|
||||
LPWSTR MakeCoMemString(LPCWSTR source) {
|
||||
const size_t length = wcslen(source);
|
||||
const size_t bytes = (length + 1) * sizeof(*source);
|
||||
// Ensure we didn't overflow during our size calculation.
|
||||
if (bytes <= length) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
wchar_t* result = reinterpret_cast<wchar_t*>(allocate_fn(bytes));
|
||||
if (result)
|
||||
memcpy(result, source, bytes);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
LPWSTR m_string = nullptr;
|
||||
};
|
||||
|
||||
// ICoreWebView2EnvironmentOptions
|
||||
COREWEBVIEW2ENVIRONMENTOPTIONS_STRING_PROPERTY(AdditionalBrowserArguments)
|
||||
COREWEBVIEW2ENVIRONMENTOPTIONS_STRING_PROPERTY(Language)
|
||||
COREWEBVIEW2ENVIRONMENTOPTIONS_STRING_PROPERTY(TargetCompatibleBrowserVersion)
|
||||
COREWEBVIEW2ENVIRONMENTOPTIONS_BOOL_PROPERTY(
|
||||
AllowSingleSignOnUsingOSPrimaryAccount)
|
||||
|
||||
// ICoreWebView2EnvironmentOptions2
|
||||
COREWEBVIEW2ENVIRONMENTOPTIONS_BOOL_PROPERTY(ExclusiveUserDataFolderAccess)
|
||||
};
|
||||
|
||||
template <typename allocate_fn_t,
|
||||
allocate_fn_t allocate_fn,
|
||||
typename deallocate_fn_t,
|
||||
deallocate_fn_t deallocate_fn>
|
||||
class CoreWebView2EnvironmentOptionsBaseClass
|
||||
: public Microsoft::WRL::RuntimeClass<
|
||||
Microsoft::WRL::RuntimeClassFlags<Microsoft::WRL::ClassicCom>,
|
||||
CoreWebView2EnvironmentOptionsBase<allocate_fn_t,
|
||||
allocate_fn,
|
||||
deallocate_fn_t,
|
||||
deallocate_fn>> {
|
||||
public:
|
||||
CoreWebView2EnvironmentOptionsBaseClass() {}
|
||||
|
||||
protected:
|
||||
~CoreWebView2EnvironmentOptionsBaseClass() override {}
|
||||
};
|
||||
|
||||
typedef CoreWebView2EnvironmentOptionsBaseClass<decltype(&::CoTaskMemAlloc),
|
||||
::CoTaskMemAlloc,
|
||||
decltype(&::CoTaskMemFree),
|
||||
::CoTaskMemFree>
|
||||
CoreWebView2EnvironmentOptions;
|
||||
|
||||
#endif // __core_webview2_environment_options_h__
|
||||
51
deps/ZLIB/0001-Respect-BUILD_SHARED_LIBS.patch
vendored
Normal file
51
deps/ZLIB/0001-Respect-BUILD_SHARED_LIBS.patch
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
Common subdirectories: ../zlib-1.2.11/amiga and ./amiga
|
||||
diff -u ../zlib-1.2.11/CMakeLists.txt ./CMakeLists.txt
|
||||
--- ../zlib-1.2.11/CMakeLists.txt 2017-01-15 09:29:40.000000000 +0100
|
||||
+++ ./CMakeLists.txt 2021-03-24 15:24:48.190291072 +0100
|
||||
@@ -183,10 +183,12 @@
|
||||
set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj)
|
||||
endif(MINGW)
|
||||
|
||||
-add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
|
||||
-add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
|
||||
-set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL)
|
||||
-set_target_properties(zlib PROPERTIES SOVERSION 1)
|
||||
+add_library(zlib ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
|
||||
+if (BUILD_SHARED_LIBS)
|
||||
+ target_sources(zlib PRIVATE ${ZLIB_DLL_SRCS})
|
||||
+ set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL)
|
||||
+ set_target_properties(zlib PROPERTIES SOVERSION 1)
|
||||
+endif()
|
||||
|
||||
if(NOT CYGWIN)
|
||||
# This property causes shared libraries on Linux to have the full version
|
||||
@@ -201,7 +203,7 @@
|
||||
|
||||
if(UNIX)
|
||||
# On unix-like platforms the library is almost always called libz
|
||||
- set_target_properties(zlib zlibstatic PROPERTIES OUTPUT_NAME z)
|
||||
+ set_target_properties(zlib PROPERTIES OUTPUT_NAME z)
|
||||
if(NOT APPLE)
|
||||
set_target_properties(zlib PROPERTIES LINK_FLAGS "-Wl,--version-script,\"${CMAKE_CURRENT_SOURCE_DIR}/zlib.map\"")
|
||||
endif()
|
||||
@@ -211,7 +213,7 @@
|
||||
endif()
|
||||
|
||||
if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL )
|
||||
- install(TARGETS zlib zlibstatic
|
||||
+ install(TARGETS zlib
|
||||
RUNTIME DESTINATION "${INSTALL_BIN_DIR}"
|
||||
ARCHIVE DESTINATION "${INSTALL_LIB_DIR}"
|
||||
LIBRARY DESTINATION "${INSTALL_LIB_DIR}" )
|
||||
Common subdirectories: ../zlib-1.2.11/contrib and ./contrib
|
||||
Common subdirectories: ../zlib-1.2.11/doc and ./doc
|
||||
Common subdirectories: ../zlib-1.2.11/examples and ./examples
|
||||
Common subdirectories: ../zlib-1.2.11/msdos and ./msdos
|
||||
Common subdirectories: ../zlib-1.2.11/nintendods and ./nintendods
|
||||
Common subdirectories: ../zlib-1.2.11/old and ./old
|
||||
Common subdirectories: ../zlib-1.2.11/os400 and ./os400
|
||||
Common subdirectories: ../zlib-1.2.11/qnx and ./qnx
|
||||
Common subdirectories: ../zlib-1.2.11/test and ./test
|
||||
Common subdirectories: ../zlib-1.2.11/watcom and ./watcom
|
||||
Common subdirectories: ../zlib-1.2.11/win32 and ./win32
|
||||
Only in ./: ZLIB.patch
|
||||
11
deps/ZLIB/ZLIB.cmake
vendored
Normal file
11
deps/ZLIB/ZLIB.cmake
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
qidislicer_add_cmake_project(ZLIB
|
||||
# GIT_REPOSITORY https://github.com/madler/zlib.git
|
||||
# GIT_TAG v1.2.11
|
||||
URL https://github.com/madler/zlib/archive/refs/tags/v1.2.11.zip
|
||||
URL_HASH SHA256=f5cc4ab910db99b2bdbba39ebbdc225ffc2aa04b4057bc2817f1b94b6978cfc3
|
||||
PATCH_COMMAND ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/0001-Respect-BUILD_SHARED_LIBS.patch
|
||||
CMAKE_ARGS
|
||||
-DSKIP_INSTALL_FILES=ON # Prevent installation of man pages et al.
|
||||
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
|
||||
)
|
||||
|
||||
10
deps/deps-linux.cmake
vendored
Normal file
10
deps/deps-linux.cmake
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
|
||||
set(DEP_CMAKE_OPTS "-DCMAKE_POSITION_INDEPENDENT_CODE=ON")
|
||||
|
||||
include("deps-unix-common.cmake")
|
||||
|
||||
# Some Linuxes may have very old libpng, so it's best to bundle it instead of relying on the system version.
|
||||
# find_package(PNG QUIET)
|
||||
# if (NOT PNG_FOUND)
|
||||
# message(WARNING "No PNG dev package found in system, building static library. You should install the system package.")
|
||||
# endif ()
|
||||
96
deps/deps-macos.cmake
vendored
Normal file
96
deps/deps-macos.cmake
vendored
Normal file
@@ -0,0 +1,96 @@
|
||||
|
||||
# This ensures dependencies don't use SDK features which are not available in the version specified by Deployment target
|
||||
# That can happen when one uses a recent SDK but specifies an older Deployment target
|
||||
set(DEP_WERRORS_SDK "-Werror=partial-availability -Werror=unguarded-availability -Werror=unguarded-availability-new")
|
||||
|
||||
set(DEP_CMAKE_OPTS
|
||||
"-DCMAKE_POSITION_INDEPENDENT_CODE=ON"
|
||||
"-DCMAKE_OSX_SYSROOT=${CMAKE_OSX_SYSROOT}"
|
||||
"-DCMAKE_OSX_DEPLOYMENT_TARGET=${DEP_OSX_TARGET}"
|
||||
"-DCMAKE_CXX_FLAGS=${DEP_WERRORS_SDK}"
|
||||
"-DCMAKE_C_FLAGS=${DEP_WERRORS_SDK}"
|
||||
"-DCMAKE_FIND_FRAMEWORK=LAST"
|
||||
"-DCMAKE_FIND_APPBUNDLE=LAST"
|
||||
)
|
||||
|
||||
include("deps-unix-common.cmake")
|
||||
|
||||
find_package(CURL QUIET)
|
||||
if (NOT CURL_FOUND)
|
||||
message(WARNING "No CURL dev package found in system, building static library. Mac SDK should include CURL from at least version 10.12. Check your SDK installation.")
|
||||
endif ()
|
||||
|
||||
|
||||
# ExternalProject_Add(dep_boost
|
||||
# EXCLUDE_FROM_ALL 1
|
||||
# URL "https://dl.bintray.com/boostorg/release/1.75.0/source/boost_1_75_0.tar.gz"
|
||||
# URL_HASH SHA256=aeb26f80e80945e82ee93e5939baebdca47b9dee80a07d3144be1e1a6a66dd6a
|
||||
# BUILD_IN_SOURCE 1
|
||||
# CONFIGURE_COMMAND ./bootstrap.sh
|
||||
# --with-toolset=clang
|
||||
# --with-libraries=system,iostreams,filesystem,thread,log,locale,regex,date_time
|
||||
# "--prefix=${DESTDIR}/usr/local"
|
||||
# BUILD_COMMAND ./b2
|
||||
# -j ${NPROC}
|
||||
# --reconfigure
|
||||
# toolset=clang
|
||||
# link=static
|
||||
# variant=release
|
||||
# threading=multi
|
||||
# boost.locale.icu=off
|
||||
# --disable-icu
|
||||
# "cflags=-fPIC -mmacosx-version-min=${DEP_OSX_TARGET}"
|
||||
# "cxxflags=-fPIC -mmacosx-version-min=${DEP_OSX_TARGET}"
|
||||
# "mflags=-fPIC -mmacosx-version-min=${DEP_OSX_TARGET}"
|
||||
# "mmflags=-fPIC -mmacosx-version-min=${DEP_OSX_TARGET}"
|
||||
# install
|
||||
# INSTALL_COMMAND "" # b2 does that already
|
||||
# )
|
||||
|
||||
# ExternalProject_Add(dep_libcurl
|
||||
# EXCLUDE_FROM_ALL 1
|
||||
# URL "https://curl.haxx.se/download/curl-7.58.0.tar.gz"
|
||||
# URL_HASH SHA256=cc245bf9a1a42a45df491501d97d5593392a03f7b4f07b952793518d97666115
|
||||
# BUILD_IN_SOURCE 1
|
||||
# CONFIGURE_COMMAND ./configure
|
||||
# --enable-static
|
||||
# --disable-shared
|
||||
# "--with-ssl=${DESTDIR}/usr/local"
|
||||
# --with-pic
|
||||
# --enable-ipv6
|
||||
# --enable-versioned-symbols
|
||||
# --enable-threaded-resolver
|
||||
# --with-darwinssl
|
||||
# --without-ssl # disables OpenSSL
|
||||
# --disable-ldap
|
||||
# --disable-ldaps
|
||||
# --disable-manual
|
||||
# --disable-rtsp
|
||||
# --disable-dict
|
||||
# --disable-telnet
|
||||
# --disable-pop3
|
||||
# --disable-imap
|
||||
# --disable-smb
|
||||
# --disable-smtp
|
||||
# --disable-gopher
|
||||
# --without-gssapi
|
||||
# --without-libpsl
|
||||
# --without-libidn2
|
||||
# --without-gnutls
|
||||
# --without-polarssl
|
||||
# --without-mbedtls
|
||||
# --without-cyassl
|
||||
# --without-nss
|
||||
# --without-axtls
|
||||
# --without-brotli
|
||||
# --without-libmetalink
|
||||
# --without-libssh
|
||||
# --without-libssh2
|
||||
# --without-librtmp
|
||||
# --without-nghttp2
|
||||
# --without-zsh-functions-dir
|
||||
# BUILD_COMMAND make "-j${NPROC}"
|
||||
# INSTALL_COMMAND make install "DESTDIR=${DESTDIR}"
|
||||
# )
|
||||
|
||||
# add_dependencies(dep_openvdb dep_boost)
|
||||
8
deps/deps-mingw.cmake
vendored
Normal file
8
deps/deps-mingw.cmake
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
set(DEP_CMAKE_OPTS "-DCMAKE_POSITION_INDEPENDENT_CODE=ON")
|
||||
set(DEP_BOOST_TOOLSET "gcc")
|
||||
set(DEP_BITS 64)
|
||||
|
||||
find_package(Git REQUIRED)
|
||||
|
||||
# TODO make sure to build tbb with -flifetime-dse=1
|
||||
include("deps-unix-common.cmake")
|
||||
19
deps/deps-unix-common.cmake
vendored
Normal file
19
deps/deps-unix-common.cmake
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
|
||||
# The unix common part expects DEP_CMAKE_OPTS to be set
|
||||
|
||||
if (MINGW)
|
||||
set(TBB_MINGW_WORKAROUND "-flifetime-dse=1")
|
||||
else ()
|
||||
set(TBB_MINGW_WORKAROUND "")
|
||||
endif ()
|
||||
|
||||
find_package(ZLIB QUIET)
|
||||
if (NOT ZLIB_FOUND)
|
||||
message(WARNING "No ZLIB dev package found in system, building static library. You should install the system package.")
|
||||
endif ()
|
||||
|
||||
# TODO Evaluate expat modifications in the bundled version and test with system versions in various distros and OSX SDKs
|
||||
# find_package(EXPAT QUIET)
|
||||
# if (NOT EXPAT_FOUND)
|
||||
# message(WARNING "No EXPAT dev package found in system, building static library. Consider installing the system package.")
|
||||
# endif ()
|
||||
68
deps/deps-windows.cmake
vendored
Normal file
68
deps/deps-windows.cmake
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
# https://cmake.org/cmake/help/latest/variable/MSVC_VERSION.html
|
||||
if (MSVC_VERSION EQUAL 1800)
|
||||
# 1800 = VS 12.0 (v120 toolset)
|
||||
set(DEP_VS_VER "12")
|
||||
set(DEP_BOOST_TOOLSET "msvc-12.0")
|
||||
elseif (MSVC_VERSION EQUAL 1900)
|
||||
# 1900 = VS 14.0 (v140 toolset)
|
||||
set(DEP_VS_VER "14")
|
||||
set(DEP_BOOST_TOOLSET "msvc-14.0")
|
||||
elseif (MSVC_VERSION LESS 1920)
|
||||
# 1910-1919 = VS 15.0 (v141 toolset)
|
||||
set(DEP_VS_VER "15")
|
||||
set(DEP_BOOST_TOOLSET "msvc-14.1")
|
||||
elseif (MSVC_VERSION LESS 1930)
|
||||
# 1920-1929 = VS 16.0 (v142 toolset)
|
||||
set(DEP_VS_VER "16")
|
||||
set(DEP_BOOST_TOOLSET "msvc-14.2")
|
||||
elseif (MSVC_VERSION LESS 1940)
|
||||
# 1930-1939 = VS 17.0 (v143 toolset)
|
||||
set(DEP_VS_VER "17")
|
||||
set(DEP_BOOST_TOOLSET "msvc-14.3")
|
||||
else ()
|
||||
message(FATAL_ERROR "Unsupported MSVC version")
|
||||
endif ()
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL Clang)
|
||||
set(DEP_BOOST_TOOLSET "clang-win")
|
||||
endif ()
|
||||
|
||||
if (${DEPS_BITS} EQUAL 32)
|
||||
set(DEP_MSVC_GEN "Visual Studio ${DEP_VS_VER}")
|
||||
set(DEP_PLATFORM "Win32")
|
||||
else ()
|
||||
if (DEP_VS_VER LESS 16)
|
||||
set(DEP_MSVC_GEN "Visual Studio ${DEP_VS_VER} Win64")
|
||||
else ()
|
||||
set(DEP_MSVC_GEN "Visual Studio ${DEP_VS_VER}")
|
||||
endif ()
|
||||
set(DEP_PLATFORM "x64")
|
||||
endif ()
|
||||
|
||||
if (${DEP_DEBUG})
|
||||
set(DEP_BOOST_DEBUG "debug")
|
||||
else ()
|
||||
set(DEP_BOOST_DEBUG "")
|
||||
endif ()
|
||||
|
||||
macro(add_debug_dep _dep)
|
||||
if (${DEP_DEBUG})
|
||||
ExternalProject_Get_Property(${_dep} BINARY_DIR)
|
||||
ExternalProject_Add_Step(${_dep} build_debug
|
||||
DEPENDEES build
|
||||
DEPENDERS install
|
||||
COMMAND msbuild /m /P:Configuration=Debug INSTALL.vcxproj
|
||||
WORKING_DIRECTORY "${BINARY_DIR}"
|
||||
)
|
||||
endif ()
|
||||
endmacro()
|
||||
|
||||
if (${DEPS_BITS} EQUAL 32)
|
||||
set(DEP_WXWIDGETS_TARGET "")
|
||||
set(DEP_WXWIDGETS_LIBDIR "vc_lib")
|
||||
else ()
|
||||
set(DEP_WXWIDGETS_TARGET "TARGET_CPU=X64")
|
||||
set(DEP_WXWIDGETS_LIBDIR "vc_x64_lib")
|
||||
endif ()
|
||||
|
||||
find_package(Git REQUIRED)
|
||||
46
deps/wxWidgets/wxWidgets.cmake
vendored
Normal file
46
deps/wxWidgets/wxWidgets.cmake
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
set(_wx_toolkit "")
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
set(_gtk_ver 2)
|
||||
if (DEP_WX_GTK3)
|
||||
set(_gtk_ver 3)
|
||||
endif ()
|
||||
set(_wx_toolkit "-DwxBUILD_TOOLKIT=gtk${_gtk_ver}")
|
||||
endif()
|
||||
|
||||
set(_unicode_utf8 OFF)
|
||||
if (UNIX AND NOT APPLE) # wxWidgets will not use char as the underlying type for wxString unless its forced to.
|
||||
set (_unicode_utf8 ON)
|
||||
endif()
|
||||
|
||||
qidislicer_add_cmake_project(wxWidgets
|
||||
URL https://github.com/qidi3d/wxWidgets/archive/0b49beaacce17d90f0c370ecd73221abd089667a.zip
|
||||
URL_HASH SHA256=8fa978a76d6bd811b30eecc5124186b9ad54290b820f3a354e85bfa9dae6a5ce
|
||||
DEPENDS ${PNG_PKG} ${ZLIB_PKG} ${EXPAT_PKG} dep_TIFF dep_JPEG dep_NanoSVG
|
||||
CMAKE_ARGS
|
||||
-DwxBUILD_PRECOMP=ON
|
||||
${_wx_toolkit}
|
||||
"-DCMAKE_DEBUG_POSTFIX:STRING="
|
||||
-DwxBUILD_DEBUG_LEVEL=0
|
||||
-DwxUSE_MEDIACTRL=OFF
|
||||
-DwxUSE_DETECT_SM=OFF
|
||||
-DwxUSE_UNICODE=ON
|
||||
-DwxUSE_UNICODE_UTF8=${_unicode_utf8}
|
||||
-DwxUSE_OPENGL=ON
|
||||
-DwxUSE_LIBPNG=sys
|
||||
-DwxUSE_ZLIB=sys
|
||||
-DwxUSE_NANOSVG=sys
|
||||
-DwxUSE_NANOSVG_EXTERNAL=ON
|
||||
-DwxUSE_REGEX=OFF
|
||||
-DwxUSE_LIBXPM=builtin
|
||||
-DwxUSE_LIBJPEG=sys
|
||||
-DwxUSE_LIBTIFF=sys
|
||||
-DwxUSE_EXPAT=sys
|
||||
-DwxUSE_LIBSDL=OFF
|
||||
-DwxUSE_XTEST=OFF
|
||||
-DwxUSE_GLCANVAS_EGL=OFF
|
||||
-DwxUSE_WEBREQUEST=OFF
|
||||
)
|
||||
|
||||
if (MSVC)
|
||||
add_debug_dep(dep_wxWidgets)
|
||||
endif ()
|
||||
Reference in New Issue
Block a user