tsp_cpp/snippets/CMakeLists.txt
trotFunky 8caa238c42 TP sur les conteneurs
Moitié du TP XML : parse et test de cercle
2019-05-07 13:07:58 +02:00

58 lines
No EOL
1.6 KiB
CMake

cmake_minimum_required(VERSION 3.13)
project(snippets)
set(CMAKE_CXX_STANDARD 14)
add_executable(pM pietMondrian.cpp)
# 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(SFML_FOUND)
set(SFML_MODULES sfml-system sfml-window sfml-graphics sfml-network sfml-audio)
target_link_libraries(pM ${SFML_MODULES})
endif()
if(NOT SFML_FOUND)
message(FATAL_ERROR "SFML couldn't be located!")
endif()
add_executable(coinche Coinche.cpp Coinche.h playCoinche.cpp)
find_package(GTest REQUIRED)
if(GTest_FOUND)
enable_testing()
include_directories(${GTEST_INCLUDE_DIRS})
else()
message(FATAL_ERROR "GTest pas trouvé")
endif()
add_executable(coincheTest gTestCoinche.cpp Coinche.cpp Coinche.h)
if(GTest_FOUND)
target_link_libraries(coincheTest ${GTEST_BOTH_LIBRARIES})
target_link_options(coincheTest PRIVATE -pthread)
endif()
add_executable(compte_mots compte_mots.cpp)
add_executable(parseXML xmlParser.cpp xmlParser.h Circle.h)
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})
add_executable(xmlTest gTestXMLParser.cpp Circle.h xmlParser.h xmlParser.cpp)
target_include_directories(xmlTest PRIVATE ${PugiXML_INCLUDE_DIR})
target_link_directories(xmlTest PRIVATE ${PugiXML_INCLUDE_DIR})
target_link_libraries(xmlTest pugixml)
if(GTest_FOUND)
target_link_libraries(xmlTest ${GTEST_BOTH_LIBRARIES})
target_link_options(xmlTest PRIVATE -pthread)
endif()