tsp_cpp/snippets/CMakeLists.txt

69 lines
2 KiB
Text
Raw Normal View History

2019-04-25 10:23:38 +02:00
cmake_minimum_required(VERSION 3.13)
project(snippets)
set(CMAKE_CXX_STANDARD 17)
2019-04-25 10:23:38 +02:00
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!")
2019-04-25 13:04:25 +02:00
endif()
2019-04-27 01:11:20 +02:00
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()
if(GTest_FOUND)
add_executable(coincheTest gTestCoinche.cpp Coinche.cpp Coinche.h)
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 Circle.cpp)
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)
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)
#target_link_libraries(polynomial -static)
if(GTest_FOUND)
add_executable(polynomialTest gTestPolynomial.cpp)
target_link_libraries(polynomialTest ${GTEST_BOTH_LIBRARIES})
target_link_options(polynomialTest PRIVATE -pthread)
target_link_libraries(polynomialTest polynomial)
2019-04-27 01:11:20 +02:00
endif()