tsp_cpp/snippets/CMakeLists.txt

34 lines
No EOL
956 B
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)
add_executable(coincheTest Coinche.cpp Coinche.h gTestCoinche.cpp)
find_package(GTest REQUIRED)
if(GTest_FOUND)
enable_testing()
include_directories(${GTEST_INCLUDE_DIRS})
target_link_libraries(coincheTest ${GTEST_BOTH_LIBRARIES})
target_link_options(coincheTest PRIVATE -pthread)
else()
message(FATAL_ERROR "GTest pas trouvé")
endif()