Advertisement
Guest User

Untitled

a guest
Jul 20th, 2014
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CMake 1.58 KB | None | 0 0
  1. cmake_minimum_required(VERSION 2.8)
  2.  
  3. project(Corruption)
  4.  
  5. list(APPEND CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS} -Wall -g")
  6.  
  7. # Enable debug symbols by default
  8. if(CMAKE_BUILD_TYPE STREQUAL "")
  9.       set(CMAKE_BUILD_TYPE Debug)
  10.       endif()
  11. # (you can also set it on the command line: -D CMAKE_BUILD_TYPE=Release)
  12.  
  13. # Set version information in a config.h file
  14. set(Corruption_VERSION_MAJOR 1)
  15. set(Corruption_VERSION_MINOR 0)
  16.  
  17. include_directories("${PROJECT_SOURCE_DIR}/Include/")
  18. include_directories("${PROJECT_BINARY_DIR}")
  19.  
  20. # Define sources and executable
  21. file(GLOB Corruption_SRC
  22.     "Include/*.hpp"
  23.     "Source/*.cpp"
  24. )
  25.  
  26. set(EXECUTABLE_NAME "Corruption")
  27. add_executable(${EXECUTABLE_NAME} ${Corruption_SRC})
  28.  
  29. # Detect and add SFML
  30. set(CMAKE_MODULE_PATH "C:/Program Files\ (x86)/CMake\ 2.8/share/cmake-2.8/Modules" ${CMAKE_MODULE_PATH})
  31.  
  32. #See the FindSFML.cmake file for additional details and instructions
  33. set(SFML_ROOT "C:/SFML-2.1")
  34. set(SFML_STATIC_LIBRARIES TRUE)
  35. find_package(SFML 2 COMPONENTS system window graphics audio)
  36.  
  37. if(SFML_FOUND)
  38.     include_directories(${SFML_INCLUDE_DIR})
  39.     target_link_libraries(${EXECUTABLE_NAME} ${SFML_DEPENDENCIES})
  40.     target_link_libraries(${EXECUTABLE_NAME} ${SFML_LIBRARIES})
  41. endif()
  42.  
  43. # Install target
  44. install(TARGETS ${EXECUTABLE_NAME} DESTINATION bin)
  45.  
  46. # CPack packaging
  47. include(InstallRequiredSystemLibraries)
  48. #set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING")
  49. set(CPACK_PACKAGE_VERSION_MAJOR "${Corruption_VERSION_MAJOR}")
  50. set(CPACK_PACKAGE_VERSION_MINOR "${Corruption_VERSION_MINOR}")
  51.  
  52. include(CPack)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement