Browse Source

More progress to CMake port. The Yaml library seems to be passed around and installed locally or globally based on configuration.

enhancement_3
Trevor Irons 9 years ago
parent
commit
f1786652b3
3 changed files with 14 additions and 9 deletions
  1. 6
    1
      CMakeLists.txt
  2. 6
    8
      LemmaCore/CMakeLists.txt
  3. 2
    0
      LemmaCore/lemma.h

+ 6
- 1
CMakeLists.txt View File

@@ -13,6 +13,8 @@ ExternalProject_Add(YAML_CPP
13 13
 	GIT_TAG  "master"
14 14
 	UPDATE_COMMAND ""
15 15
 	PATCH_COMMAND ""
16
+    PREFIX ${CMAKE_CURRENT_BINARY_DIR}/customyamlprefix
17
+    CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
16 18
 )
17 19
 
18 20
 #####################
@@ -36,8 +38,11 @@ include_directories ("${PROJECT_SOURCE_DIR}/LemmaCore")
36 38
 add_subdirectory (LemmaCore) 
37 39
 
38 40
 
41
+add_compile_options(-std=c++11) 
42
+
43
+include_directories(${CMAKE_INSTALL_PREFIX}/include)
39 44
 add_executable(Hello "${PROJECT_SOURCE_DIR}/src/test.cpp")
40 45
 target_link_libraries(Hello lemmacore)
41
-#enable_testing()
46
+
42 47
 
43 48
 

+ 6
- 8
LemmaCore/CMakeLists.txt View File

@@ -1,11 +1,9 @@
1
-#add_library(lemmacore  "${PROJECT_SOURCE_DIR}/LemmaCore/lemma.cpp" )
1
+include_directories(${CMAKE_INSTALL_PREFIX}/include)
2 2
 
3
+add_compile_options(-std=c++11) # CMake 2.8.12 or newer
4
+
5
+# TODO fill all the files
3 6
 
4
-#include_directories ("${PROJECT_SOURCE_DIR}/LemmaCore")
5 7
 add_library(lemmacore  "lemma.cpp" )
6
-#e) 
7
-#include_directories(LemmaCore)
8
-# "${PROJECT_BINARY_DIR}/LemmaCore")
9
-#  $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/mylib>
10
-#  $<INSTALL_INTERFACE:include/mylib>  # <prefix>/include/mylib
11
-#)
8
+add_dependencies(lemmacore YAML_CPP)
9
+

+ 2
- 0
LemmaCore/lemma.h View File

@@ -17,5 +17,7 @@
17 17
  * @copyright Copyright (c) 2016, Trevor Irons & Lemma Software, LLC
18 18
  */
19 19
 
20
+#include "yaml-cpp/yaml.h"
21
+
20 22
 float thingy();
21 23
 

Loading…
Cancel
Save