SHARE
TWEET

Untitled

a guest Mar 10th, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. include(ExternalProject)
  2. ExternalProject_Add(glfw3-dl
  3.     PREFIX ${CMAKE_BINARY_DIR}/glfw-log
  4.     GIT_REPOSITORY https://github.com/glfw/glfw.git
  5.     GIT_TAG 3.2.1
  6.     SOURCE_DIR ${CMAKE_BINARY_DIR}/glfw
  7.     UPDATE_COMMAND ""
  8.     PATCH_COMMAND ""
  9.     INSTALL_DIR ${CMAKE_BINARY_DIR}/glfw
  10.     CMAKE_ARGS -DCMAKE_BUILD_TYPE:String={CMAKE_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=${LIB_DIR}/glfw
  11. )
  12.  
  13. ExternalProject_Add(glad-dl
  14.     PREFIX ${CMAKE_BINARY_DIR}/glad-log
  15.     GIT_REPOSITORY https://github.com/Dav1dde/glad.git
  16.     GIT_TAG v0.1.29
  17.     SOURCE_DIR ${CMAKE_BINARY_DIR}/glad
  18.     UPDATE_COMMAND ""
  19.     PATCH_COMMAND ""
  20.     INSTALL_DIR ${CMAKE_BINARY_DIR}/glad
  21.     CMAKE_ARGS -DCMAKE_BUILD_TYPE:String=${CMAKE_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=${LIB_DIR}/glad -DGLAD_INSTALL=True
  22.     #CONFIGURE_COMMAND ""
  23.     INSTALL_COMMAND
  24.         COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/glad-log/src/glad-dl-build/libglad.a ${LIB_DIR}/glad/lib/libglad.a
  25.         COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/glad-log/src/glad-dl-build/include ${LIB_DIR}/glad/include/
  26. )
  27.  
  28.  
  29. add_library(glad STATIC IMPORTED)
  30. set_target_properties(glad PROPERTIES IMPORTED_LOCATION ${LIB_DIR}/glad/lib/libglad.a)
  31.  
  32. add_library(glfw3 STATIC IMPORTED)
  33. set_target_properties(glfw3 PROPERTIES IMPORTED_LOCATION ${LIB_DIR}/glew/lib/libglfw3.a)
  34.  
  35. include_directories(${LIB_DIR}/glad/include ${LIB_DIR}/glfw/include)
  36. link_directories(${LIB_DIR}/glad/lib ${LIB_DIR}/glfw/lib)
  37.  
  38. add_executable(Test01 source/test/Test01.cpp)
  39. target_link_libraries(Test01 PRIVATE glad glfw3)
  40. add_dependencies(Test01 glfw3-dl glad-dl)
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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top