Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cmake_minimum_required(VERSION 2.6)
- project(prattle-client)
- # Specify C++11 flag for g++
- if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O2")
- endif()
- # Add directory containing FindSFML.cmake to module path
- set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules/;${CMAKE_MODULE_PATH};${CMAKE_SOURCE_DIR}")
- # Add sources
- file(GLOB SOURCES
- "${PROJECT_SOURCE_DIR}/main.cpp"
- "${PROJECT_SOURCE_DIR}/src/*.cpp"
- )
- # Find SFML
- if (SFML_OS_WINDOWS AND SFML_COMPILER_MSVC)
- find_package( SFML 2 COMPONENTS main network graphics window system )
- else()
- find_package( SFML 2 COMPONENTS network graphics window system )
- endif()
- # Find TGUI
- find_package(TGUI 0.7 REQUIRED)
- if(SFML_FOUND)
- include_directories(${SFML_INCLUDE_DIR})
- else()
- set(SFML_ROOT "" CACHE PATH "SFML top-level directory")
- message("\n-> SFML directory not found. Set SFML_ROOT to SFML's top-level path (containing \"include\" and \"lib\" directories).")
- message("-> Make sure the SFML libraries with the same configuration (Release/Debug, Static/Dynamic) exist.\n")
- endif()
- if(NOT TGUI_FOUND)
- message(FATAL_ERROR "Could not find TGUI")
- endif()
- add_executable(prattle-client ${SOURCES})
- target_link_libraries(prattle-client ${TGUI_LIBRARY} ${SFML_LIBRARIES})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement