2019-06-06 09:40:35 +00:00
|
|
|
# https://cmake.org/cmake/help/latest/variable/MSVC_VERSION.html
|
2019-01-29 14:48:30 +00:00
|
|
|
if (MSVC_VERSION EQUAL 1800)
|
2019-06-06 09:40:35 +00:00
|
|
|
# 1800 = VS 12.0 (v120 toolset)
|
2019-01-29 14:48:30 +00:00
|
|
|
set(DEP_VS_VER "12")
|
|
|
|
set(DEP_BOOST_TOOLSET "msvc-12.0")
|
|
|
|
elseif (MSVC_VERSION EQUAL 1900)
|
2019-06-06 09:40:35 +00:00
|
|
|
# 1900 = VS 14.0 (v140 toolset)
|
2019-01-29 14:48:30 +00:00
|
|
|
set(DEP_VS_VER "14")
|
|
|
|
set(DEP_BOOST_TOOLSET "msvc-14.0")
|
2019-06-06 09:40:35 +00:00
|
|
|
elseif (MSVC_VERSION LESS 1920)
|
|
|
|
# 1910-1919 = VS 15.0 (v141 toolset)
|
2019-01-29 14:48:30 +00:00
|
|
|
set(DEP_VS_VER "15")
|
|
|
|
set(DEP_BOOST_TOOLSET "msvc-14.1")
|
2019-06-06 09:40:35 +00:00
|
|
|
elseif (MSVC_VERSION LESS 1930)
|
|
|
|
# 1920-1929 = VS 16.0 (v142 toolset)
|
|
|
|
set(DEP_VS_VER "16")
|
|
|
|
set(DEP_BOOST_TOOLSET "msvc-14.2")
|
2019-01-29 14:48:30 +00:00
|
|
|
else ()
|
|
|
|
message(FATAL_ERROR "Unsupported MSVC version")
|
|
|
|
endif ()
|
|
|
|
|
2019-08-01 14:03:52 +00:00
|
|
|
if (CMAKE_CXX_COMPILER_ID STREQUAL Clang)
|
|
|
|
set(DEP_BOOST_TOOLSET "clang-win")
|
|
|
|
endif ()
|
|
|
|
|
2018-10-23 17:08:26 +00:00
|
|
|
if (${DEPS_BITS} EQUAL 32)
|
2019-01-29 14:48:30 +00:00
|
|
|
set(DEP_MSVC_GEN "Visual Studio ${DEP_VS_VER}")
|
2019-06-06 09:40:35 +00:00
|
|
|
set(DEP_PLATFORM "Win32")
|
2018-10-23 17:08:26 +00:00
|
|
|
else ()
|
2019-06-06 09:40:35 +00:00
|
|
|
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")
|
2018-10-23 17:08:26 +00:00
|
|
|
endif ()
|
|
|
|
|
|
|
|
if (${DEP_DEBUG})
|
|
|
|
set(DEP_BOOST_DEBUG "debug")
|
|
|
|
else ()
|
|
|
|
set(DEP_BOOST_DEBUG "")
|
|
|
|
endif ()
|
|
|
|
|
2019-10-25 11:09:25 +00:00
|
|
|
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()
|
|
|
|
|
2018-10-16 09:06:26 +00:00
|
|
|
ExternalProject_Add(dep_boost
|
2018-10-12 12:19:08 +00:00
|
|
|
EXCLUDE_FROM_ALL 1
|
2021-04-12 17:52:25 +00:00
|
|
|
URL "https://boostorg.jfrog.io/artifactory/main/release/1.75.0/source/boost_1_75_0.tar.gz"
|
2021-01-15 12:46:14 +00:00
|
|
|
URL_HASH SHA256=aeb26f80e80945e82ee93e5939baebdca47b9dee80a07d3144be1e1a6a66dd6a
|
2018-10-12 12:19:08 +00:00
|
|
|
BUILD_IN_SOURCE 1
|
|
|
|
CONFIGURE_COMMAND bootstrap.bat
|
|
|
|
BUILD_COMMAND b2.exe
|
|
|
|
-j "${NPROC}"
|
|
|
|
--with-system
|
2019-10-25 11:09:25 +00:00
|
|
|
--with-iostreams
|
2018-10-12 12:19:08 +00:00
|
|
|
--with-filesystem
|
|
|
|
--with-thread
|
|
|
|
--with-log
|
|
|
|
--with-locale
|
|
|
|
--with-regex
|
2021-01-15 17:07:14 +00:00
|
|
|
--with-date_time
|
2018-10-12 12:19:08 +00:00
|
|
|
"--prefix=${DESTDIR}/usr/local"
|
|
|
|
"address-model=${DEPS_BITS}"
|
2019-01-29 14:48:30 +00:00
|
|
|
"toolset=${DEP_BOOST_TOOLSET}"
|
2018-10-12 12:19:08 +00:00
|
|
|
link=static
|
|
|
|
variant=release
|
|
|
|
threading=multi
|
|
|
|
boost.locale.icu=off
|
2021-02-04 19:31:50 +00:00
|
|
|
--disable-icu
|
2018-10-23 17:08:26 +00:00
|
|
|
"${DEP_BOOST_DEBUG}" release install
|
2018-10-12 12:19:08 +00:00
|
|
|
INSTALL_COMMAND "" # b2 does that already
|
|
|
|
)
|
|
|
|
|
2019-06-26 11:26:49 +00:00
|
|
|
ExternalProject_Add(dep_cereal
|
|
|
|
EXCLUDE_FROM_ALL 1
|
|
|
|
URL "https://github.com/USCiLab/cereal/archive/v1.2.2.tar.gz"
|
|
|
|
# URL_HASH SHA256=c6dd7a5701fff8ad5ebb45a3dc8e757e61d52658de3918e38bab233e7fd3b4ae
|
|
|
|
CMAKE_GENERATOR "${DEP_MSVC_GEN}"
|
|
|
|
CMAKE_GENERATOR_PLATFORM "${DEP_PLATFORM}"
|
|
|
|
CMAKE_ARGS
|
|
|
|
-DJUST_INSTALL_CEREAL=on
|
|
|
|
"-DCMAKE_INSTALL_PREFIX:PATH=${DESTDIR}\\usr\\local"
|
|
|
|
BUILD_COMMAND msbuild /m /P:Configuration=Release INSTALL.vcxproj
|
|
|
|
INSTALL_COMMAND ""
|
|
|
|
)
|
|
|
|
|
2018-10-16 09:06:26 +00:00
|
|
|
if (${DEPS_BITS} EQUAL 32)
|
2018-10-12 12:19:08 +00:00
|
|
|
set(DEP_LIBCURL_TARGET "x86")
|
|
|
|
else ()
|
|
|
|
set(DEP_LIBCURL_TARGET "x64")
|
|
|
|
endif ()
|
|
|
|
|
2018-10-16 09:06:26 +00:00
|
|
|
ExternalProject_Add(dep_libcurl
|
2018-10-12 12:19:08 +00:00
|
|
|
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 ""
|
2019-01-29 14:48:30 +00:00
|
|
|
BUILD_COMMAND cd winbuild && nmake /f Makefile.vc mode=static "VC=${DEP_VS_VER}" GEN_PDB=yes DEBUG=no "MACHINE=${DEP_LIBCURL_TARGET}"
|
2018-10-23 17:08:26 +00:00
|
|
|
INSTALL_COMMAND cd builds\\libcurl-*-release-*-winssl
|
2018-10-12 12:19:08 +00:00
|
|
|
&& "${CMAKE_COMMAND}" -E copy_directory include "${DESTDIR}\\usr\\local\\include"
|
|
|
|
&& "${CMAKE_COMMAND}" -E copy_directory lib "${DESTDIR}\\usr\\local\\lib"
|
|
|
|
)
|
2018-10-23 17:08:26 +00:00
|
|
|
if (${DEP_DEBUG})
|
|
|
|
ExternalProject_Get_Property(dep_libcurl SOURCE_DIR)
|
|
|
|
ExternalProject_Add_Step(dep_libcurl build_debug
|
|
|
|
DEPENDEES build
|
|
|
|
DEPENDERS install
|
2019-01-29 14:48:30 +00:00
|
|
|
COMMAND cd winbuild && nmake /f Makefile.vc mode=static "VC=${DEP_VS_VER}" GEN_PDB=yes DEBUG=yes "MACHINE=${DEP_LIBCURL_TARGET}"
|
2018-10-23 17:08:26 +00:00
|
|
|
WORKING_DIRECTORY "${SOURCE_DIR}"
|
|
|
|
)
|
|
|
|
ExternalProject_Add_Step(dep_libcurl install_debug
|
|
|
|
DEPENDEES install
|
|
|
|
COMMAND cd builds\\libcurl-*-debug-*-winssl
|
|
|
|
&& "${CMAKE_COMMAND}" -E copy_directory include "${DESTDIR}\\usr\\local\\include"
|
|
|
|
&& "${CMAKE_COMMAND}" -E copy_directory lib "${DESTDIR}\\usr\\local\\lib"
|
|
|
|
WORKING_DIRECTORY "${SOURCE_DIR}"
|
|
|
|
)
|
|
|
|
endif ()
|
|
|
|
|
2019-06-05 17:19:49 +00:00
|
|
|
ExternalProject_Add(dep_qhull
|
|
|
|
EXCLUDE_FROM_ALL 1
|
2019-11-18 09:59:58 +00:00
|
|
|
#URL "https://github.com/qhull/qhull/archive/v7.3.2.tar.gz"
|
|
|
|
#URL_HASH SHA256=619c8a954880d545194bc03359404ef36a1abd2dde03678089459757fd790cb0
|
|
|
|
GIT_REPOSITORY https://github.com/qhull/qhull.git
|
2019-11-18 10:05:25 +00:00
|
|
|
GIT_TAG 7afedcc73666e46a9f1d74632412ebecf53b1b30 # v7.3.2 plus the mac build patch
|
2019-06-05 17:19:49 +00:00
|
|
|
CMAKE_GENERATOR "${DEP_MSVC_GEN}"
|
|
|
|
CMAKE_ARGS
|
|
|
|
-DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr/local
|
|
|
|
-DBUILD_SHARED_LIBS=OFF
|
|
|
|
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
|
|
|
|
-DCMAKE_DEBUG_POSTFIX=d
|
|
|
|
BUILD_COMMAND msbuild /m /P:Configuration=Release INSTALL.vcxproj
|
|
|
|
INSTALL_COMMAND ""
|
|
|
|
)
|
|
|
|
|
2019-10-25 11:09:25 +00:00
|
|
|
add_debug_dep(dep_qhull)
|
2018-10-12 12:19:08 +00:00
|
|
|
|
2018-10-16 09:06:26 +00:00
|
|
|
if (${DEPS_BITS} EQUAL 32)
|
2018-10-12 12:19:08 +00:00
|
|
|
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 ()
|
|
|
|
|
2019-06-19 12:52:55 +00:00
|
|
|
find_package(Git REQUIRED)
|
|
|
|
|
2019-10-25 11:09:25 +00:00
|
|
|
ExternalProject_Add(dep_blosc
|
|
|
|
EXCLUDE_FROM_ALL 1
|
2019-10-30 16:21:28 +00:00
|
|
|
#URL https://github.com/Blosc/c-blosc/archive/v1.17.0.zip
|
|
|
|
#URL_HASH SHA256=7463a1df566704f212263312717ab2c36b45d45cba6cd0dccebf91b2cc4b4da9
|
2019-10-25 11:09:25 +00:00
|
|
|
GIT_REPOSITORY https://github.com/Blosc/c-blosc.git
|
2019-11-01 09:56:39 +00:00
|
|
|
GIT_TAG e63775855294b50820ef44d1b157f4de1cc38d3e #v1.17.0
|
2019-10-25 11:09:25 +00:00
|
|
|
CMAKE_GENERATOR "${DEP_MSVC_GEN}"
|
2019-10-30 16:21:28 +00:00
|
|
|
CMAKE_GENERATOR_PLATFORM "${DEP_PLATFORM}"
|
2019-10-25 11:09:25 +00:00
|
|
|
CMAKE_ARGS
|
|
|
|
-DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr/local
|
|
|
|
-DBUILD_SHARED_LIBS=OFF
|
|
|
|
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
|
|
|
|
-DCMAKE_DEBUG_POSTFIX=d
|
|
|
|
-DBUILD_SHARED=OFF
|
|
|
|
-DBUILD_STATIC=ON
|
|
|
|
-DBUILD_TESTS=OFF
|
|
|
|
-DBUILD_BENCHMARKS=OFF
|
|
|
|
-DPREFER_EXTERNAL_ZLIB=ON
|
2019-10-30 16:21:28 +00:00
|
|
|
-DBLOSC_IS_SUBPROJECT:BOOL=ON
|
|
|
|
-DBLOSC_INSTALL:BOOL=ON
|
2019-11-18 09:04:32 +00:00
|
|
|
PATCH_COMMAND ${GIT_EXECUTABLE} checkout -f -- . && git clean -df &&
|
|
|
|
${GIT_EXECUTABLE} apply --whitespace=fix ${CMAKE_CURRENT_SOURCE_DIR}/blosc-mods.patch
|
2019-10-25 11:09:25 +00:00
|
|
|
BUILD_COMMAND msbuild /m /P:Configuration=Release INSTALL.vcxproj
|
|
|
|
INSTALL_COMMAND ""
|
|
|
|
)
|
|
|
|
|
|
|
|
add_debug_dep(dep_blosc)
|
|
|
|
|
|
|
|
ExternalProject_Add(dep_openexr
|
|
|
|
EXCLUDE_FROM_ALL 1
|
|
|
|
GIT_REPOSITORY https://github.com/openexr/openexr.git
|
2020-05-07 07:13:20 +00:00
|
|
|
GIT_TAG eae0e337c9f5117e78114fd05f7a415819df413a #v2.4.0
|
2019-10-25 11:09:25 +00:00
|
|
|
CMAKE_GENERATOR "${DEP_MSVC_GEN}"
|
2019-10-30 16:21:28 +00:00
|
|
|
CMAKE_GENERATOR_PLATFORM "${DEP_PLATFORM}"
|
2019-10-25 11:09:25 +00:00
|
|
|
CMAKE_ARGS
|
|
|
|
-DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr/local
|
|
|
|
-DBUILD_SHARED_LIBS=OFF
|
|
|
|
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
|
|
|
|
-DBUILD_TESTING=OFF
|
|
|
|
-DPYILMBASE_ENABLE:BOOL=OFF
|
|
|
|
-DOPENEXR_VIEWERS_ENABLE:BOOL=OFF
|
|
|
|
-DOPENEXR_BUILD_UTILS:BOOL=OFF
|
|
|
|
BUILD_COMMAND msbuild /m /P:Configuration=Release INSTALL.vcxproj
|
|
|
|
INSTALL_COMMAND ""
|
|
|
|
)
|
|
|
|
|
|
|
|
add_debug_dep(dep_openexr)
|
|
|
|
|
|
|
|
ExternalProject_Add(dep_openvdb
|
|
|
|
EXCLUDE_FROM_ALL 1
|
2019-10-30 16:21:28 +00:00
|
|
|
#URL https://github.com/AcademySoftwareFoundation/openvdb/archive/v6.2.1.zip
|
|
|
|
#URL_HASH SHA256=dc337399dce8e1c9f21f20e97b1ce7e4933cb0a63bb3b8b734d8fcc464aa0c48
|
2019-10-25 11:09:25 +00:00
|
|
|
GIT_REPOSITORY https://github.com/AcademySoftwareFoundation/openvdb.git
|
2019-11-01 09:56:39 +00:00
|
|
|
GIT_TAG aebaf8d95be5e57fd33949281ec357db4a576c2e #v6.2.1
|
2019-11-18 08:35:26 +00:00
|
|
|
DEPENDS dep_blosc dep_openexr dep_tbb dep_boost
|
2019-10-25 11:09:25 +00:00
|
|
|
CMAKE_GENERATOR "${DEP_MSVC_GEN}"
|
2019-10-30 16:21:28 +00:00
|
|
|
CMAKE_GENERATOR_PLATFORM "${DEP_PLATFORM}"
|
2019-10-25 11:09:25 +00:00
|
|
|
CMAKE_ARGS
|
|
|
|
-DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr/local
|
|
|
|
-DCMAKE_DEBUG_POSTFIX=d
|
|
|
|
-DCMAKE_PREFIX_PATH=${DESTDIR}/usr/local
|
|
|
|
-DBUILD_SHARED_LIBS=OFF
|
|
|
|
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
|
|
|
|
-DOPENVDB_BUILD_PYTHON_MODULE=OFF
|
|
|
|
-DUSE_BLOSC=ON
|
|
|
|
-DOPENVDB_CORE_SHARED=OFF
|
|
|
|
-DOPENVDB_CORE_STATIC=ON
|
|
|
|
-DTBB_STATIC=ON
|
|
|
|
-DOPENVDB_BUILD_VDB_PRINT=ON
|
|
|
|
BUILD_COMMAND msbuild /m /P:Configuration=Release INSTALL.vcxproj
|
2019-11-18 09:04:32 +00:00
|
|
|
PATCH_COMMAND ${GIT_EXECUTABLE} checkout -f -- . && git clean -df &&
|
|
|
|
${GIT_EXECUTABLE} apply --whitespace=fix ${CMAKE_CURRENT_SOURCE_DIR}/openvdb-mods.patch
|
2019-10-25 11:09:25 +00:00
|
|
|
INSTALL_COMMAND ""
|
|
|
|
)
|
|
|
|
|
|
|
|
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}"
|
|
|
|
)
|
2021-04-12 17:52:25 +00:00
|
|
|
endif ()
|
|
|
|
|