From cb3dea2183ad4a4ad15a60c61aee999d57d4539c Mon Sep 17 00:00:00 2001 From: beuc Date: Fri, 16 Mar 2012 21:39:37 +0000 Subject: [PATCH] CMake: Declare OPTIONS higher in the file so they can be used to conditionaly include source files git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1160 7f0cb862-5218-0410-a997-914c9d46530a --- freeglut/freeglut/CMakeLists.txt | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/freeglut/freeglut/CMakeLists.txt b/freeglut/freeglut/CMakeLists.txt index aec2c74..387a697 100644 --- a/freeglut/freeglut/CMakeLists.txt +++ b/freeglut/freeglut/CMakeLists.txt @@ -18,6 +18,17 @@ set(VERSION_MINOR 0) set(VERSION_PATCH 0) +# BUILD_SHARED_LIBS is already a standard CMake variable, but we need to +# re-declare it here so it will show up in the GUI. +# by default, we want to build both +OPTION(BUILD_SHARED_LIBS "Build FreeGLUT shared library." ON) +OPTION(BUILD_STATIC_LIBS "Build FreeGLUT static library." ON) + +# OpenGL ES support +OPTION(FREEGLUT_GLES1 "Use OpenGL ES 1.x (requires EGL)" OFF) +OPTION(FREEGLUT_GLES2 "Use OpenGL ES 2.x (requires EGL) (overrides BUILD_GLES1)" OFF) + + SET(FREEGLUT_HEADERS include/GL/freeglut.h include/GL/freeglut_ext.h @@ -47,9 +58,8 @@ SET(FREEGLUT_SRCS src/fg_videoresize.c src/fg_window.c ) -# Android port requires adding a version of these compatible with -# OpenGL ES (TODO): -IF(NOT ANDROID) +# TODO: OpenGL ES requires a compatible version of these files: +IF(NOT FREEGLUT_GLES2 AND NOT FREEGLUT_GLES1) LIST(APPEND FREEGLUT_SRCS src/fg_font.c src/fg_geometry.c @@ -124,16 +134,6 @@ ELSE() ) ENDIF() -# BUILD_SHARED_LIBS is already a standard CMake variable, but we need to -# re-declare it here so it will show up in the GUI. -# by default, we want to build both -OPTION(BUILD_SHARED_LIBS "Build FreeGLUT shared library." ON) -OPTION(BUILD_STATIC_LIBS "Build FreeGLUT static library." ON) - -# OpenGL ES support -OPTION(FREEGLUT_GLES1 "Use OpenGL ES 1.x (requires EGL)" OFF) -OPTION(FREEGLUT_GLES2 "Use OpenGL ES 2.x (requires EGL) (overrides BUILD_GLES1)" OFF) - # For OpenGL ES (GLES): # - compile with -DFREEGLUT_GLES1 and -DFREEGLUT_GLES2 to cleanly # bootstrap headers inclusion in freeglut_std.h; these constants