SHARE
TWEET

Untitled

a guest Aug 6th, 2019 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. cmake_minimum_required(VERSION 3.12)
  2. project(OpenBrick)
  3.  
  4.  
  5. set(CMAKE_CXX_STANDARD 17)
  6. set(CMAKE_CXX_STANDARD_REQUIRED ON)
  7.  
  8. set(SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src")
  9. set(LIB_DIR "${CMAKE_CURRENT_SOURCE_DIR}/libs")
  10.  
  11.  
  12.  
  13. IF (WIN32)
  14.     # set stuff for windows  add_subdirectory(path/to/glfw)
  15.     include_directories(D:/Programmspeicher/glfw-3.3.bin.WIN64/include)
  16.     include_directories("D:/Repos/Openbrick/libs/glm")
  17. ELSE()
  18.     # set stuff for other systems
  19.     find_package(OpenGL REQUIRED)
  20.     if(OpenGL_FOUND)
  21.         link_directories(${OpenGL_LIBRARY_DIRS})
  22.         include_directories(${OpenGL_INCLUDE_DIRS})
  23.     endif(OpenGL_FOUND)
  24.     find_package(glfw3 REQUIRED)
  25.     include_directories(${GLFW_INCLUDE_DIRS})
  26. ENDIF()
  27.  
  28.  
  29.  
  30. #set(Boost_USE_MULTITHREADED     ON)
  31. #
  32. #find_package( Boost 1.54
  33. #    COMPONENTS
  34. #    program_options
  35. #    filesystem
  36. #    system
  37. #    thread
  38. #    serialization
  39. #    REQUIRED )
  40. #link_directories(${Boost_LIBRARY_DIR})
  41. #include_directories(${Boost_INCLUDE_DIRS})
  42. #add_definitions(${Boost_LIB_DIAGNOSTIC_DEFINITIONS})
  43. #if(APPLE)
  44. #endif()
  45.  
  46. set (openbrick_src
  47.         ${SRC_DIR}/main.cpp
  48.         ${SRC_DIR}/game/MainComponent.cpp
  49.         ${SRC_DIR}/game/Game.cpp
  50.         ${SRC_DIR}/game/StateBase.cpp
  51.         ${SRC_DIR}/renderer/RenderGL.cpp
  52.         ${SRC_DIR}/loader/Mesh.cpp
  53.         ${SRC_DIR}/loader/Shader.cpp
  54.         ${SRC_DIR}/input/Input.cpp
  55.         ${SRC_DIR}/util/Timer.cpp
  56.         ${SRC_DIR}/view/MainWindow.cpp)
  57.  
  58. set (openbrick_libs
  59.     #    ${Boost_PROGRAM_OPTIONS_LIBRARY}
  60.     #${Boost_SYSTEM_LIBRARY}
  61.     #${Boost_THREAD_LIBRARY}
  62.     #${Boost_FILESYSTEM_LIBRARY}
  63.     ${OPENGL_LIBRARY}
  64.         glfw
  65.     )
  66.  
  67. add_executable(${PROJECT_NAME} ${openbrick_src})
  68.  
  69. target_link_libraries(${PROJECT_NAME} ${openbrick_libs})
  70.  
  71. # glad
  72. set(GLAD_DIR "${LIB_DIR}/glad")
  73. add_library("glad" "${GLAD_DIR}/src/glad.c")
  74. target_include_directories("glad" PRIVATE "${GLAD_DIR}/include")
  75. target_include_directories(${PROJECT_NAME} PRIVATE "${GLAD_DIR}/include")
  76. target_link_libraries(${PROJECT_NAME} "glad" "${CMAKE_DL_LIBS}")
  77.  
  78.  
  79. # Turn on all warnings
  80. if(MSVC)
  81.   target_compile_options(${PROJECT_NAME} PRIVATE /W4)
  82. else()
  83.   target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -pedantic)
  84. endif()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top