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.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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://github.com/eigenteam/eigen-git-mirror.git"
  9. UPDATE_COMMAND ""
  10. GIT_TAG "3.3.7" #"default"
  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 "master" # "yaml-cpp-0.6.2", # "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. -DBUILD_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. )
  36. endif()
  37. if ( LEMMA_VTK8_SUPPORT )
  38. if ( NOT VTK_FOUND OR VTK_VERSION VERSION_GREATER "8.2.0" )
  39. message( STATUS "VTK > 8.20.0 was found! Version found: " ${VTK_VERSION}, ${VTK_USE_FILE} )
  40. message( STATUS "External build of VTK 8 has been added, this may take some time to build." )
  41. ExternalProject_Add(VTK8
  42. GIT_REPOSITORY "https://gitlab.kitware.com/vtk/vtk.git"
  43. GIT_TAG "v8.2.0"
  44. PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/vtk8
  45. CMAKE_ARGS
  46. -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
  47. -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} /
  48. -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} /
  49. -DBUILD_EXAMPLES:BOOL=OFF /
  50. -DBUILD_TESTING:BOOL=OFF /
  51. -DVTK_Group_Web:BOOL=OFF /
  52. -DModule_vtkImagingMath:BOOL=ON /
  53. LOG_DOWNLOAD 0 /
  54. LOG_UPDATE 0
  55. )
  56. endif()
  57. if (VTK_FOUND AND VTK_VERSION VERSION_LESS_EQUAL "8.20.0")
  58. #message(STATUS "VTK 8 was found! " ${VTK_VERSION}, ${VTK_USE_FILE} )
  59. message(STATUS "VTK 8.2 was found! " ${VTK_VERSION}, ${VTK_MINOR_VERSION}, ${VTK_USE_FILE} )
  60. set(volumeRenderer volumerenderer.cxx)
  61. #include(${VTK_USE_FILE})
  62. add_definitions(-DLEMMAUSEVTK)
  63. else()
  64. endif()
  65. endif()
  66. if (LEMMA_PYTHON3_BINDINGS)
  67. if (pybind11_FOUND)
  68. message( STATUS "pybind11 was found" )
  69. else()
  70. message( STATUS "pybind11 was NOT found, please build or remove LEMMA_PYTHON3_BINDINGS" )
  71. ExternalProject_Add(pybind11
  72. GIT_REPOSITORY "https://github.com/pybind/pybind11.git"
  73. GIT_TAG "v2.3.0" #"master"
  74. UPDATE_COMMAND ""
  75. PATCH_COMMAND ""
  76. PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/pybind11
  77. CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
  78. -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}
  79. -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
  80. -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
  81. -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
  82. -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
  83. #CONFIGURE_COMMAND ""
  84. #BUILD_COMMAND ""
  85. #INSTALL_COMMAND ""
  86. )
  87. endif()
  88. endif()
  89. if (LEMMA_ENABLE_TESTING)
  90. if (CXXTEST_FOUND)
  91. message( STATUS "CxxTest was found" )
  92. else()
  93. message( STATUS "CxxTest WAS NOT FOUND")
  94. ## CxxTest has no installation per se, it uses python
  95. ExternalProject_Add(CxxTest
  96. GIT_REPOSITORY "https://github.com/CxxTest/cxxtest.git"
  97. GIT_TAG "master"
  98. UPDATE_COMMAND ""
  99. PATCH_COMMAND ""
  100. PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/CxxTest
  101. #CMAKE_ARGS -DCXXTEST_INCLUDE_DIR="${CMAKE_CURRENT_BINARY_DIR}/external/CxxTest/src/CxxTest/"
  102. # -DCXXTEST_PYTHON_TESTGEN_EXECUTABLE "${CMAKE_CURRENT_BINARY_DIR}/external/CxxTest/src/CxxTest/bin/cxxtestgen"
  103. #-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} /
  104. # -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} /
  105. # -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
  106. CONFIGURE_COMMAND ""
  107. BUILD_COMMAND ""
  108. INSTALL_COMMAND ""
  109. #set (CXXTEST_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}/external/CxxTest/src/CxxTest/" CACHE PATH) # PATH "" FORCE )
  110. #set (CXXTEST_PYTHON_TESTGEN_EXECUTABLE "${CMAKE_CURRENT_BINARY_DIR}/external/CxxTest/src/CxxTest/bin/cxxtestgen" CACHE PATH) # PATH "" FORCE )
  111. )
  112. #enable_testing()
  113. # The values "CACHE PATH "" FORCE" makes the GUI show the values of the local CxxTest, but this can cause issues
  114. # with users wanting to specify their own path. However, the SuperBuild needs this, in theory you are only here
  115. # because a usable CXXTEST was not already found on the machine, so likely this is sane to do
  116. #find_package(CxxTest REQUIRED)
  117. endif()
  118. endif()
  119. # tinyxml2, this library is used for XML IO
  120. #option( LEMMA_TINYXML_SUPPORT "TinyXML library support for .xml files" OFF)
  121. if ( LEMMA_TINYXML_SUPPORT )
  122. ExternalProject_Add(TINYXML2
  123. GIT_REPOSITORY "https://github.com/leethomason/tinyxml2.git"
  124. GIT_TAG "master"
  125. UPDATE_COMMAND ""
  126. PATCH_COMMAND ""
  127. PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/tinyxml2
  128. CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} /
  129. -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
  130. )
  131. add_compile_options(-DTINYXMLSUPPORT)
  132. endif()
  133. #option( LEMMA_MATIO_SUPPORT "MATIO library support for MATLAB .mat files" OFF)
  134. if ( LEMMA_MATIO_SUPPORT )
  135. add_compile_options(-DHAVE_MATIO)
  136. # matio, this library is used for MATLAB file IO
  137. ExternalProject_ADD(MATIO
  138. GIT_REPOSITORY "git://git.code.sf.net/p/matio/matio"
  139. GIT_TAG "master"
  140. UPDATE_COMMAND ""
  141. PATCH_COMMAND ""
  142. PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/matio
  143. #CONFIGURE_COMMAND ${CMAKE_CURRENT_BINARY_DIR}/external/matio/src/MATIO/autogen.sh && configure
  144. CONFIGURE_COMMAND ./autogen.sh && ./configure --prefix=${CMAKE_INSTALL_PREFIX}
  145. BUILD_IN_SOURCE 1
  146. BUILD_COMMAND ${MAKE}
  147. )
  148. endif()
  149. # vim: set tabstop=4 shiftwidth=4 expandtab: