cmake_minimum_required(VERSION 3.14) project(xmlParser) set(CMAKE_CXX_STANDARD 17) include_directories(.) # Detect and add SFML set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules" ${CMAKE_MODULE_PATH}) find_package(SFML COMPONENTS system window graphics network audio REQUIRED) if(NOT SFML_FOUND) message(FATAL_ERROR "SFML could not be found") endif() find_package(GTest REQUIRED) if(GTest_FOUND) enable_testing() else() message(FATAL_ERROR "GTest could not be found") endif() find_path(PugiXML_INCLUDE_DIR pugixml.hpp) add_library(xmlParser SHARED Circle.cpp Circle.h DrawingElement.cpp DrawingElement.h Group.cpp Group.h xmlParser.cpp xmlParser.h) target_link_libraries(xmlParser sfml-window sfml-graphics pugixml) add_executable(gTestXMLParser gTestXMLParser.cpp) target_compile_options(gTestXMLParser PRIVATE -pthread) target_link_libraries(gTestXMLParser xmlParser gtest sfml-graphics sfml-window pugixml) target_link_options(gTestXMLParser PRIVATE -pthread)