2019-04-25 10:23:38 +02:00
|
|
|
cmake_minimum_required(VERSION 3.13)
|
|
|
|
project(snippets)
|
|
|
|
|
2019-05-10 01:49:59 +02:00
|
|
|
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é")
|
2019-05-07 13:07:58 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
if(GTest_FOUND)
|
2019-05-10 01:49:59 +02:00
|
|
|
add_executable(coincheTest gTestCoinche.cpp Coinche.cpp Coinche.h)
|
2019-05-07 13:07:58 +02:00
|
|
|
target_link_libraries(coincheTest ${GTEST_BOTH_LIBRARIES})
|
|
|
|
target_link_options(coincheTest PRIVATE -pthread)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
add_executable(compte_mots compte_mots.cpp)
|
|
|
|
|
2019-05-10 01:49:59 +02:00
|
|
|
add_library(polynomial SHARED Polynomial.cpp Polynomial.tpp)
|
|
|
|
|
|
|
|
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()
|