Last active
June 22, 2020 13:00
-
-
Save danielpclin/d76cfb054e4ad9ad99ff1ca61257f567 to your computer and use it in GitHub Desktop.
Revisions
-
danielpclin revised this gist
Jun 22, 2020 . 1 changed file with 13 additions and 18 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,33 +12,28 @@ set(GLEW_DIR dependencies/glew) ExternalProject_Add( GLEW PREFIX "${CMAKE_CURRENT_BINARY_DIR}/glew" URL "https://sourceforge.net/projects/glew/files/glew/2.2.0/glew-2.2.0.zip/download" SOURCE_SUBDIR "build/cmake" CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${PROJECT_SOURCE_DIR}/${GLEW_DIR}" ) add_library(GLEW_LIB STATIC IMPORTED REQUIRED) set_target_properties(GLEW_LIB PROPERTIES IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/${GLEW_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}glew32${CMAKE_STATIC_LIBRARY_SUFFIX}) include_directories(${PROJECT_NAME} ${GLEW_DIR}/include) target_link_libraries(${PROJECT_NAME} ${OPENGL_LIBRARIES} GLEW_LIB) add_dependencies(${PROJECT_NAME} GLEW) # GLEW END # GLFW set(GLFW_DIR dependencies/glfw) ExternalProject_Add( GLFW PREFIX "${CMAKE_CURRENT_BINARY_DIR}/glfw" URL "https://github.com/glfw/glfw/releases/download/3.3.2/glfw-3.3.2.zip" CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${PROJECT_SOURCE_DIR}/${GLFW_DIR}" ) add_library(GLFW_LIB STATIC IMPORTED REQUIRED) set_target_properties(GLFW_LIB PROPERTIES IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/${GLFW_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}glfw3${CMAKE_STATIC_LIBRARY_SUFFIX}) include_directories(${PROJECT_NAME} ${GLFW_DIR}/include) target_link_libraries(${PROJECT_NAME} GLFW_LIB) add_dependencies(${PROJECT_NAME} GLFW) # GLFW END -
danielpclin created this gist
Jun 22, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,44 @@ cmake_minimum_required(VERSION 3.16) include(ExternalProject) project(OpenGL_Practice) set(CMAKE_CXX_STANDARD 14) add_executable(OpenGL_Practice main.cpp) # GLEW find_package(OpenGL REQUIRED) set(GLEW_DIR dependencies/glew) ExternalProject_Add( GLEW PREFIX "${CMAKE_CURRENT_BINARY_DIR}/glew" URL https://sourceforge.net/projects/glew/files/glew/2.2.0/glew-2.2.0.zip/download SOURCE_SUBDIR "build/cmake" CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${OpenGL_Practice_SOURCE_DIR}/${GLEW_DIR}" ) find_library(GLEW_LIB NAMES glew32 PATHS ${OpenGL_Practice_SOURCE_DIR}/${GLEW_DIR}/lib REQUIRED) include_directories(${PROJECT_NAME} ${GLEW_DIR}/include) target_link_libraries(${PROJECT_NAME} ${OPENGL_LIBRARIES} ${GLEW_LIB}) add_dependencies(${PROJECT_NAME} GLEW) # GLEW END # GLFW set(dir_glfw dependencies/glfw) ExternalProject_Add( GLFW PREFIX "${CMAKE_CURRENT_BINARY_DIR}/glfw" URL https://github.com/glfw/glfw/releases/download/3.3.2/glfw-3.3.2.zip CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${OpenGL_Practice_SOURCE_DIR}/${dir_glfw}" ) find_library(GLFW_LIB NAMES glfw3 PATHS ${OpenGL_Practice_SOURCE_DIR}/${dir_glfw}/lib REQUIRED) include_directories(${PROJECT_NAME} ${dir_glfw}/include) target_link_libraries(${PROJECT_NAME} ${GLFW_LIB}) add_dependencies(${PROJECT_NAME} GLFW) # GLFW END