Advertisement
Guest User

Untitled

a guest
Mar 2nd, 2015
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CMake 1.37 KB | None | 0 0
  1. cmake_minimum_required(VERSION 2.6)
  2. project(prattle-client)
  3.  
  4. # Specify C++11 flag for g++
  5. if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
  6.         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O2")
  7. endif()
  8.  
  9. # Add directory containing FindSFML.cmake to module path
  10. set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules/;${CMAKE_MODULE_PATH};${CMAKE_SOURCE_DIR}")
  11.  
  12. # Add sources
  13. file(GLOB SOURCES
  14.     "${PROJECT_SOURCE_DIR}/main.cpp"
  15.     "${PROJECT_SOURCE_DIR}/src/*.cpp"
  16. )
  17.  
  18. # Find SFML
  19. if (SFML_OS_WINDOWS AND SFML_COMPILER_MSVC)
  20.     find_package( SFML 2 COMPONENTS main network graphics window system )
  21. else()
  22.     find_package( SFML 2 COMPONENTS network graphics window system )
  23. endif()
  24.  
  25. # Find TGUI
  26. find_package(TGUI 0.7 REQUIRED)
  27.  
  28. if(SFML_FOUND)
  29.         include_directories(${SFML_INCLUDE_DIR})
  30. else()
  31.         set(SFML_ROOT "" CACHE PATH "SFML top-level directory")
  32.         message("\n-> SFML directory not found. Set SFML_ROOT to SFML's top-level path (containing \"include\" and \"lib\" directories).")
  33.         message("-> Make sure the SFML libraries with the same configuration (Release/Debug, Static/Dynamic) exist.\n")
  34. endif()
  35.  
  36. if(NOT TGUI_FOUND)
  37.     message(FATAL_ERROR "Could not find TGUI")
  38. endif()
  39.  
  40. add_executable(prattle-client ${SOURCES})
  41.  
  42. target_link_libraries(prattle-client ${TGUI_LIBRARY} ${SFML_LIBRARIES})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement