From 946458568e437159b020be99912b620316de42a3 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Fri, 17 Sep 2010 00:59:36 +0200 Subject: [PATCH 1/5] Removed trailing whitespace. --- src/config.h.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/config.h.cmake b/src/config.h.cmake index 465fd645..6933ae73 100644 --- a/src/config.h.cmake +++ b/src/config.h.cmake @@ -1,8 +1,8 @@ /* Configure build time options of GLFW */ -/* Define this to 1 if XRandR is available */ -#cmakedefine _GLFW_HAS_XRANDR 1 -/* Define this to 1 if Xf86VidMode is available */ +/* Define this to 1 if XRandR is available */ +#cmakedefine _GLFW_HAS_XRANDR 1 +/* Define this to 1 if Xf86VidMode is available */ #cmakedefine _GLFW_HAS_XF86VIDMODE 1 /* Define this to 1 if glXGetProcAddress is available */ From b7dceecc538090e63fb4d789fd61cf7e14d18b6a Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Fri, 17 Sep 2010 04:22:48 +0200 Subject: [PATCH 2/5] Formatting. --- CMakeLists.txt | 81 +++++++++++++++++++++++--------------------------- 1 file changed, 38 insertions(+), 43 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 274ca811..69b0e17d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,7 @@ project(GLFW C) +cmake_minimum_required(VERSION 2.4) + set(GLFW_VERSION_MAJOR "3") set(GLFW_VERSION_MINOR "0") set(GLFW_VERSION_PATCH "0") @@ -8,27 +10,26 @@ set(GLFW_VERSION "${GLFW_VERSION_MAJOR}.${GLFW_VERSION_MINOR}") set(GLFW_VERSION_FULL "${GLFW_VERSION}.${GLFW_VERSION_PATCH}${GLFW_VERSION_EXTRA}") -cmake_minimum_required(VERSION 2.4) - include(CheckFunctionExists) include(CheckSymbolExists) -# Stuff common to all platform find_package(OpenGL REQUIRED) set(common_SOURCES - ${CMAKE_CURRENT_SOURCE_DIR}/src/enable.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/error.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/fullscreen.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/glext.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/init.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/input.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/joystick.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/time.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/window.c + ${GLFW_SOURCE_DIR}/src/enable.c + ${GLFW_SOURCE_DIR}/src/error.c + ${GLFW_SOURCE_DIR}/src/fullscreen.c + ${GLFW_SOURCE_DIR}/src/glext.c + ${GLFW_SOURCE_DIR}/src/init.c + ${GLFW_SOURCE_DIR}/src/input.c + ${GLFW_SOURCE_DIR}/src/joystick.c + ${GLFW_SOURCE_DIR}/src/time.c + ${GLFW_SOURCE_DIR}/src/window.c ) -# Stuff specific to WGL on Win32 +#-------------------------------------------------------------------- +# Set up GLFW for Win32 and WGL on Windows +#-------------------------------------------------------------------- if (WIN32) message(STATUS "Building GLFW for WGL on a Win32 system") @@ -41,7 +42,9 @@ if (WIN32) add_subdirectory(src/win32) endif (WIN32) -# Stuff specific to GLX on Unix-like platforms +#-------------------------------------------------------------------- +# Set up GLFW for Xlib and GLX on Unix-like systems with X Windows +#-------------------------------------------------------------------- if (UNIX AND NOT APPLE AND NOT CYGWIN) message(STATUS "Building GLFW for X11 and GLX on a Unix-like system") @@ -52,7 +55,6 @@ if (UNIX AND NOT APPLE AND NOT CYGWIN) list(APPEND GLFW_INCLUDE_DIR ${OPENGL_INCLUDE_DIR}) list(APPEND GLFW_LIBRARIES ${OPENGL_gl_LIBRARY}) - # Detect X11 extension include(${CMAKE_CURRENT_SOURCE_DIR}/CMake/CheckX11Extensions.cmake) # Check for XRandR (modern resolution switching extension) @@ -63,7 +65,7 @@ if (UNIX AND NOT APPLE AND NOT CYGWIN) list(APPEND GLFW_LIBRARIES ${X11_XRANDR_LIBRARIES}) endif(X11_XRANDR_FOUND) - # Check for xf86vidmode (fallback legacy resolution switching extension) + # Check for Xf86VidMode (fallback legacy resolution switching extension) if (NOT X11_XRANDR_FOUND) CHECK_X11_XF86VIDMODE() if (X11_XF86VIDMODE_FOUND) @@ -95,7 +97,9 @@ if (UNIX AND NOT APPLE AND NOT CYGWIN) add_subdirectory(src/x11) endif(UNIX AND NOT APPLE AND NOT CYGWIN) -# Stuff specific to AGL and CGL on Mac OS X +#-------------------------------------------------------------------- +# Set up GLFW for Cocoa and NSOpenGL on Mac OS X +#-------------------------------------------------------------------- if (UNIX AND APPLE) message(STATUS "Building GLFW for Cocoa and NSOpenGL on Mac OS X") @@ -113,10 +117,11 @@ if (UNIX AND APPLE) add_subdirectory(src/cocoa) endif(UNIX AND APPLE) +#-------------------------------------------------------------------- +# Add example and test programs +#-------------------------------------------------------------------- add_subdirectory(examples) add_subdirectory(tests) -#add_subdirectory(docs/doxygen) -#add_subdirectory(docs/manuals) #-------------------------------------------------------------------- # Create shared configuration header @@ -125,27 +130,16 @@ configure_file(${GLFW_SOURCE_DIR}/src/config.h.cmake ${GLFW_BINARY_DIR}/src/config.h @ONLY) #-------------------------------------------------------------------- -# -- Install standard files +# Install standard files #-------------------------------------------------------------------- -# Install the GLFW header file -install(DIRECTORY include/ DESTINATION include - PATTERN ".svn" EXCLUDE - PATTERN "include/*" -) +install(DIRECTORY include DESTINATION include + PATTERN include/GL/glfw3.h) -# Install documentation -install( - FILES - COPYING.txt - readme.html - DESTINATION - share/doc/glfw-${GLFW_VERSION_FULL}/ -) +install(FILES COPYING.txt readme.html + DESTINATION share/doc/glfw-${GLFW_VERSION_FULL}/) -#-------------------------------------------------------------------- -# -- Additional stuff -#-------------------------------------------------------------------- +# The respective port's CMakeLists.txt file installs the library #-------------------------------------------------------------------- # -- Documentation generation @@ -158,12 +152,13 @@ install( #add_subdirectory(docs) #-------------------------------------------------------------------- -# -- Uninstall operation -# ------------------------------------------------------------------- -configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in" - "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" +# Uninstall operation +#-------------------------------------------------------------------- +configure_file(${GLFW_SOURCE_DIR}/cmake_uninstall.cmake.in + ${GLFW_BINARY_DIR}/cmake_uninstall.cmake IMMEDIATE @ONLY) -add_custom_target(uninstall - "${CMAKE_COMMAND}" -P - "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") + +add_custom_target(uninstall + ${CMAKE_COMMAND} -P + ${GLFW_BINARY_DIR}/cmake_uninstall.cmake) From c1ef0a875daa2069c3d9ff887178a9ecb1b68350 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Fri, 17 Sep 2010 04:28:15 +0200 Subject: [PATCH 3/5] Fixed out-of-tree builds. --- src/cocoa/CMakeLists.txt | 3 ++- src/win32/CMakeLists.txt | 3 ++- src/x11/CMakeLists.txt | 9 ++++----- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/cocoa/CMakeLists.txt b/src/cocoa/CMakeLists.txt index 5c867591..37c3b0a8 100644 --- a/src/cocoa/CMakeLists.txt +++ b/src/cocoa/CMakeLists.txt @@ -4,7 +4,8 @@ configure_file( ${CMAKE_CURRENT_BINARY_DIR}/libglfw.pc @ONLY) include_directories(${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src + ${GLFW_SOURCE_DIR}/src + ${GLFW_BINARY_DIR}/src ${GLFW_INCLUDE_DIR}) set(cocoa_SOURCES diff --git a/src/win32/CMakeLists.txt b/src/win32/CMakeLists.txt index b4298567..9885ef3c 100644 --- a/src/win32/CMakeLists.txt +++ b/src/win32/CMakeLists.txt @@ -14,8 +14,9 @@ if(CYGWIN) endif(CYGWIN) -include_directories(${CMAKE_CURRENT_SOURCE_DIR} +include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${GLFW_SOURCE_DIR}/src + ${GLFW_BINARY_DIR}/src ${GLFW_INCLUDE_DIR}) set(libglfw_SOURCES diff --git a/src/x11/CMakeLists.txt b/src/x11/CMakeLists.txt index 654f8463..2e20dadc 100644 --- a/src/x11/CMakeLists.txt +++ b/src/x11/CMakeLists.txt @@ -3,11 +3,10 @@ configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/libglfw.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/libglfw.pc @ONLY) -include_directories( - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/.. - ${GLFW_INCLUDE_DIR}) +include_directories(${CMAKE_CURRENT_SOURCE_DIR} + ${GLFW_SOURCE_DIR}/src + ${GLFW_BINARY_DIR}/src + ${GLFW_INCLUDE_DIR}) set(libglfw_SOURCES ${common_SOURCES} From 8dfbce46fdcc63cfa1b02c7d7e305966eda3c7d4 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Sun, 19 Sep 2010 10:37:02 +0200 Subject: [PATCH 4/5] Added error reporting to glfwSetWindowParam. --- src/window.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/window.c b/src/window.c index b87d5853..167b7591 100644 --- a/src/window.c +++ b/src/window.c @@ -995,6 +995,7 @@ GLFWAPI int glfwGetWindowParam(GLFWwindow window, int param) case GLFW_OPENGL_PROFILE: return window->glProfile; default: + _glfwSetError(GLFW_INVALID_ENUM); return 0; } } From 16cf53bb6214649430d120fa90245622fc39c6f1 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Mon, 20 Sep 2010 00:38:06 +0200 Subject: [PATCH 5/5] Formatting. --- include/GL/glfw3.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/GL/glfw3.h b/include/GL/glfw3.h index c9750dee..a87d2852 100644 --- a/include/GL/glfw3.h +++ b/include/GL/glfw3.h @@ -396,7 +396,7 @@ typedef void (* GLFWcharfun)(GLFWwindow,int); * Prototypes *************************************************************************/ -/* GLFW initialization, termination and version querying */ +/* Initialization, termination and version querying */ GLFWAPI int glfwInit(void); GLFWAPI void glfwTerminate(void); GLFWAPI void glfwGetVersion(int* major, int* minor, int* rev);