2019-05-16 15:19:41 +02:00
|
|
|
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)
|
|
|
|
|
2019-05-23 02:23:49 +02:00
|
|
|
find_package(ImGui-SFML REQUIRED)
|
|
|
|
if(NOT ImGui-SFML_FOUND)
|
|
|
|
message(FATAL "ImGui-SFML non trouvé")
|
|
|
|
endif()
|
|
|
|
|
2019-05-16 15:19:41 +02:00
|
|
|
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
|
2019-05-23 02:23:49 +02:00
|
|
|
sfml-system
|
|
|
|
pugixml
|
|
|
|
ImGui-SFML::ImGui-SFML)
|
2019-05-16 15:19:41 +02:00
|
|
|
|
2019-05-22 19:26:15 +02:00
|
|
|
target_compile_options(xmlParser PRIVATE -Wall -Wpedantic -Wextra)
|
|
|
|
|
2019-05-16 15:19:41 +02:00
|
|
|
add_executable(gTestXMLParser gTestXMLParser.cpp)
|
|
|
|
target_compile_options(gTestXMLParser PRIVATE -pthread)
|
|
|
|
|
|
|
|
target_link_libraries(gTestXMLParser
|
|
|
|
xmlParser
|
|
|
|
gtest
|
|
|
|
sfml-graphics
|
|
|
|
sfml-window
|
2019-05-23 02:23:49 +02:00
|
|
|
sfml-system
|
|
|
|
pugixml
|
|
|
|
ImGui-SFML::ImGui-SFML)
|
2019-05-16 15:19:41 +02:00
|
|
|
target_link_options(gTestXMLParser PRIVATE -pthread)
|