-
Notifications
You must be signed in to change notification settings - Fork 674
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
307519d
commit 7aa79cc
Showing
3 changed files
with
72 additions
and
34 deletions.
There are no files selected for viewing
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,71 @@ | ||
cmake_minimum_required(VERSION 3.6) | ||
project (OpenGLExamples) | ||
|
||
set(CMAKE_BINARY_DIR ${CMAKE_SOURCE_DIR}/build) | ||
|
||
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}) | ||
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}) | ||
|
||
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/build) | ||
set(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/lib) | ||
|
||
# Set Variables for include and linking depending on platform | ||
|
||
IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") | ||
# Mac OS X | ||
|
||
# Support only desktop | ||
|
||
SET(Processor "x64") | ||
SET(OperatingSystem "Darwin") | ||
SET(Compiler "GCC") | ||
|
||
ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux") | ||
# Linux | ||
|
||
IF(${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm") | ||
# Raspberry Pi and i.MX6 | ||
|
||
IF(${SoC} MATCHES "iMX6") | ||
# i.MX6 | ||
|
||
# Everything is in /usr/include | ||
|
||
ELSE() | ||
# Raspberry Pi | ||
ENDIF() | ||
|
||
ELSE() | ||
# Support only desktop | ||
|
||
SET(Processor "x64") | ||
SET(OperatingSystem "Linux") | ||
SET(Compiler "GCC") | ||
|
||
ENDIF() | ||
|
||
ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "Windows") | ||
# Windows | ||
|
||
SET(Processor "x86") | ||
SET(OperatingSystem "Windows") | ||
SET(Compiler "MSVC") | ||
set(LIBRARIES_TO_LINK OpenGL32.lib glew32s.lib glfw3.lib) | ||
|
||
ENDIF() | ||
|
||
# set GLFW valiables | ||
# set(BUILD_SHARED_LIBS "Build shared libraries" OFF) | ||
set(GLFW_BUILD_EXAMPLES OFF) | ||
set(GLFW_BUILD_TESTS OFF) | ||
set(GLFW_BUILD_DOCS OFF) | ||
set(GLFW_INSTALL OFF) | ||
|
||
# set GLUS variables | ||
set(ENV_DIR ${Processor}/${OperatingSystem}/${Compiler}) | ||
set(EXTERNAL_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/External/${ENV_DIR}/include) | ||
set(EXTERNAL_LIB_DIR ${CMAKE_SOURCE_DIR}/External/${ENV_DIR}/lib) | ||
|
||
include_directories(${EXTERNAL_INCLUDE_DIR}) | ||
link_directories(${EXTERNAL_LIB_DIR} ${LIBRARY_OUTPUT_PATH}) | ||
|
||
add_subdirectory(GLUS) | ||
add_subdirectory(GLFW) | ||
|
||
|
||
add_subdirectory(Example01) |
This file contains 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 characters
This file contains 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 characters