diff --git a/CMake/Findlz4.cmake b/CMake/Findlz4.cmake new file mode 100644 index 0000000000..a79f05ade4 --- /dev/null +++ b/CMake/Findlz4.cmake @@ -0,0 +1,35 @@ +find_path(lz4_INCLUDE_DIR lz4.h + PATHS ${MITK_EXTERNAL_PROJECT_PREFIX} + PATH_SUFFIXES include + NO_DEFAULT_PATH +) +mark_as_advanced(lz4_INCLUDE_DIR) + + +find_library(lz4_LIBRARY_RELEASE lz4 + PATHS ${MITK_EXTERNAL_PROJECT_PREFIX} + PATH_SUFFIXES lib + NO_DEFAULT_PATH) +mark_as_advanced(lz4_LIBRARY_RELEASE) + + +find_library(lz4_LIBRARY_DEBUG lz4d + PATHS ${MITK_EXTERNAL_PROJECT_PREFIX} + PATH_SUFFIXES lib + NO_DEFAULT_PATH) +mark_as_advanced(lz4_LIBRARY_DEBUG) + +set(lz4_LIBRARIES) + +if(lz4_LIBRARY_RELEASE) + list(APPEND lz4_LIBRARIES optimized ${lz4_LIBRARY_RELEASE}) +endif() + +if(lz4_LIBRARY_DEBUG) + list(APPEND lz4_LIBRARIES debug ${lz4_LIBRARY_DEBUG}) +endif() + +find_package_handle_standard_args(lz4 + FOUND_VAR lz4_FOUND + REQUIRED_VARS lz4_INCLUDE_DIR lz4_LIBRARIES +) diff --git a/CMake/PackageDepends/MITK_lz4_Config.cmake b/CMake/PackageDepends/MITK_lz4_Config.cmake new file mode 100644 index 0000000000..b9b2b8ff86 --- /dev/null +++ b/CMake/PackageDepends/MITK_lz4_Config.cmake @@ -0,0 +1,2 @@ +list(APPEND ALL_INCLUDE_DIRECTORIES ${lz4_INCLUDE_DIR}) +list(APPEND ALL_LIBRARIES ${lz4_LIBRARIES}) diff --git a/CMakeExternals/ExternalProjectList.cmake b/CMakeExternals/ExternalProjectList.cmake index 67c827c45b..e275f8b0f4 100644 --- a/CMakeExternals/ExternalProjectList.cmake +++ b/CMakeExternals/ExternalProjectList.cmake @@ -1,31 +1,32 @@ mitkFunctionAddExternalProject(NAME Poco ON COMPONENTS Foundation Net Util XML Zip) mitkFunctionAddExternalProject(NAME DCMTK ON DOC "EXPERIMENTAL, superbuild only: Use DCMTK in MITK") mitkFunctionAddExternalProject(NAME OpenIGTLink OFF) mitkFunctionAddExternalProject(NAME tinyxml2 ON ADVANCED) mitkFunctionAddExternalProject(NAME GDCM ON ADVANCED) mitkFunctionAddExternalProject(NAME Eigen ON ADVANCED DOC "Use the Eigen library") mitkFunctionAddExternalProject(NAME ANN ON ADVANCED DOC "Use Approximate Nearest Neighbor Library") mitkFunctionAddExternalProject(NAME CppUnit ON ADVANCED DOC "Use CppUnit for unit tests") mitkFunctionAddExternalProject(NAME HDF5 ON ADVANCED) mitkFunctionAddExternalProject(NAME OpenCV OFF) mitkFunctionAddExternalProject(NAME Vigra OFF DEPENDS HDF5) mitkFunctionAddExternalProject(NAME ITK ON NO_CACHE DEPENDS HDF5) mitkFunctionAddExternalProject(NAME VTK ON NO_CACHE) mitkFunctionAddExternalProject(NAME Boost ON NO_CACHE) mitkFunctionAddExternalProject(NAME ZLIB OFF ADVANCED) +mitkFunctionAddExternalProject(NAME lz4 ON ADVANCED) mitkFunctionAddExternalProject(NAME cpprestsdk OFF DEPENDS Boost ZLIB ADVANCED) mitkFunctionAddExternalProject(NAME OpenMesh OFF) mitkFunctionAddExternalProject(NAME CTK ON DEPENDS Qt5 DCMTK DOC "Use CTK in MITK") mitkFunctionAddExternalProject(NAME DCMQI ON DEPENDS DCMTK ITK DOC "Use dcmqi in MITK") mitkFunctionAddExternalProject(NAME MatchPoint OFF ADVANCED DEPENDS ITK DOC "Use the MatchPoint translation image registration library") if(MITK_USE_Qt5) mitkFunctionAddExternalProject(NAME Qwt ON ADVANCED DEPENDS Qt5) endif() if(UNIX AND NOT APPLE) mitkFunctionAddExternalProject(NAME PCRE OFF ADVANCED NO_PACKAGE) mitkFunctionAddExternalProject(NAME SWIG OFF ADVANCED NO_PACKAGE DEPENDS PCRE) elseif(WIN32) mitkFunctionAddExternalProject(NAME SWIG OFF ADVANCED NO_PACKAGE) endif() diff --git a/CMakeExternals/lz4.cmake b/CMakeExternals/lz4.cmake new file mode 100644 index 0000000000..84d36c855a --- /dev/null +++ b/CMakeExternals/lz4.cmake @@ -0,0 +1,50 @@ +#----------------------------------------------------------------------------- +# lz4 +#----------------------------------------------------------------------------- + +if(MITK_USE_lz4) + # Sanity checks + if(DEFINED lz4_DIR AND NOT EXISTS "${lz4_DIR}") + message(FATAL_ERROR "lz4_DIR variable is defined but corresponds to non-existing directory") + endif() + + set(proj lz4) + set(proj_DEPENDENCIES ) + set(lz4_DEPENDS ${proj}) + + if(NOT DEFINED lz4_DIR) + + set(additional_args ) + + if(CTEST_USE_LAUNCHERS) + list(APPEND additional_args + "-DCMAKE_PROJECT_${proj}_INCLUDE:FILEPATH=${CMAKE_ROOT}/Modules/CTestUseLaunchers.cmake" + ) + endif() + + ExternalProject_Add(${proj} + LIST_SEPARATOR ${sep} + GIT_REPOSITORY https://github.com/lz4/lz4.git + GIT_TAG v1.9.3 + SOURCE_SUBDIR build/cmake + CMAKE_GENERATOR ${gen} + CMAKE_GENERATOR_PLATFORM ${gen_platform} + CMAKE_ARGS + ${ep_common_args} + ${additional_args} + CMAKE_CACHE_ARGS + ${ep_common_cache_args} + -DLZ4_BUILD_CLI:BOOL=OFF + -DLZ4_BUILD_LEGACY_LZ4C:BOOL=OFF + CMAKE_CACHE_DEFAULT_ARGS + ${ep_common_cache_default_args} + DEPENDS ${proj_DEPENDENCIES} + ) + + set(lz4_DIR "${ep_prefix}") + mitkFunctionInstallExternalCMakeProject(${proj}) + + else() + mitkMacroEmptyExternalProject(${proj} "${proj_DEPENDENCIES}") + endif() +endif() diff --git a/Documentation/Doxygen/3-DeveloperManual/Starting/SettingUpMITK/ThirdPartyLibs.dox b/Documentation/Doxygen/3-DeveloperManual/Starting/SettingUpMITK/ThirdPartyLibs.dox index 2b93804d69..5d760fedaa 100644 --- a/Documentation/Doxygen/3-DeveloperManual/Starting/SettingUpMITK/ThirdPartyLibs.dox +++ b/Documentation/Doxygen/3-DeveloperManual/Starting/SettingUpMITK/ThirdPartyLibs.dox @@ -1,107 +1,111 @@ /** \page thirdpartylibs Third-party libraries The following third-party libraries can be used with MITK by default and can, in part, be automatically downloaded during superbuild. \par ANN https://www.cs.umd.edu/~mount/ANN/ \par Boost https://www.boost.org/ \par C++ REST SDK https://github.com/Microsoft/cpprestsdk/ \par CppUnit https://sourceforge.net/projects/cppunit/ \par CTK https://commontk.org/ \par DCMTK https://dicom.offis.de/dcmtk \par Eigen http://eigen.tuxfamily.org/index.php?title=Main_Page \par GDCM https://gdcm.sourceforge.net/ \par HDF5 https://support.hdfgroup.org/HDF5/ \par ITK https://itk.org/ +\par lz4 + +https://github.com/lz4/lz4 + \par MatchPoint https://www.dkfz.de/en/sidt/projects/MatchPoint/info.html \par OpenCL https://www.khronos.org/opencl/ \par OpenCV https://opencv.org/ \par OpenIGTLink http://openigtlink.org/ \par OpenMesh https://www.openmesh.org/ \par PCRE https://www.pcre.org/ \par POCO https://pocoproject.org/ \par Python https://www.python.org/ \par Qt https://www.qt.io/ \par Qwt http://qwt.sourceforge.net/ \par SWIG http://www.swig.org/ \par TinyXML-2 http://www.grinninglizard.com/tinyxml2/ \par VIGRA https://ukoethe.github.io/vigra/ \par VTK https://vtk.org/ \par zlib https://zlib.net/ For copyright information on any of the above toolkits see the corresponding home page or the corresponding source folder. */