Version bump in cmake, that should have been done for 3.2.0. Changed SO_MINOR
[freeglut] / CMakeLists.txt
index 8569707..0c10a56 100644 (file)
@@ -18,7 +18,7 @@ SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
 # setup version numbers
 # TODO: Update these for each release!
 set(VERSION_MAJOR 3)
-set(VERSION_MINOR 0)
+set(VERSION_MINOR 2)
 set(VERSION_PATCH 0)
 set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
 
@@ -27,7 +27,7 @@ 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_MINOR 11)       # 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
@@ -68,10 +68,15 @@ ENDIF()
 
 SET(FREEGLUT_HEADERS
     include/GL/freeglut.h
+    include/GL/freeglut_ucall.h
     include/GL/freeglut_ext.h
     include/GL/freeglut_std.h
-    include/GL/glut.h
 )
+IF(FREEGLUT_REPLACE_GLUT)
+    LIST(APPEND FREEGLUT_SRCS
+        include/GL/glut.h
+    )
+ENDIF()
 SET(FREEGLUT_SRCS
     ${FREEGLUT_HEADERS}
     src/fg_callbacks.c
@@ -86,6 +91,7 @@ SET(FREEGLUT_SRCS
     src/fg_init.c
     src/fg_init.h
     src/fg_internal.h
+    src/fg_callback_macros.h
     src/fg_input_devices.c
     src/fg_joystick.c
     src/fg_main.c
@@ -306,8 +312,8 @@ ENDIF(CMAKE_COMPILER_IS_GNUCC)
 INCLUDE(CheckIncludeFiles)
 IF(UNIX AND NOT(ANDROID OR BLACKBERRY OR FREEGLUT_WAYLAND))
     FIND_PACKAGE(X11 REQUIRED)
-    INCLUDE_DIRECTORIES(${X11_INCLUDE_DIR})
-    LIST(APPEND LIBS ${X11_LIBRARIES})
+    INCLUDE_DIRECTORIES(${X11_X11_INCLUDE_PATH})
+    LIST(APPEND LIBS ${X11_X11_LIB})
     IF(X11_Xrandr_FOUND)
         SET(HAVE_X11_EXTENSIONS_XRANDR_H TRUE)
         LIST(APPEND LIBS ${X11_Xrandr_LIB})
@@ -320,6 +326,8 @@ IF(UNIX AND NOT(ANDROID OR BLACKBERRY OR FREEGLUT_WAYLAND))
         # Needed for multi-touch:
         CHECK_INCLUDE_FILES("${X11_Xinput_INCLUDE_PATH}/X11/extensions/XInput2.h" HAVE_X11_EXTENSIONS_XINPUT2_H)
         LIST(APPEND LIBS ${X11_Xinput_LIB})
+    ELSE()
+        MESSAGE(FATAL_ERROR "Missing X11's XInput.h (X11/extensions/XInput.h)")
     ENDIF()
 ENDIF()
 IF(ANDROID)
@@ -428,18 +436,18 @@ 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
-       #   (unless FREEGLUT_REPLACE_GLUT is false).
+    # - 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()
-               IF(FREEGLUT_REPLACE_GLUT)
-                       SET(LIBNAME glut)
-               ENDIF()
-       ENDIF()
+        IF(FREEGLUT_REPLACE_GLUT)
+            SET(LIBNAME glut)
+        ENDIF()
+    ENDIF()
 
     IF(FREEGLUT_BUILD_SHARED_LIBS)
       SET_TARGET_PROPERTIES(freeglut PROPERTIES VERSION ${SO_MAJOR}.${SO_MINOR}.${SO_REV} SOVERSION ${SO_MAJOR} OUTPUT_NAME ${LIBNAME})
@@ -455,7 +463,9 @@ ELSE()
         # '-O0 -gstabs+' helps the currently buggy GDB port
         # Too late to manipulate ENV: SET(ENV{CFLAGS} "$ENV{CFLAGS} -mandroid")
         # Not using _INIT variables, they seem to be used internally only
-        SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mandroid")
+        IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
+            SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mandroid")
+        ENDIF()
         SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -gstabs+")
     ENDIF()
 ENDIF()
@@ -476,10 +486,17 @@ IF(FREEGLUT_BUILD_SHARED_LIBS)
             INCLUDES DESTINATION include
     )
     IF(INSTALL_PDB)
-        INSTALL(FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Debug/freeglut${CMAKE_DEBUG_POSTFIX}.pdb
-            DESTINATION bin
-                       CONFIGURATIONS Debug
-            COMPONENT Devel)
+        IF(CMAKE_GENERATOR MATCHES "^Visual Studio")
+            INSTALL(FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Debug/freeglut${CMAKE_DEBUG_POSTFIX}.pdb
+                DESTINATION bin
+                CONFIGURATIONS Debug
+                COMPONENT Devel)
+        ELSE()
+            INSTALL(FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/freeglut${CMAKE_DEBUG_POSTFIX}.pdb
+                DESTINATION bin
+                CONFIGURATIONS Debug
+                COMPONENT Devel)
+        ENDIF()
     ENDIF()
 ENDIF()
 IF(FREEGLUT_BUILD_STATIC_LIBS)
@@ -545,6 +562,7 @@ IF(UNIX)
 ENDIF()
 ADD_DEMO(subwin          progs/demos/subwin/subwin.c)
 ADD_DEMO(timer           progs/demos/timer/timer.c)
+ADD_DEMO(timer_callback  progs/demos/timer_callback/timer.c)