Lemma is an Electromagnetics API
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

SuperBuild.cmake 6.8KB

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