Main Lemma Repository
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

SuperBuild.cmake 5.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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_ENABLE_TESTING)
  67. if (CXXTEST_FOUND)
  68. message( STATUS "CxxTest was found" )
  69. else()
  70. message( STATUS "CxxTest WAS NOT FOUND")
  71. ## CxxTest has no installation per se, it uses python
  72. ExternalProject_Add(CxxTest
  73. GIT_REPOSITORY "https://github.com/CxxTest/cxxtest.git"
  74. GIT_TAG "master"
  75. UPDATE_COMMAND ""
  76. PATCH_COMMAND ""
  77. PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/CxxTest
  78. #CMAKE_ARGS -DCXXTEST_INCLUDE_DIR="${CMAKE_CURRENT_BINARY_DIR}/external/CxxTest/src/CxxTest/"
  79. # -DCXXTEST_PYTHON_TESTGEN_EXECUTABLE "${CMAKE_CURRENT_BINARY_DIR}/external/CxxTest/src/CxxTest/bin/cxxtestgen"
  80. #-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} /
  81. # -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} /
  82. # -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
  83. CONFIGURE_COMMAND ""
  84. BUILD_COMMAND ""
  85. INSTALL_COMMAND ""
  86. #set (CXXTEST_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}/external/CxxTest/src/CxxTest/" CACHE PATH) # PATH "" FORCE )
  87. #set (CXXTEST_PYTHON_TESTGEN_EXECUTABLE "${CMAKE_CURRENT_BINARY_DIR}/external/CxxTest/src/CxxTest/bin/cxxtestgen" CACHE PATH) # PATH "" FORCE )
  88. )
  89. #enable_testing()
  90. # The values "CACHE PATH "" FORCE" makes the GUI show the values of the local CxxTest, but this can cause issues
  91. # with users wanting to specify their own path. However, the SuperBuild needs this, in theory you are only here
  92. # because a usable CXXTEST was not already found on the machine, so likely this is sane to do
  93. #find_package(CxxTest REQUIRED)
  94. endif()
  95. endif()
  96. # tinyxml2, this library is used for XML IO
  97. option( LEMMA_TINYXML_SUPPORT "TinyXML library support for .xml files" OFF)
  98. if ( LEMMA_TINYXML_SUPPORT )
  99. ExternalProject_Add(TINYXML2
  100. GIT_REPOSITORY "https://github.com/leethomason/tinyxml2.git"
  101. GIT_TAG "master"
  102. UPDATE_COMMAND ""
  103. PATCH_COMMAND ""
  104. PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/tinyxml2
  105. CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} /
  106. -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
  107. )
  108. add_compile_options(-DTINYXMLSUPPORT)
  109. endif()
  110. option( LEMMA_MATIO_SUPPORT "MATIO library support for MATLAB .mat files" OFF)
  111. if ( LEMMA_MATIO_SUPPORT )
  112. add_compile_options(-DHAVE_MATIO)
  113. # matio, this library is used for MATLAB file IO
  114. ExternalProject_ADD(MATIO
  115. GIT_REPOSITORY "git://git.code.sf.net/p/matio/matio"
  116. GIT_TAG "master"
  117. UPDATE_COMMAND ""
  118. PATCH_COMMAND ""
  119. PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/matio
  120. #CONFIGURE_COMMAND ${CMAKE_CURRENT_BINARY_DIR}/external/matio/src/MATIO/autogen.sh && configure
  121. CONFIGURE_COMMAND ./autogen.sh && ./configure --prefix=${CMAKE_INSTALL_PREFIX}
  122. BUILD_IN_SOURCE 1
  123. BUILD_COMMAND ${MAKE}
  124. )
  125. endif()
  126. # vim: set tabstop=4 shiftwidth=4 expandtab: