CMakeLists.txt 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #Change this if you need to target a specific CMake version
  2. cmake_minimum_required(VERSION 2.6)
  3. set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build (Debug or Release)")
  4. if ( NOT CMAKE_INSTALL_PREFIX )
  5. set(CMAKE_INSTALL_PREFIX "/usr")
  6. endif()
  7. project(slop)
  8. add_definitions(-DSLOP_VERSION="v5.3.21")
  9. set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin/")
  10. include_directories("${PROJECT_BINARY_DIR}")
  11. # Define sources and executable
  12. set(EXECUTABLE_NAME "slop")
  13. set( source src/x.cpp
  14. src/window.cpp
  15. src/windowhelper.cpp
  16. src/mouse.cpp
  17. src/keyboard.cpp
  18. src/framebuffer.cpp
  19. src/resource.cpp
  20. src/options.cpp
  21. src/gl_core_3_3.c
  22. src/shader.cpp
  23. src/slopstates.cpp
  24. src/slop.cpp
  25. src/rectangle.cpp
  26. src/main.cpp )
  27. add_executable(${EXECUTABLE_NAME} ${source})
  28. # Detect and add SFML
  29. set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/modules" )
  30. #Find any version 2.X of SFML
  31. #See the FindSFML.cmake file for additional details and instructions
  32. find_package(OpenGL REQUIRED)
  33. find_package(GLM REQUIRED)
  34. find_package(GLX REQUIRED)
  35. find_package(X11 REQUIRED)
  36. include_directories(${X11_INCLUDE_DIR}
  37. ${GLM_INCLUDE_DIR}
  38. ${GLX_INCLUDE_DIR}
  39. ${OPENGL_INCLUDE_DIR})
  40. target_link_libraries(${EXECUTABLE_NAME} ${X11_LIBRARIES}
  41. ${GLX_LIBRARIES}
  42. ${OPENGL_LIBRARIES})
  43. # Install targets
  44. install( TARGETS ${EXECUTABLE_NAME} DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" )