vcpkg/ports/itk/portfile.cmake

78 lines
2.9 KiB
CMake
Raw Normal View History

2017-03-03 06:44:43 +08:00
include(vcpkg_common_functions)
string(LENGTH "${CURRENT_BUILDTREES_DIR}" BUILDTREES_PATH_LENGTH)
if(BUILDTREES_PATH_LENGTH GREATER 50 AND CMAKE_HOST_WIN32)
message(WARNING "ITKs buildsystem uses very long paths and may fail on your system.\n"
"We recommend moving vcpkg to a short path such as 'C:\\src\\vcpkg' or using the subst command."
)
endif()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO InsightSoftwareConsortium/ITK
2019-06-15 06:04:58 +08:00
REF 3e12e7006a5881136414be54216a35bbacb55baa
SHA512 9796429f8750faffc87e44052455740d1a560883e83c3ed9614d1c7ae9cc1ae22a360b572d9bb1c5ec62ca12ac81d3aa0b8dbaffff3e4ad4c2f85077ed04a10b
HEAD_REF master
PATCHES fix_conflict_with_openjp2_pc.patch
2017-03-03 06:44:43 +08:00
)
if ("vtk" IN_LIST FEATURES)
set(ITKVtkGlue ON)
else()
set(ITKVtkGlue OFF)
endif()
2017-03-03 06:44:43 +08:00
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
DISABLE_PARALLEL_CONFIGURE
2017-03-03 06:44:43 +08:00
OPTIONS
-DBUILD_TESTING=OFF
-DBUILD_EXAMPLES=OFF
-DDO_NOT_INSTALL_ITK_TEST_DRIVER=ON
-DITK_INSTALL_DATA_DIR=share/itk/data
-DITK_INSTALL_DOC_DIR=share/itk/doc
-DITK_INSTALL_PACKAGE_DIR=share/itk
-DITK_LEGACY_REMOVE=ON
2017-12-12 06:36:49 +08:00
-DITK_FUTURE_LEGACY_REMOVE=ON
2017-03-03 06:44:43 +08:00
-DITK_USE_64BITS_IDS=ON
-DITK_USE_CONCEPT_CHECKING=ON
2017-12-12 06:36:49 +08:00
#-DITK_USE_SYSTEM_LIBRARIES=ON # enables USE_SYSTEM for all third party libraries, some of which do not have vcpkg ports such as CastXML, SWIG, MINC etc
-DITK_USE_SYSTEM_DOUBLECONVERSION=ON
2017-03-03 06:44:43 +08:00
-DITK_USE_SYSTEM_EXPAT=ON
-DITK_USE_SYSTEM_JPEG=ON
-DITK_USE_SYSTEM_PNG=ON
-DITK_USE_SYSTEM_TIFF=ON
-DITK_USE_SYSTEM_ZLIB=ON
-DITK_USE_SYSTEM_EIGEN=ON
# This should be turned on some day, however for now ITK does download specific versions so it shouldn't spontaneously break
2017-03-03 06:44:43 +08:00
-DITK_FORBID_DOWNLOADS=OFF
2017-12-12 06:36:49 +08:00
-DITK_SKIP_PATH_LENGTH_CHECKS=ON
# I haven't tried Python wrapping in vcpkg
2017-12-12 06:36:49 +08:00
#-DITK_WRAP_PYTHON=ON
#-DITK_PYTHON_VERSION=3
-DITK_USE_SYSTEM_HDF5=ON # HDF5 was problematic in the past
-DModule_ITKVtkGlue=${ITKVtkGlue} # optional feature
2017-12-12 06:36:49 +08:00
2017-03-03 06:44:43 +08:00
-DModule_IOSTL=ON # example how to turn on a non-default module
-DModule_MorphologicalContourInterpolation=ON # example how to turn on a remote module
-DModule_RLEImage=ON # example how to turn on a remote module
-DGDCM_USE_SYSTEM_OPENJPEG=ON #Use port openjpeg instead of own third-party
2017-03-03 06:44:43 +08:00
${ADDITIONAL_OPTIONS}
)
vcpkg_install_cmake()
vcpkg_copy_pdbs()
2019-06-15 06:04:58 +08:00
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake) # combines release and debug build configurations
2017-03-03 06:44:43 +08:00
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
# Handle copyright
file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/itk)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/itk/LICENSE ${CURRENT_PACKAGES_DIR}/share/itk/copyright)