Browse Source

Port of build to CMake. Progress on matio and tinyxml external packages.

enhancement_3
Trevor Irons 8 years ago
parent
commit
58a183515a
2 changed files with 43 additions and 7 deletions
  1. 37
    4
      CMakeLists.txt
  2. 6
    3
      LemmaCore/CMakeLists.txt

+ 37
- 4
CMakeLists.txt View File

@@ -6,17 +6,50 @@ project (Lemma)
6 6
 # External Projects
7 7
 ###################
8 8
 include(ExternalProject)
9
-# Yaml-cpp
10 9
 
11
-ExternalProject_Add(YAML_CPP
10
+# Eigen, this header-library is used extensively for linear algebra, matrices, and arrays
11
+ExternalProject_Add(EIGEN
12
+	HG_REPOSITORY  "https://bitbucket.org/eigen/eigen/"
13
+	#DOWNLOAD_COMMAND wget http://bitbucket.org/eigen/eigen/get/3.2.7.tar.bz2
14
+	UPDATE_COMMAND ""
15
+	PATCH_COMMAND ""
16
+    PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/eigen
17
+    CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
18
+)
19
+
20
+# Yaml-cpp, this library is used extensively for serialisation of classes (class persistence) 
21
+ExternalProject_Add(YAML-CPP
12 22
 	GIT_REPOSITORY  "https://github.com/jbeder/yaml-cpp.git"
13 23
 	GIT_TAG  "master"
14 24
 	UPDATE_COMMAND ""
15 25
 	PATCH_COMMAND ""
16
-    PREFIX ${CMAKE_CURRENT_BINARY_DIR}/customyamlprefix
26
+    PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/yaml-cpp
17 27
     CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
18 28
 )
19 29
 
30
+# tinyxml2, this library is used for XML IO 
31
+ExternalProject_Add(TINYXML2
32
+	GIT_REPOSITORY "https://github.com/leethomason/tinyxml2.git"
33
+	GIT_TAG  "master"
34
+	UPDATE_COMMAND ""
35
+	PATCH_COMMAND ""
36
+    PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/tinyxml2
37
+    CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
38
+)
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
+
20 53
 #####################
21 54
 # Lemma Configuration
22 55
 #####################
@@ -37,7 +70,7 @@ include_directories("${PROJECT_BINARY_DIR}/include")
37 70
 include_directories ("${PROJECT_SOURCE_DIR}/LemmaCore")
38 71
 add_subdirectory (LemmaCore) 
39 72
 
40
-
73
+# TODO add compiler specific instructions
41 74
 add_compile_options(-std=c++11) 
42 75
 
43 76
 include_directories(${CMAKE_INSTALL_PREFIX}/include)

+ 6
- 3
LemmaCore/CMakeLists.txt View File

@@ -1,9 +1,12 @@
1 1
 include_directories(${CMAKE_INSTALL_PREFIX}/include)
2 2
 
3
-add_compile_options(-std=c++11) # CMake 2.8.12 or newer
3
+add_compile_options(-std=c++11) 
4 4
 
5 5
 # TODO fill all the files
6 6
 
7
-add_library(lemmacore  "lemma.cpp" )
8
-add_dependencies(lemmacore YAML_CPP)
7
+add_library( lemmacore  "lemma.cpp" )
8
+
9
+add_dependencies(lemmacore YAML-CPP)
10
+add_dependencies(lemmacore TINYXML2)
11
+add_dependencies(lemmacore MATIO)
9 12
 

Loading…
Cancel
Save