Main Lemma Repository
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SuperBuild.cmake 6.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. project (SuperBuild CXX C)
  2. include(ExternalProject)
  3. if (Eigen3_FOUND)
  4. message( STATUS "Eigen was found ${eigen_DIR}" )
  5. else()
  6. message( STATUS "Eigen WAS NOT FOUND ${eigen_DIR}" )
  7. ExternalProject_Add(EIGEN
  8. GIT_REPOSITORY "https://gitlab.com/libeigen/eigen.git"
  9. UPDATE_COMMAND ""
  10. GIT_TAG "3.4.0"
  11. PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/eigen
  12. CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
  13. #CONFIGURE_COMMAND ""
  14. #BUILD_COMMAND ""
  15. #INSTALL_COMMAND ""
  16. )
  17. endif()
  18. if (yaml-cpp_FOUND)
  19. message( STATUS "YAML-CPP was found ${yaml-cpp_FOUND}" )
  20. else()
  21. message( STATUS "YAML-CPP WAS NOT FOUND, BUILDING" )
  22. ExternalProject_Add(YAML_CPP
  23. GIT_REPOSITORY "https://github.com/jbeder/yaml-cpp.git"
  24. GIT_TAG "yaml-cpp-0.6.3" # "master"
  25. UPDATE_COMMAND ""
  26. PATCH_COMMAND ""
  27. PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/yaml-cpp
  28. CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
  29. -DYAML_BUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}
  30. -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
  31. -DYAML_CPP_BUILD_TESTS=OFF
  32. -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
  33. -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
  34. -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
  35. -DCMAKE_CXX_STANDARD=14
  36. -DCMAKE_CXX_STANDARD_REQUIRED=ON
  37. -DCMAKE_CXX_EXTENSIONS=OFF
  38. )
  39. endif()
  40. if ( LEMMA_VTK9_SUPPORT )
  41. if ( VTK_FOUND )
  42. message(STATUS "VTK FOUND!")
  43. endif()
  44. if ( NOT VTK_FOUND OR VTK_VERSION VERSION_LESS "9.0.0" )
  45. #message( STATUS "VTK > 8.20.0 was found! Version found: " ${VTK_VERSION}, ${VTK_USE_FILE} )
  46. message( STATUS "External build of VTK 9 has been added, this may take some time to build." )
  47. ExternalProject_Add(VTK9
  48. GIT_REPOSITORY "https://gitlab.kitware.com/vtk/vtk.git"
  49. GIT_TAG "v9.3.0"
  50. PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/vtk9
  51. CMAKE_ARGS
  52. -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
  53. -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} /
  54. -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} /
  55. -DBUILD_EXAMPLES:BOOL=OFF /
  56. -DBUILD_TESTING:BOOL=OFF /
  57. -DVTK_Group_Web:BOOL=OFF /
  58. -DModule_vtkImagingMath:BOOL=ON /
  59. LOG_DOWNLOAD 0 /
  60. LOG_UPDATE 0
  61. )
  62. endif()
  63. if (VTK_FOUND AND VTK_VERSION VERSION_LESS_EQUAL "8.20.0")
  64. #message(STATUS "VTK 8 was found! " ${VTK_VERSION}, ${VTK_USE_FILE} )
  65. message(STATUS "VTK 8.2 was found! " ${VTK_VERSION}, ${VTK_MINOR_VERSION}, ${VTK_USE_FILE} )
  66. set(volumeRenderer volumerenderer.cxx)
  67. #include(${VTK_USE_FILE})
  68. add_definitions(-DLEMMAUSEVTK)
  69. else()
  70. endif()
  71. endif()
  72. if (LEMMA_PYTHON3_BINDINGS)
  73. if (pybind11_FOUND)
  74. find_package(PythonLibs 3.0 REQUIRED)
  75. message( STATUS "pybind11 was found" )
  76. else()
  77. message( STATUS "pybind11 was NOT found, please build or remove LEMMA_PYTHON3_BINDINGS" )
  78. #find_package(Python COMPONENTS Interpreter Development REQUIRED)
  79. #find_package(PythonLibs 3.0 REQUIRED)
  80. ExternalProject_Add(pybind11
  81. GIT_REPOSITORY "https://github.com/pybind/pybind11.git"
  82. GIT_TAG "v2.11.1" # "master" #"v2.4.3" #"master"
  83. UPDATE_COMMAND ""
  84. PATCH_COMMAND ""
  85. PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/pybind11
  86. CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
  87. -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}
  88. -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
  89. -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
  90. -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
  91. -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
  92. #CONFIGURE_COMMAND ""
  93. #BUILD_COMMAND ""
  94. #INSTALL_COMMAND ""
  95. )
  96. endif()
  97. endif()
  98. if (LEMMA_ENABLE_TESTING)
  99. if (CXXTEST_FOUND)
  100. message( STATUS "CxxTest was found" )
  101. else()
  102. message( STATUS "CxxTest WAS NOT FOUND")
  103. ## CxxTest has no installation per se, it uses python
  104. ExternalProject_Add(CxxTest
  105. GIT_REPOSITORY "https://github.com/CxxTest/cxxtest.git"
  106. GIT_TAG "master"
  107. UPDATE_COMMAND ""
  108. PATCH_COMMAND ""
  109. PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/CxxTest
  110. #CMAKE_ARGS -DCXXTEST_INCLUDE_DIR="${CMAKE_CURRENT_BINARY_DIR}/external/CxxTest/src/CxxTest/"
  111. # -DCXXTEST_PYTHON_TESTGEN_EXECUTABLE "${CMAKE_CURRENT_BINARY_DIR}/external/CxxTest/src/CxxTest/bin/cxxtestgen"
  112. #-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} /
  113. # -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} /
  114. # -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
  115. CONFIGURE_COMMAND ""
  116. BUILD_COMMAND ""
  117. INSTALL_COMMAND ""
  118. #set (CXXTEST_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}/external/CxxTest/src/CxxTest/" CACHE PATH) # PATH "" FORCE )
  119. #set (CXXTEST_PYTHON_TESTGEN_EXECUTABLE "${CMAKE_CURRENT_BINARY_DIR}/external/CxxTest/src/CxxTest/bin/cxxtestgen" CACHE PATH) # PATH "" FORCE )
  120. )
  121. #enable_testing()
  122. # The values "CACHE PATH "" FORCE" makes the GUI show the values of the local CxxTest, but this can cause issues
  123. # with users wanting to specify their own path. However, the SuperBuild needs this, in theory you are only here
  124. # because a usable CXXTEST was not already found on the machine, so likely this is sane to do
  125. #find_package(CxxTest REQUIRED)
  126. endif()
  127. endif()
  128. # tinyxml2, this library is used for XML IO
  129. #option( LEMMA_TINYXML_SUPPORT "TinyXML library support for .xml files" OFF)
  130. if ( LEMMA_TINYXML_SUPPORT )
  131. ExternalProject_Add(TINYXML2
  132. GIT_REPOSITORY "https://github.com/leethomason/tinyxml2.git"
  133. GIT_TAG "master"
  134. UPDATE_COMMAND ""
  135. PATCH_COMMAND ""
  136. PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/tinyxml2
  137. CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} /
  138. -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
  139. )
  140. add_compile_options(-DTINYXMLSUPPORT)
  141. endif()
  142. #option( LEMMA_MATIO_SUPPORT "MATIO library support for MATLAB .mat files" OFF)
  143. if ( LEMMA_MATIO_SUPPORT )
  144. add_compile_options(-DHAVE_MATIO)
  145. # matio, this library is used for MATLAB file IO
  146. ExternalProject_ADD(MATIO
  147. GIT_REPOSITORY "git://git.code.sf.net/p/matio/matio"
  148. GIT_TAG "master"
  149. UPDATE_COMMAND ""
  150. PATCH_COMMAND ""
  151. PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/matio
  152. #CONFIGURE_COMMAND ${CMAKE_CURRENT_BINARY_DIR}/external/matio/src/MATIO/autogen.sh && configure
  153. CONFIGURE_COMMAND ./autogen.sh && ./configure --prefix=${CMAKE_INSTALL_PREFIX}
  154. BUILD_IN_SOURCE 1
  155. BUILD_COMMAND ${MAKE}
  156. )
  157. endif()
  158. # vim: set tabstop=4 shiftwidth=4 expandtab: