diff --git a/CMakeLists.txt b/CMakeLists.txt index f50d40d..4c9e9e6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION "3.12") -project("spackexample" VERSION 0.2.0) +project("spackexample" VERSION 0.3.0) find_package(Boost 1.65.1 @@ -8,13 +8,12 @@ find_package(Boost filesystem ) -#find_package(yaml-cpp -# 0.7.0 -# REQUIRED -# ) +find_package(yaml-cpp + 0.7.0 + REQUIRED + ) -add_library(spackexamplelib filesystem/filesystem.cpp flatset/flatset.cpp) -#add_library(spackexamplelib filesystem/filesystem.cpp flatset/flatset.cpp yamlParser/yamlParser.cpp) +add_library(spackexamplelib filesystem/filesystem.cpp flatset/flatset.cpp yamlParser/yamlParser.cpp) set_target_properties(spackexamplelib PROPERTIES @@ -23,10 +22,11 @@ set_target_properties(spackexamplelib PUBLIC_HEADER yamlParser/yamlParser.hpp ) +include_directories(${YAML_CPP_INCLUDE_DIR}) + add_executable(spackexample main.cpp) target_link_libraries(spackexample spackexamplelib) -target_link_libraries(spackexamplelib Boost::filesystem) -#target_link_libraries(spackexamplelib Boost::filesystem ${YAML_CPP_LIBRARIES}) +target_link_libraries(spackexamplelib Boost::filesystem yaml-cpp) target_include_directories(spackexamplelib PRIVATE diff --git a/main.cpp b/main.cpp index 55a4f7d..8eda2d3 100644 --- a/main.cpp +++ b/main.cpp @@ -1,6 +1,6 @@ #include "flatset/flatset.hpp" #include "filesystem/filesystem.hpp" -//#include "yamlParser/yamlParser.hpp" +#include "yamlParser/yamlParser.hpp" #include int main(int argc, char *argv[]) @@ -15,13 +15,13 @@ int main(int argc, char *argv[]) inspectDirectory(); std::cout << std::endl; - //if ( argc == 2 ) - //{ - // const std::string yamlFile( argv[1] ); - // std::cout << "Parse some yaml file with yaml-cpp" << std::endl; - // std::cout << " " << yamlFile << std::endl; - // parseConfig( yamlFile ); - //} + if ( argc == 2 ) + { + const std::string yamlFile( argv[1] ); + std::cout << "Parse some yaml file with yaml-cpp" << std::endl; + std::cout << " " << yamlFile << std::endl; + parseConfig( yamlFile ); + } return 0; }