Advertisement
Guest User

Untitled

a guest
Mar 2nd, 2015
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CMake 1.28 KB | None | 0 0
  1. cmake_minimum_required(VERSION 2.6)
  2. project(prattle-server)
  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.     "${PROJECT_SOURCE_DIR}/src/SHA256/SHA256.cpp"
  17. )
  18.  
  19. # Find SFML
  20. if (SFML_OS_WINDOWS AND SFML_COMPILER_MSVC)
  21.     find_package( SFML 2 COMPONENTS main network graphics window system )
  22. else()
  23.     find_package( SFML 2 COMPONENTS network graphics window system )
  24. endif()
  25.  
  26. if(SFML_FOUND)
  27.         include_directories(${SFML_INCLUDE_DIR})
  28. else()
  29.         set(SFML_ROOT "" CACHE PATH "SFML top-level directory")
  30.         message("\n-> SFML directory not found. Set SFML_ROOT to SFML's top-level path (containing \"include\" and \"lib\" directories).")
  31.         message("-> Make sure the SFML libraries with the same configuration (Release/Debug, Static/Dynamic) exist.\n")
  32. endif()
  33.  
  34. add_executable(prattle-server ${SOURCES})
  35.  
  36. target_link_libraries(prattle-server ${SFML_LIBRARIES})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement