Advertisement
ZeronSix

painis

Jul 30th, 2013
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CMake 1.38 KB | None | 0 0
  1. #Change this if you need to target a specific CMake version
  2. cmake_minimum_required(VERSION 2.6)
  3. project(homicide)
  4.  
  5. # Enable debug symbols by default
  6. if(CMAKE_BUILD_TYPE STREQUAL "")
  7.   set(CMAKE_BUILD_TYPE Debug)
  8. endif()
  9. # (you can also set it on the command line: -D CMAKE_BUILD_TYPE=Release)
  10.  
  11. # Set version information in a config.h file
  12. set(project_VERSION_MAJOR 1)
  13. set(project_VERSION_MINOR 0)
  14. configure_file(
  15.   "${PROJECT_SOURCE_DIR}/config.h.in"
  16.   "${PROJECT_BINARY_DIR}/config.h"
  17.   )
  18. include_directories("${PROJECT_BINARY_DIR}")
  19.  
  20. # Define sources and executable
  21. set(EXECUTABLE_NAME "homicide")
  22. add_executable(${EXECUTABLE_NAME} main.cpp)
  23.  
  24.  
  25. # Detect and add SFML
  26. set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules" ${CMAKE_MODULE_PATH})
  27. #Find any version 2.X of SFML
  28. #See the FindSFML.cmake file for additional details and instructions
  29. find_package(SFML 2 REQUIRED system window graphics network audio)
  30. if(SFML_FOUND)
  31.   include_directories(${SFML_INCLUDE_DIR})
  32.   target_link_libraries(${EXECUTABLE_NAME} ${SFML_LIBRARIES})
  33. endif()
  34.  
  35.  
  36. # Install target
  37. install(TARGETS ${EXECUTABLE_NAME} DESTINATION bin)
  38.  
  39.  
  40. # CPack packaging
  41. include(InstallRequiredSystemLibraries)
  42. set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING")
  43. set(CPACK_PACKAGE_VERSION_MAJOR "${myproject_VERSION_MAJOR}")
  44. set(CPACK_PACKAGE_VERSION_MINOR "${myproject_VERSION_MINOR}")
  45. include(CPack)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement