From: Sylvain Beucler Date: Fri, 16 Mar 2012 21:39:37 +0000 (+0000) Subject: CMake: Declare OPTIONS higher in the file so they can be used to conditionaly include... X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=commitdiff_plain;h=e194bd1249867a1119e9e3f37e4e1a9886e956bc;p=freeglut CMake: Declare OPTIONS higher in the file so they can be used to conditionaly include source files git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1160 7f0cb862-5218-0410-a997-914c9d46530a --- diff --git a/CMakeLists.txt b/CMakeLists.txt index aec2c74..387a697 100644 --- a/CMakeLists.txt +++ b/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