Lemma is an Electromagnetics API
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

CMakeLists.txt 3.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. cmake_minimum_required (VERSION 2.8.7)
  2. project (Lemma)
  3. ###################
  4. # External Projects
  5. ###################
  6. include(ExternalProject)
  7. # Eigen, this header-library is used extensively for linear algebra, matrices, and arrays
  8. # Mercurial (hg) repo pull, Would it be better to just download latest stable?
  9. #ExternalProject_Add(EIGEN
  10. # HG_REPOSITORY "https://bitbucket.org/eigen/eigen/"
  11. # UPDATE_COMMAND ""
  12. # PATCH_COMMAND ""
  13. # PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/eigen
  14. # CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
  15. #)
  16. # Stable Eigen, requires manual updating when new releases, but lighter weight.
  17. ExternalProject_Add(EIGEN
  18. URL "http://bitbucket.org/eigen/eigen/get/3.2.7.tar.gz"
  19. PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/eigen
  20. CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
  21. )
  22. # Yaml-cpp, this library is used extensively for serialisation of classes (class persistence)
  23. ExternalProject_Add(YAML-CPP
  24. GIT_REPOSITORY "https://github.com/jbeder/yaml-cpp.git"
  25. GIT_TAG "master"
  26. UPDATE_COMMAND ""
  27. PATCH_COMMAND ""
  28. PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/yaml-cpp
  29. CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
  30. )
  31. # tinyxml2, this library is used for XML IO
  32. ExternalProject_Add(TINYXML2
  33. GIT_REPOSITORY "https://github.com/leethomason/tinyxml2.git"
  34. GIT_TAG "master"
  35. UPDATE_COMMAND ""
  36. PATCH_COMMAND ""
  37. PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/tinyxml2
  38. CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
  39. )
  40. # matio, this library is used for MATLAB file IO
  41. ExternalProject_ADD(MATIO
  42. GIT_REPOSITORY "git://git.code.sf.net/p/matio/matio"
  43. GIT_TAG "master"
  44. UPDATE_COMMAND ""
  45. PATCH_COMMAND ""
  46. PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/matio
  47. #CONFIGURE_COMMAND ${CMAKE_CURRENT_BINARY_DIR}/external/matio/src/MATIO/autogen.sh && configure
  48. CONFIGURE_COMMAND ./autogen.sh && ./configure --prefix=${CMAKE_INSTALL_PREFIX}
  49. BUILD_IN_SOURCE 1
  50. BUILD_COMMAND ${MAKE}
  51. )
  52. #####################
  53. # Lemma Configuration
  54. #####################
  55. project(LEMMA_CXX)
  56. # We don't Build VTK, it is too much.
  57. find_package(VTK 6.0 REQUIRED NO_MODULE)
  58. include(${VTK_USE_FILE})
  59. set(LEMMA_VERSION_MAJOR "0")
  60. set(LEMMA_VERSION_MINOR "0")
  61. set(LEMMA_VERSION_PATCH "0")
  62. #set(LEMMA_VERSION "${LEMMA_CPP_VERSION_MAJOR}_${LEMMA_CPP_VERSION_MINOR}_${LEMMA_CPP_VERSION_PATCH}")
  63. configure_file (
  64. "${PROJECT_SOURCE_DIR}/include/LemmaConfig.h.in"
  65. "${PROJECT_BINARY_DIR}/include/LemmaConfig.h"
  66. )
  67. include_directories("${PROJECT_BINARY_DIR}/include")
  68. include_directories ("${PROJECT_SOURCE_DIR}/LemmaCore/include")
  69. include_directories ("${CMAKE_INSTALL_PREFIX}/include/eigen3")
  70. include_directories ("${CMAKE_INSTALL_PREFIX}/include/")
  71. link_directories ("${CMAKE_INSTALL_PREFIX}/lib/")
  72. add_subdirectory (LemmaCore)
  73. # TODO add compiler specific instructions
  74. add_compile_options(-std=c++11)
  75. include_directories(${CMAKE_INSTALL_PREFIX}/include)
  76. add_executable(Hello "${PROJECT_SOURCE_DIR}/src/test.cpp")
  77. target_link_libraries(Hello lemmacore)
  78. add_dependencies(Hello YAML-CPP)