CMakeLists.txt 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #Change this if you need to target a specific CMake version
  2. cmake_minimum_required(VERSION 3.1)
  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_CXX_STANDARD 14)
  10. set(CMAKE_CXX_STANDARD_REQUIRED on)
  11. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -Wall -Wno-missing-braces")
  12. set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin/")
  13. include_directories("${PROJECT_BINARY_DIR}")
  14. # Define sources and executable
  15. set(EXECUTABLE_NAME "slop")
  16. set( source src/x.cpp
  17. src/window.cpp
  18. src/windowhelper.cpp
  19. src/mouse.cpp
  20. src/keyboard.cpp
  21. src/framebuffer.cpp
  22. src/resource.cpp
  23. src/options.cpp
  24. src/gl_core_3_3.c
  25. src/shader.cpp
  26. src/slopstates.cpp
  27. src/slop.cpp
  28. src/rectangle.cpp
  29. src/main.cpp )
  30. add_executable(${EXECUTABLE_NAME} ${source})
  31. # Detect and add SFML
  32. set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/modules" )
  33. #Find any version 2.X of SFML
  34. #See the FindSFML.cmake file for additional details and instructions
  35. find_package(OpenGL REQUIRED)
  36. find_package(GLM REQUIRED)
  37. find_package(GLX REQUIRED)
  38. find_package(X11 REQUIRED)
  39. find_package(XExt REQUIRED)
  40. include_directories(${X11_INCLUDE_DIR}
  41. ${GLM_INCLUDE_DIR}
  42. ${GLX_INCLUDE_DIR}
  43. ${OPENGL_INCLUDE_DIR})
  44. target_link_libraries(${EXECUTABLE_NAME} ${X11_LIBRARIES}
  45. ${GLX_LIBRARIES}
  46. ${OPENGL_LIBRARIES})
  47. # Install targets
  48. install( TARGETS ${EXECUTABLE_NAME} DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" )