diff --git a/CMakeLists.txt b/CMakeLists.txt index bad4015..1c59f0a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,7 +42,8 @@ endif() # Add yaml-cpp include(ExternalProject) set(EXTERNAL_INSTALL_LOCATION ${CMAKE_BINARY_DIR}/external) -ExternalProject_Add(yaml-cpp + +ExternalProject_Add(yaml-cpp-src GIT_REPOSITORY "https://github.com/jbeder/yaml-cpp" CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTERNAL_INSTALL_LOCATION} ) @@ -50,13 +51,19 @@ ExternalProject_Add(yaml-cpp include_directories(${EXTERNAL_INSTALL_LOCATION}/include) link_directories(${EXTERNAL_INSTALL_LOCATION}/lib) -add_dependencies(CuteSchedule yaml-cpp) +add_library(yaml-cpp UNKNOWN IMPORTED) +add_dependencies(CuteSchedule yaml-cpp-src) + +set_target_properties(yaml-cpp PROPERTIES + IMPORTED_LOCATION ${EXTERNAL_INSTALL_LOCATION}/lib/libyaml-cpp.a +) # --- End external projects --- # target_link_libraries(CuteSchedule PRIVATE Qt${QT_VERSION_MAJOR}::Widgets + yaml-cpp ) set_target_properties(CuteSchedule PROPERTIES diff --git a/main.cpp b/main.cpp index a438ec4..61c25a3 100644 --- a/main.cpp +++ b/main.cpp @@ -1,6 +1,9 @@ #include "src/mainwindow.h" #include +#include + +#include "yaml-cpp/yaml.h" int main(int argc, char *argv[]) {