Merge branch 'master' of ssh://glfw.git.sourceforge.net/gitroot/glfw/glfw

This commit is contained in:
Camilla Berglund 2010-09-20 01:38:23 +02:00
commit 20b708541f
7 changed files with 51 additions and 54 deletions

View File

@ -1,5 +1,7 @@
project(GLFW C) project(GLFW C)
cmake_minimum_required(VERSION 2.4)
set(GLFW_VERSION_MAJOR "3") set(GLFW_VERSION_MAJOR "3")
set(GLFW_VERSION_MINOR "0") set(GLFW_VERSION_MINOR "0")
set(GLFW_VERSION_PATCH "0") set(GLFW_VERSION_PATCH "0")
@ -8,27 +10,26 @@ set(GLFW_VERSION "${GLFW_VERSION_MAJOR}.${GLFW_VERSION_MINOR}")
set(GLFW_VERSION_FULL set(GLFW_VERSION_FULL
"${GLFW_VERSION}.${GLFW_VERSION_PATCH}${GLFW_VERSION_EXTRA}") "${GLFW_VERSION}.${GLFW_VERSION_PATCH}${GLFW_VERSION_EXTRA}")
cmake_minimum_required(VERSION 2.4)
include(CheckFunctionExists) include(CheckFunctionExists)
include(CheckSymbolExists) include(CheckSymbolExists)
# Stuff common to all platform
find_package(OpenGL REQUIRED) find_package(OpenGL REQUIRED)
set(common_SOURCES set(common_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/src/enable.c ${GLFW_SOURCE_DIR}/src/enable.c
${CMAKE_CURRENT_SOURCE_DIR}/src/error.c ${GLFW_SOURCE_DIR}/src/error.c
${CMAKE_CURRENT_SOURCE_DIR}/src/fullscreen.c ${GLFW_SOURCE_DIR}/src/fullscreen.c
${CMAKE_CURRENT_SOURCE_DIR}/src/glext.c ${GLFW_SOURCE_DIR}/src/glext.c
${CMAKE_CURRENT_SOURCE_DIR}/src/init.c ${GLFW_SOURCE_DIR}/src/init.c
${CMAKE_CURRENT_SOURCE_DIR}/src/input.c ${GLFW_SOURCE_DIR}/src/input.c
${CMAKE_CURRENT_SOURCE_DIR}/src/joystick.c ${GLFW_SOURCE_DIR}/src/joystick.c
${CMAKE_CURRENT_SOURCE_DIR}/src/time.c ${GLFW_SOURCE_DIR}/src/time.c
${CMAKE_CURRENT_SOURCE_DIR}/src/window.c ${GLFW_SOURCE_DIR}/src/window.c
) )
# Stuff specific to WGL on Win32 #--------------------------------------------------------------------
# Set up GLFW for Win32 and WGL on Windows
#--------------------------------------------------------------------
if (WIN32) if (WIN32)
message(STATUS "Building GLFW for WGL on a Win32 system") message(STATUS "Building GLFW for WGL on a Win32 system")
@ -41,7 +42,9 @@ if (WIN32)
add_subdirectory(src/win32) add_subdirectory(src/win32)
endif (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) if (UNIX AND NOT APPLE AND NOT CYGWIN)
message(STATUS "Building GLFW for X11 and GLX on a Unix-like system") 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_INCLUDE_DIR ${OPENGL_INCLUDE_DIR})
list(APPEND GLFW_LIBRARIES ${OPENGL_gl_LIBRARY}) list(APPEND GLFW_LIBRARIES ${OPENGL_gl_LIBRARY})
# Detect X11 extension
include(${CMAKE_CURRENT_SOURCE_DIR}/CMake/CheckX11Extensions.cmake) include(${CMAKE_CURRENT_SOURCE_DIR}/CMake/CheckX11Extensions.cmake)
# Check for XRandR (modern resolution switching extension) # 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}) list(APPEND GLFW_LIBRARIES ${X11_XRANDR_LIBRARIES})
endif(X11_XRANDR_FOUND) 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) if (NOT X11_XRANDR_FOUND)
CHECK_X11_XF86VIDMODE() CHECK_X11_XF86VIDMODE()
if (X11_XF86VIDMODE_FOUND) if (X11_XF86VIDMODE_FOUND)
@ -95,7 +97,9 @@ if (UNIX AND NOT APPLE AND NOT CYGWIN)
add_subdirectory(src/x11) add_subdirectory(src/x11)
endif(UNIX AND NOT APPLE AND NOT CYGWIN) 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) if (UNIX AND APPLE)
message(STATUS "Building GLFW for Cocoa and NSOpenGL on Mac OS X") message(STATUS "Building GLFW for Cocoa and NSOpenGL on Mac OS X")
@ -113,10 +117,11 @@ if (UNIX AND APPLE)
add_subdirectory(src/cocoa) add_subdirectory(src/cocoa)
endif(UNIX AND APPLE) endif(UNIX AND APPLE)
#--------------------------------------------------------------------
# Add example and test programs
#--------------------------------------------------------------------
add_subdirectory(examples) add_subdirectory(examples)
add_subdirectory(tests) add_subdirectory(tests)
#add_subdirectory(docs/doxygen)
#add_subdirectory(docs/manuals)
#-------------------------------------------------------------------- #--------------------------------------------------------------------
# Create shared configuration header # Create shared configuration header
@ -125,27 +130,16 @@ configure_file(${GLFW_SOURCE_DIR}/src/config.h.cmake
${GLFW_BINARY_DIR}/src/config.h @ONLY) ${GLFW_BINARY_DIR}/src/config.h @ONLY)
#-------------------------------------------------------------------- #--------------------------------------------------------------------
# -- Install standard files # Install standard files
#-------------------------------------------------------------------- #--------------------------------------------------------------------
# Install the GLFW header file install(DIRECTORY include DESTINATION include
install(DIRECTORY include/ DESTINATION include PATTERN include/GL/glfw3.h)
PATTERN ".svn" EXCLUDE
PATTERN "include/*"
)
# Install documentation install(FILES COPYING.txt readme.html
install( DESTINATION share/doc/glfw-${GLFW_VERSION_FULL}/)
FILES
COPYING.txt
readme.html
DESTINATION
share/doc/glfw-${GLFW_VERSION_FULL}/
)
#-------------------------------------------------------------------- # The respective port's CMakeLists.txt file installs the library
# -- Additional stuff
#--------------------------------------------------------------------
#-------------------------------------------------------------------- #--------------------------------------------------------------------
# -- Documentation generation # -- Documentation generation
@ -158,12 +152,13 @@ install(
#add_subdirectory(docs) #add_subdirectory(docs)
#-------------------------------------------------------------------- #--------------------------------------------------------------------
# -- Uninstall operation # Uninstall operation
# ------------------------------------------------------------------- #--------------------------------------------------------------------
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in" configure_file(${GLFW_SOURCE_DIR}/cmake_uninstall.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" ${GLFW_BINARY_DIR}/cmake_uninstall.cmake
IMMEDIATE @ONLY) IMMEDIATE @ONLY)
add_custom_target(uninstall
"${CMAKE_COMMAND}" -P add_custom_target(uninstall
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") ${CMAKE_COMMAND} -P
${GLFW_BINARY_DIR}/cmake_uninstall.cmake)

View File

@ -397,7 +397,7 @@ typedef void (* GLFWcharfun)(GLFWwindow,int);
* Prototypes * Prototypes
*************************************************************************/ *************************************************************************/
/* GLFW initialization, termination and version querying */ /* Initialization, termination and version querying */
GLFWAPI int glfwInit(void); GLFWAPI int glfwInit(void);
GLFWAPI void glfwTerminate(void); GLFWAPI void glfwTerminate(void);
GLFWAPI void glfwGetVersion(int* major, int* minor, int* rev); GLFWAPI void glfwGetVersion(int* major, int* minor, int* rev);

View File

@ -4,7 +4,8 @@ configure_file(
${CMAKE_CURRENT_BINARY_DIR}/libglfw.pc @ONLY) ${CMAKE_CURRENT_BINARY_DIR}/libglfw.pc @ONLY)
include_directories(${CMAKE_CURRENT_SOURCE_DIR} include_directories(${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/src ${GLFW_SOURCE_DIR}/src
${GLFW_BINARY_DIR}/src
${GLFW_INCLUDE_DIR}) ${GLFW_INCLUDE_DIR})
set(cocoa_SOURCES set(cocoa_SOURCES

View File

@ -16,6 +16,7 @@ endif(CYGWIN)
include_directories(${CMAKE_CURRENT_SOURCE_DIR} include_directories(${CMAKE_CURRENT_SOURCE_DIR}
${GLFW_SOURCE_DIR}/src ${GLFW_SOURCE_DIR}/src
${GLFW_BINARY_DIR}/src
${GLFW_INCLUDE_DIR}) ${GLFW_INCLUDE_DIR})
set(libglfw_SOURCES set(libglfw_SOURCES

View File

@ -1016,6 +1016,7 @@ GLFWAPI int glfwGetWindowParam(GLFWwindow window, int param)
case GLFW_OPENGL_PROFILE: case GLFW_OPENGL_PROFILE:
return window->glProfile; return window->glProfile;
default: default:
_glfwSetError(GLFW_INVALID_ENUM);
return 0; return 0;
} }
} }

View File

@ -3,11 +3,10 @@ configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/libglfw.pc.cmake ${CMAKE_CURRENT_SOURCE_DIR}/libglfw.pc.cmake
${CMAKE_CURRENT_BINARY_DIR}/libglfw.pc @ONLY) ${CMAKE_CURRENT_BINARY_DIR}/libglfw.pc @ONLY)
include_directories( include_directories(${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR} ${GLFW_SOURCE_DIR}/src
${CMAKE_CURRENT_SOURCE_DIR} ${GLFW_BINARY_DIR}/src
${CMAKE_CURRENT_SOURCE_DIR}/.. ${GLFW_INCLUDE_DIR})
${GLFW_INCLUDE_DIR})
set(libglfw_SOURCES set(libglfw_SOURCES
${common_SOURCES} ${common_SOURCES}