updated list of cmake switches in README.cmake
[freeglut] / CMakeLists.txt
index c71dea9..98e9289 100644 (file)
@@ -21,6 +21,11 @@ set(VERSION_PATCH 0)
 # Update fg_version.h to match the versions number here in cmake
 CONFIGURE_FILE(src/fg_version.h.in src/fg_version.h)
 
+# shared lib version numbers (change before release)
+set(SO_MAJOR 3)                # increment on backwards incompatible API/ABI changes
+set(SO_MINOR 10)       # increment on backwards compatible or internal changes
+set(SO_REV 0)          # if nothing else changed increment this
+
 # FREEGLUT_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
@@ -44,6 +49,11 @@ ENDIF()
 # OpenGL ES support
 OPTION(FREEGLUT_GLES "Use OpenGL ES (requires EGL)" OFF)
 
+# option to build either as "glut" (ON) or "freeglut" (OFF)
+IF(NOT WIN32)
+    OPTION(FREEGLUT_REPLACE_GLUT "Be a replacement for GLUT" ON)
+ENDIF()
+
 
 SET(FREEGLUT_HEADERS
     include/GL/freeglut.h
@@ -360,18 +370,23 @@ ELSE()
     #   or special-cased FreeGLUT long ago (e.g. .so.4 on OpenBSD), so
     #   the lack of support for current:revision:age in CMake should
     #   not be a problem.
-    # - the output library should be named glut so it'll be linkable with -lglut
+       # - the output library should be named glut so it'll be linkable with -lglut
+       #   (unless FREEGLUT_REPLACE_GLUT is false).
     # - the shared library should link to the dependency libraries so that the user
     #   won't have to link them explicitly (they shouldn't have to know that we depend
     #   on Xrandr or Xxf86vm)
     IF(FREEGLUT_GLES)
-      SET(LIBNAME freeglut-gles)
+               SET(LIBNAME freeglut-gles)
     ELSE()
-      SET(LIBNAME glut)
-    ENDIF()
+               IF(FREEGLUT_REPLACE_GLUT)
+                       SET(LIBNAME glut)
+               ELSE()
+                       SET(LIBNAME freeglut)
+               ENDIF()
+       ENDIF()
 
     IF(FREEGLUT_BUILD_SHARED_LIBS)
-      SET_TARGET_PROPERTIES(freeglut PROPERTIES VERSION 3.9.0 SOVERSION 3 OUTPUT_NAME ${LIBNAME})
+      SET_TARGET_PROPERTIES(freeglut PROPERTIES VERSION ${SO_MAJOR}.${SO_MINOR}.${SO_REV} SOVERSION ${SO_MAJOR} OUTPUT_NAME ${LIBNAME})
     ENDIF()
     IF(FREEGLUT_BUILD_STATIC_LIBS)
       SET_TARGET_PROPERTIES(freeglut_static PROPERTIES OUTPUT_NAME ${LIBNAME})