IF(WIN32)
# hide insecure CRT warnings, common practice
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
+ IF(MSVC)
+ SET( CMAKE_DEBUG_POSTFIX "d" )
+ ENDIF(MSVC)
+
ENDIF()
IF(CMAKE_COMPILER_IS_GNUCC)
ENDIF()
ENDIF(CMAKE_COMPILER_IS_GNUCC)
+INCLUDE(CheckIncludeFiles)
IF(UNIX AND NOT ANDROID)
FIND_PACKAGE(X11 REQUIRED)
LIST(APPEND LIBS ${X11_LIBRARIES})
ENDIF()
LIST(APPEND LIBS ${X11_Xxf86vm_LIB})
ENDIF()
+ IF(X11_Xinput_FOUND)
+ # 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})
+ ENDIF()
ENDIF()
IF(ANDROID)
# -landroid for ANativeWindow
LIST(APPEND LIBS android log)
ENDIF()
-INCLUDE(CheckIncludeFiles)
INCLUDE(CheckFunctionExists)
INCLUDE(CheckTypeSize)
CHECK_INCLUDE_FILES(sys/types.h HAVE_SYS_TYPES_H)
CHECK_INCLUDE_FILES(fcntl.h HAVE_FCNTL_H)
CHECK_INCLUDE_FILES(errno.h HAVE_ERRNO_H)
CHECK_INCLUDE_FILES(usbhid.h HAVE_USBHID_H)
-CHECK_FUNCTION_EXISTS(sinf HAVE_SINF)
-CHECK_FUNCTION_EXISTS(cosf HAVE_COSF)
-CHECK_FUNCTION_EXISTS(sqrtf HAVE_SQRTF)
CHECK_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY)
CHECK_FUNCTION_EXISTS(vfprintf HAVE_VFPRINTF)
CHECK_FUNCTION_EXISTS(_doprnt HAVE_DOPRNT)
# http://sourceware.org/autobook/autobook/autobook_91.html#SEC91
# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
# Current: -version-info 12:0:9 -> 3.9.0
+ # Note: most platforms now prefer the latter major.minor.revision form
+ # (e.g. FreeBSD, cf. http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8765),
+ # 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 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
IF(BUILD_SHARED_LIBS)
ADD_EXECUTABLE(${name} ${ARGN})
TARGET_LINK_LIBRARIES(${name} ${DEMO_LIBS} freeglut)
+ IF(WIN32 AND MSVC)
+ SET_TARGET_PROPERTIES(${name} PROPERTIES DEBUG_POSTFIX d)
+ ENDIF()
ENDIF()
IF(BUILD_STATIC_LIBS)
ADD_EXECUTABLE(${name}_static ${ARGN})
TARGET_LINK_LIBRARIES(${name}_static ${DEMO_LIBS} freeglut_static)
SET_TARGET_PROPERTIES(${name}_static PROPERTIES COMPILE_FLAGS -DFREEGLUT_STATIC)
+ IF(WIN32 AND MSVC)
+ SET_TARGET_PROPERTIES(${name}_static PROPERTIES DEBUG_POSTFIX d)
+ ENDIF()
ENDIF()
ENDIF()
ENDMACRO()
ADD_DEMO(Lorenz progs/demos/Lorenz/lorenz.c)
ADD_DEMO(One progs/demos/One/one.c)
ADD_DEMO(Resizer progs/demos/Resizer/Resizer.cpp)
-ADD_DEMO(shapes progs/demos/shapes/shapes.c)
+ADD_DEMO(multi-touch progs/demos/multi-touch/multi-touch.c)
+ADD_DEMO(shapes progs/demos/shapes/shapes.c
+ progs/demos/shapes/glmatrix.h
+ progs/demos/shapes/glmatrix.c)
ADD_DEMO(smooth_opengl3 progs/demos/smooth_opengl3/smooth_opengl3.c)
-ADD_DEMO(spaceball progs/demos/spaceball/spaceball.c
- progs/demos/spaceball/vmath.c
- progs/demos/spaceball/vmath.h)
+IF(UNIX)
+ ADD_DEMO(spaceball progs/demos/spaceball/spaceball.c
+ progs/demos/spaceball/vmath.c
+ progs/demos/spaceball/vmath.h)
+ENDIF()
ADD_DEMO(subwin progs/demos/subwin/subwin.c)
ADD_DEMO(timer progs/demos/timer/timer.c)