瀏覽代碼

Clean up CMake for default compilers

add-code-of-conduct-1
Trevor Irons 6 年之前
父節點
當前提交
2cd3336f69
共有 2 個檔案被更改,包括 25 行新增8 行删除
  1. 24
    7
      CMake/SuperBuild.cmake
  2. 1
    1
      CMakeLists.txt

+ 24
- 7
CMake/SuperBuild.cmake 查看文件

@@ -1,5 +1,7 @@
1 1
 include(ExternalProject)
2 2
 
3
+project (SuperBuild CXX C)
4
+
3 5
 if (Eigen3_FOUND)
4 6
     message( STATUS "Eigen was found ${eigen_DIR}" )
5 7
 else()
@@ -14,7 +16,6 @@ else()
14 16
 		#BUILD_COMMAND     ""
15 17
 		#INSTALL_COMMAND     ""
16 18
     )
17
-
18 19
     #message("Source dir of myExtProj = ${SOURCE_DIR}")   
19 20
     #ExternalProject_Get_property(EIGEN SOURCE_DIR)
20 21
     #message("Source dir of myExtProj = ${SOURCE_DIR}")   
@@ -29,6 +30,7 @@ else()
29 30
     #endif()
30 31
 endif()
31 32
 
33
+
32 34
 if (yaml-cpp_FOUND)
33 35
     message( STATUS "YAML-CPP was found ${yaml-cpp_FOUND}" )
34 36
     #message( STATUS "YAML-CPP PATH ${yaml-cpp_PATH}" )
@@ -39,7 +41,25 @@ if (yaml-cpp_FOUND)
39 41
 else()
40 42
     message( STATUS "YAML-CPP WAS NOT FOUND, BUILDING" )
41 43
     message( STATUS "CMAKE BUILD TYPE ${CMAKE_BUILD_TYPE}" )
42
-	ExternalProject_Add(YAML_CPP
44
+    message( STATUS "CMAKE CXX COMPILER ${CMAKE_CXX_COMPILER}" )
45
+#    if ( ${CMAKE_C_COMPILER} )
46
+#        message( STATUS "Compiling Yaml with Cxx COMPILER ${CMAKE_CXX_COMPILER}" )
47
+#	    ExternalProject_Add(YAML_CPP
48
+#		GIT_REPOSITORY  "https://github.com/jbeder/yaml-cpp.git"
49
+#		GIT_TAG   "yaml-cpp-0.6.1" # "master" 
50
+#		UPDATE_COMMAND ""
51
+#		PATCH_COMMAND ""
52
+#    	PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/yaml-cpp
53
+#    	CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} 
54
+#                   -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}
55
+#                   -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} 
56
+#    	           -DYAML_CPP_BUILD_TESTS=OFF
57
+#                   -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
58
+#                   -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} 
59
+#                   -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} 
60
+#        )
61
+#    else()
62
+	    ExternalProject_Add(YAML_CPP
43 63
 		GIT_REPOSITORY  "https://github.com/jbeder/yaml-cpp.git"
44 64
 		GIT_TAG   "yaml-cpp-0.6.1" # "master" 
45 65
 		UPDATE_COMMAND ""
@@ -52,11 +72,8 @@ else()
52 72
                    -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
53 73
                    -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} 
54 74
                    -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} 
55
-		#INSTALL_COMMAND ""
56
-	)	
57
-
58
-    # is this necessary?
59
-	#include_directories ("${CMAKE_INSTALL_PREFIX}/include/yaml-cpp")
75
+        )
76
+#    endif()
60 77
 endif()
61 78
 
62 79
 if (LEMMA_ENABLE_TESTING)

+ 1
- 1
CMakeLists.txt 查看文件

@@ -41,7 +41,7 @@ option (LEMMA_VTK8_SUPPORT "VTK 8.x library for visualisation and grids" OFF)
41 41
 #option (CMAKE_CROSSCOMPILING "Target different arch than you are on" OFF)
42 42
 
43 43
 SET( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/CMake/ )
44
-message( STATUS "MODULE PATH ${CMAKE_MODULE_PATH}" )
44
+#message( STATUS "MODULE PATH ${CMAKE_MODULE_PATH}" )
45 45
 
46 46
 SET (CMAKE_CROSSCOMPILING TRUE)
47 47
 

Loading…
取消
儲存