Permalink
Browse files

GLFW: new FindGLFW module to find the glfw library. Fixed CMakeLists.…

…txt. Fixed samples. Enabled in addons/CMakesLists.txt
  • Loading branch information...
1 parent 9d6405f commit e062a33eb9785794968699274e02e91fe4bedb87 @omf omf committed Mar 27, 2011
View
@@ -59,7 +59,7 @@ add_subdirectory(Facebook)
add_subdirectory(Flux)
add_subdirectory(Fnmatch)
add_subdirectory(Font)
-#add_subdirectory(GLFW) # XXX: Can't meet dependencies
+add_subdirectory(GLFW) # XXX: Can't meet dependencies
add_subdirectory(GoogleSearch)
add_subdirectory(HttpClient)
add_subdirectory(Image)
@@ -73,7 +73,7 @@ add_subdirectory(MD5)
add_subdirectory(MySQL)
#add_subdirectory(NetworkAdapter)
add_subdirectory(NotificationCenter)
-add_subdirectory(Oauth) # OAuth should no longer break CMake configuration on Windows now.
+#add_subdirectory(Oauth) # OAuth should no longer break CMake configuration on Windows now.
#add_subdirectory(ODE) # XXX: Can't meet dependencies
#add_subdirectory(ObjcBridge) # XXX: Broken for me -- Objective-C 2.0 not supported
add_subdirectory(Obsidian)
View
@@ -4,6 +4,7 @@
# Builds the GLFW addon
# Find GLFW
+find_package(GLFW)
find_package(OpenGL)
find_package(GLUT)
@@ -12,17 +13,20 @@ make_build_bundle(_build)
# Did we find GLFW? if so, set up the targets and all the support
# variables.
-if(OPENGL_FOUND AND OPENGL_GLU_FOUND AND GLUT_FOUND)
+if(GLFW_FOUND AND OPENGL_FOUND AND OPENGL_GLU_FOUND AND GLUT_FOUND)
# Output our dynamic library to the top-level _build hierarchy
set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/_build/dll)
# Additional include directories
include_directories(
+ ${GLFW_INCLUDE_DIR}
${OPENGL_INCLUDE_DIR}
${GLUT_INCLUDE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/../OpenGL/source
)
+ add_definitions(-DGLFW_DLL)
+
# Generate the IoGLFWInit.c file.
# Argument SHOULD ALWAYS be the exact name of the addon, case is
# important.
@@ -37,9 +41,9 @@ if(OPENGL_FOUND AND OPENGL_GLU_FOUND AND GLUT_FOUND)
# Now build the shared library
add_library(IoGLFW SHARED ${SRCS})
add_dependencies(IoGLFW iovmall)
- target_link_libraries(IoGLFW iovmall ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES})
+ target_link_libraries(IoGLFW iovmall ${GLFW_LIBRARY} ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES})
# Install the addon to our global addons hierarchy.
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/io/addons)
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/_build DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/io/addons/GLFW)
-endif(OPENGL_FOUND AND OPENGL_GLU_FOUND AND GLUT_FOUND)
+endif(GLFW_FOUND AND OPENGL_FOUND AND OPENGL_GLU_FOUND AND GLUT_FOUND)
@@ -2,6 +2,7 @@
# Port of http://glfw.sourceforge.net/tutorials/lesson05/lesson05.html
+Range
appendProto(GLFW)
appendProto(OpenGL)
@@ -2,6 +2,7 @@
# Port of http://glfw.sourceforge.net/tutorials/lesson08/lesson08.html
+Range
appendProto(GLFW)
appendProto(OpenGL)
View
@@ -0,0 +1,14 @@
+# Find glfw
+
+IF(GLFW_INCLUDE_DIR AND GLFW_LIBRARY)
+ set(GLFW_FIND_QUIETLY TRUE)
+ENDIF(GLFW_INCLUDE_DIR AND GLFW_LIBRARY)
+
+FIND_PATH(GLFW_INCLUDE_DIR GL/glfw.h)
+
+SET(GLFW_NAMES ${GLFW_NAMES} libglfwdll libglfw glfw)
+FIND_LIBRARY(GLFW_LIBRARY NAMES ${GLFW_NAMES} PATH)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(GLFW DEFAULT_MSG GLFW_LIBRARY GLFW_INCLUDE_DIR)
+mark_as_advanced(GLFW_INCLUDE_DIR GLFW_LIBRARY)

0 comments on commit e062a33

Please sign in to comment.