Réagencement pour le TP XML

This commit is contained in:
trotFunky 2019-05-16 15:19:41 +02:00
parent 2bd65d0ce6
commit 19f7a90a8c
12 changed files with 50 additions and 22 deletions

1
.gitignore vendored
View file

@ -1,2 +1,3 @@
**/.idea/ **/.idea/
**/cmake-build*/ **/cmake-build*/
**/*.tar*

View file

@ -39,28 +39,6 @@ endif()
add_executable(compte_mots compte_mots.cpp) add_executable(compte_mots compte_mots.cpp)
add_executable(parseXML xmlParser.cpp xmlParser.h Circle.h Circle.cpp Group.cpp Group.h DrawingElement.cpp DrawingElement.h DrawingElement.cpp)
target_link_libraries(parseXML sfml-window sfml-graphics)
find_path(PugiXML_INCLUDE_DIR pugixml.hpp)
target_link_libraries(parseXML pugixml)
target_include_directories(parseXML PRIVATE ${PugiXML_INCLUDE_DIR})
target_link_directories(parseXML PRIVATE ${PugiXML_INCLUDE_DIR})
if(GTest_FOUND)
add_executable(xmlTest gTestXMLParser.cpp Circle.h xmlParser.h xmlParser.cpp Circle.cpp Group.cpp Group.h DrawingElement.cpp DrawingElement.h DrawingElement.cpp)
target_link_libraries(xmlTest sfml-window sfml-graphics)
target_include_directories(xmlTest PRIVATE ${PugiXML_INCLUDE_DIR})
target_link_directories(xmlTest PRIVATE ${PugiXML_INCLUDE_DIR})
target_link_libraries(xmlTest pugixml)
target_link_libraries(xmlTest ${GTEST_BOTH_LIBRARIES})
target_link_options(xmlTest PRIVATE -pthread)
endif()
add_library(polynomial SHARED Polynomial.cpp Polynomial.tpp) add_library(polynomial SHARED Polynomial.cpp Polynomial.tpp)
#target_link_libraries(polynomial -static) #target_link_libraries(polynomial -static)

49
xmlParser/CMakeLists.txt Normal file
View file

@ -0,0 +1,49 @@
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)