瀏覽代碼

attempt at setting yaml-cppmdd on windows

submodule
Trevor Irons 6 年之前
父節點
當前提交
4b15224b1d
共有 2 個檔案被更改,包括 29 行新增12 行删除
  1. 22
    10
      CMakeLists.txt
  2. 7
    2
      Modules/LemmaCore/CMakeLists.txt

+ 22
- 10
CMakeLists.txt 查看文件

@@ -63,22 +63,34 @@ include_directories ("${CMAKE_INSTALL_PREFIX}/include/eigen3")
63 63
 
64 64
 #############################################################################################
65 65
 # Yaml-cpp, this library is used extensively for serialisation of classes (class persistence) 
66
-ExternalProject_Add(YAML-CPP
67
-	GIT_REPOSITORY  "https://github.com/jbeder/yaml-cpp.git"
68
-	GIT_TAG   "master" #"release-0.5.3" #"master"
69
-	UPDATE_COMMAND ""
70
-	PATCH_COMMAND ""
71
-    PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/yaml-cpp
72
-    CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} /
73
-               -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} /
74
-               -DYAML_CPP_BUILD_TESTS=OFF 
75
-)
66
+find_package(yaml-cpp)
67
+if (yaml-cpp_FOUND)
68
+    message( STATUS "YAML-CPP FOUND ${yaml-cpp_FOUND}" )
69
+	message( STATUS "YAMLCPP_FOUND ${YAMLCPP_FOUND}" )
70
+    message( STATUS "YAML-CPP LIBNAME ${yaml-cpp_LIBNAME}" )
71
+    message( STATUS "YAML-CPP LIBRARY ${yaml-cpp_LIBRARY}" )
72
+else()
73
+    message( STATUS "YAML-CPP WAS NOT FOUND" )
74
+	ExternalProject_Add(YAML_CPP
75
+		GIT_REPOSITORY  "https://github.com/jbeder/yaml-cpp.git"
76
+		GIT_TAG   "master" #"release-0.5.3" #"master"
77
+		UPDATE_COMMAND ""
78
+		PATCH_COMMAND ""
79
+    	PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/yaml-cpp
80
+    	CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} /
81
+        	       -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} /
82
+    	           -DYAML_CPP_BUILD_TESTS=OFF 
83
+	)	
84
+	#find_package(yaml-cpp REQUIRED)
85
+endif()
86
+
76 87
 #add_compile_options(-DHAVE_YAMLCPP) 
77 88
 
78 89
 # CxxTest 
79 90
 find_package(CxxTest) 
80 91
 if (CXXTEST_FOUND)
81 92
 	# Do nothing
93
+    message( STATUS "CXXTEST FOUND" )
82 94
 else()
83 95
 	message( STATUS "CxxTest will be built and installed along with Lemma, override if desired in GUI."  )
84 96
 	ExternalProject_Add(CxxTest

+ 7
- 2
Modules/LemmaCore/CMakeLists.txt 查看文件

@@ -11,7 +11,8 @@ set_target_properties(lemmacore PROPERTIES
11 11
 )
12 12
 
13 13
 # External project dependencies 
14
-add_dependencies(lemmacore YAML-CPP)
14
+#add_dependencies(lemmacore YAML_CPP)
15
+
15 16
 if (LEMMA_TINYXML_SUPPORT)
16 17
 	add_dependencies(lemmacore TINYXML2)
17 18
 endif()
@@ -25,7 +26,11 @@ if ( LEMMA_VTK6_SUPPORT OR LEMMA_VTK7_SUPPORT )
25 26
 #	target_link_libraries(lemmacore "matplot")
26 27
 endif()
27 28
 
28
-target_link_libraries(lemmacore "yaml-cpp")
29
+if (WIN32)
30
+	target_link_libraries(lemmacore "yaml-cppmdd") 
31
+else()
32
+	target_link_libraries(lemmacore "yaml-cpp") 
33
+endif()
29 34
 
30 35
 # Testing
31 36
 if (LEMMA_ENABLE_TESTING)

Loading…
取消
儲存