瀏覽代碼

added SuperBuild.cmake

lagkey
Trevor Irons 6 年之前
父節點
當前提交
2b5185f8ab
共有 1 個文件被更改,包括 107 次插入0 次删除
  1. 107
    0
      CMake/SuperBuild.cmake

+ 107
- 0
CMake/SuperBuild.cmake 查看文件

@@ -0,0 +1,107 @@
1
+include(ExternalProject)
2
+
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.3" #"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
+    )
16
+    include_directories ("${CMAKE_INSTALL_PREFIX}/include/eigen3/")
17
+    set (Eigen3_DIR  "${CMAKE_INSTALL_PREFIX}/include/eigen3" CACHE  PATH "" FORCE )
18
+    #find_package (Eigen3 3.3 NO_MODULE REQUIRED)
19
+    #if (eigen3_FOUND)
20
+    #    message( STATUS "Eigen was found!!!!!!!!!!!!!! ${eigen_DIR}" )
21
+    #endif()
22
+endif()
23
+
24
+if (yaml-cpp_FOUND)
25
+    message( STATUS "YAML-CPP was found ${yaml-cpp_FOUND}" )
26
+    #message( STATUS "YAML-CPP PATH ${yaml-cpp_PATH}" )
27
+    #message( STATUS "YAML-CPP DIR ${yaml-cpp_DIR}" )
28
+    #message( STATUS "YAML-CPP INCLUDE DIR ${yaml-cpp_INCLUDE_DIR}" )
29
+    #message( STATUS "YAML-CPP LIBRARIES ${YAML_CPP_LIBRARIES}" )
30
+    #message( STATUS "YAML-CPP LIBRARY ${yaml-cpp_LIBRARY}" )
31
+else()
32
+    message( STATUS "YAML-CPP WAS NOT FOUND" )
33
+	ExternalProject_Add(YAML_CPP
34
+		GIT_REPOSITORY  "https://github.com/jbeder/yaml-cpp.git"
35
+		GIT_TAG   "yaml-cpp-0.6.1" # "master" 
36
+		UPDATE_COMMAND ""
37
+		PATCH_COMMAND ""
38
+		INSTALL_COMMAND ""
39
+    	PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/yaml-cpp
40
+    	CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} 
41
+                   -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} 
42
+                   -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} 
43
+    	           -DYAML_CPP_BUILD_TESTS=OFF
44
+	)	
45
+	include_directories ("${CMAKE_INSTALL_PREFIX}/include/yaml-cpp")
46
+	add_library(yaml-my-cpp SHARED IMPORTED)
47
+endif()
48
+
49
+if (LEMMA_ENABLE_TESTING)
50
+if (CXXTEST_FOUND)
51
+    #message( STATUS "CXXTEST FOUND" )
52
+else()
53
+	#message( STATUS "CxxTest will be built and installed along with Lemma, override if desired in GUI."  )
54
+	ExternalProject_Add(CxxTest
55
+		GIT_REPOSITORY "https://github.com/CxxTest/cxxtest.git"
56
+		GIT_TAG "master"
57
+		UPDATE_COMMAND ""
58
+		PATCH_COMMAND ""
59
+		CONFIGURE_COMMAND ""
60
+		BUILD_COMMAND ""
61
+		INSTALL_COMMAND ""
62
+    	PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/CxxTest
63
+    	CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} /
64
+                   -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} /
65
+                   -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
66
+	)
67
+	# The values "CACHE PATH "" FORCE" makes the GUI show the values of the local CxxTest, but this can cause issues 
68
+	# with users wanting to specify their own path, its not recommended  
69
+	#set (CXXTEST_INCLUDE_DIR  "${CMAKE_CURRENT_BINARY_DIR}/external/CxxTest/src/CxxTest/") # CACHE  PATH "" FORCE )
70
+	#set (CXXTEST_PYTHON_TESTGEN_EXECUTABLE "${CMAKE_CURRENT_BINARY_DIR}/external/CxxTest/src/CxxTest/bin/cxxtestgen") # CACHE PATH "" FORCE )
71
+	#find_package(CxxTest REQUIRED)
72
+endif()
73
+endif()
74
+
75
+# tinyxml2, this library is used for XML IO 
76
+option( LEMMA_TINYXML_SUPPORT  "TinyXML library support for .xml files" OFF)
77
+if ( LEMMA_TINYXML_SUPPORT )
78
+	ExternalProject_Add(TINYXML2
79
+		GIT_REPOSITORY "https://github.com/leethomason/tinyxml2.git"
80
+		GIT_TAG  "master"
81
+		UPDATE_COMMAND ""
82
+		PATCH_COMMAND ""
83
+    	PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/tinyxml2
84
+    	CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} /
85
+			-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
86
+	)
87
+	add_compile_options(-DTINYXMLSUPPORT) 
88
+endif()
89
+
90
+option( LEMMA_MATIO_SUPPORT  "MATIO library support for MATLAB .mat files" OFF)
91
+if ( LEMMA_MATIO_SUPPORT )
92
+	add_compile_options(-DHAVE_MATIO) 
93
+	# matio, this library is used for MATLAB file IO
94
+	ExternalProject_ADD(MATIO
95
+		GIT_REPOSITORY  "git://git.code.sf.net/p/matio/matio"
96
+		GIT_TAG  "master"
97
+		UPDATE_COMMAND ""
98
+		PATCH_COMMAND ""
99
+    	PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/matio
100
+    	#CONFIGURE_COMMAND ${CMAKE_CURRENT_BINARY_DIR}/external/matio/src/MATIO/autogen.sh && configure
101
+    	CONFIGURE_COMMAND ./autogen.sh && ./configure --prefix=${CMAKE_INSTALL_PREFIX}
102
+		BUILD_IN_SOURCE 1 
103
+    	BUILD_COMMAND ${MAKE}
104
+	)
105
+endif()
106
+
107
+# vim: set tabstop=4 shiftwidth=4 expandtab: 

Loading…
取消
儲存