Browse Source

attempt at setting yaml-cppmdd on windows

submodule
Trevor Irons 6 years ago
parent
commit
4b15224b1d
2 changed files with 29 additions and 12 deletions
  1. 22
    10
      CMakeLists.txt
  2. 7
    2
      Modules/LemmaCore/CMakeLists.txt

+ 22
- 10
CMakeLists.txt View File

63
 
63
 
64
 #############################################################################################
64
 #############################################################################################
65
 # Yaml-cpp, this library is used extensively for serialisation of classes (class persistence) 
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
 #add_compile_options(-DHAVE_YAMLCPP) 
87
 #add_compile_options(-DHAVE_YAMLCPP) 
77
 
88
 
78
 # CxxTest 
89
 # CxxTest 
79
 find_package(CxxTest) 
90
 find_package(CxxTest) 
80
 if (CXXTEST_FOUND)
91
 if (CXXTEST_FOUND)
81
 	# Do nothing
92
 	# Do nothing
93
+    message( STATUS "CXXTEST FOUND" )
82
 else()
94
 else()
83
 	message( STATUS "CxxTest will be built and installed along with Lemma, override if desired in GUI."  )
95
 	message( STATUS "CxxTest will be built and installed along with Lemma, override if desired in GUI."  )
84
 	ExternalProject_Add(CxxTest
96
 	ExternalProject_Add(CxxTest

+ 7
- 2
Modules/LemmaCore/CMakeLists.txt View File

11
 )
11
 )
12
 
12
 
13
 # External project dependencies 
13
 # External project dependencies 
14
-add_dependencies(lemmacore YAML-CPP)
14
+#add_dependencies(lemmacore YAML_CPP)
15
+
15
 if (LEMMA_TINYXML_SUPPORT)
16
 if (LEMMA_TINYXML_SUPPORT)
16
 	add_dependencies(lemmacore TINYXML2)
17
 	add_dependencies(lemmacore TINYXML2)
17
 endif()
18
 endif()
25
 #	target_link_libraries(lemmacore "matplot")
26
 #	target_link_libraries(lemmacore "matplot")
26
 endif()
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
 # Testing
35
 # Testing
31
 if (LEMMA_ENABLE_TESTING)
36
 if (LEMMA_ENABLE_TESTING)

Loading…
Cancel
Save