文档章节

OSX 10.11.3 下编译安装 GLFW-3.2

FreeBlues
 FreeBlues
发布于 2016/06/06 14:05
字数 3518
阅读 287
收藏 0

OSX 10.11.3 下编译安装 GLFW-3.2

版本说明

  • OSX 10.11.3
  • GLFW 3.2

安装过程

下载源码包

GLFW官网 下载最新的 GLFW-3.2, 解压.

编译安装

进入解压后的目录:

Air:sbcl admin$ cd ~/Downloads/glfw-3.2

新建一个 glfw-build 目录用来存放编译文件:

Air:glfw-3.2 admin$ 
Air:glfw-3.2 admin$ mkdir glfw-build
Air:glfw-3.2 admin$ cd glfw-build

然后操作如下:

Air:glfw-build admin$ cmake ../
-- The C compiler identification is AppleClang 7.3.0.7030031
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE  
-- Could NOT find Vulkan (missing:  VULKAN_LIBRARY VULKAN_INCLUDE_DIR) 
-- Could NOT find Doxygen (missing:  DOXYGEN_EXECUTABLE) 
-- Using Cocoa for window creation
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/admin/Downloads/glfw-3.2/glfw-build
Air:glfw-build admin$ 

查看下现在目录下有些什么:

Air:glfw-build admin$ ls
CMakeCache.txt		Makefile		cmake_uninstall.cmake	src
CMakeFiles		cmake_install.cmake	examples		tests
Air:glfw-build admin$ cmake ..
-- Could NOT find Vulkan (missing:  VULKAN_LIBRARY VULKAN_INCLUDE_DIR) 
-- Could NOT find Doxygen (missing:  DOXYGEN_EXECUTABLE) 
-- Using Cocoa for window creation
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/admin/Downloads/glfw-3.2/glfw-build
Air:glfw-build admin$ ls
CMakeCache.txt		Makefile		cmake_uninstall.cmake	src
CMakeFiles		cmake_install.cmake	examples		tests
Air:glfw-build admin$ 

正式开始执行 make 进行编译:

Air:glfw-build admin$ make
Scanning dependencies of target glfw
[  1%] Building C object src/CMakeFiles/glfw.dir/context.c.o
[  2%] Building C object src/CMakeFiles/glfw.dir/init.c.o
[  3%] Building C object src/CMakeFiles/glfw.dir/input.c.o
[  4%] Building C object src/CMakeFiles/glfw.dir/monitor.c.o
[  5%] Building C object src/CMakeFiles/glfw.dir/vulkan.c.o
[  6%] Building C object src/CMakeFiles/glfw.dir/window.c.o
[  7%] Building C object src/CMakeFiles/glfw.dir/cocoa_init.m.o
[  8%] Building C object src/CMakeFiles/glfw.dir/cocoa_joystick.m.o
[  9%] Building C object src/CMakeFiles/glfw.dir/cocoa_monitor.m.o
/Users/admin/Downloads/glfw-3.2/src/cocoa_monitor.m:52:42: warning: 'CGDisplayIOServicePort' is deprecated: first deprecated in OS X 10.9 [-Wdeprecated-declarations]
    info = IODisplayCreateInfoDictionary(CGDisplayIOServicePort(displayID),
                                         ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDisplayConfiguration.h:372:24: note: 
      'CGDisplayIOServicePort' has been explicitly marked deprecated here
CG_EXTERN io_service_t CGDisplayIOServicePort(CGDirectDisplayID display)
                       ^
/Users/admin/Downloads/glfw-3.2/src/cocoa_monitor.m:91:26: warning: 'CGDisplayModeCopyPixelEncoding' is deprecated: first deprecated in OS X 10.11 [-Wdeprecated-declarations]
    CFStringRef format = CGDisplayModeCopyPixelEncoding(mode);
                         ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDirectDisplay.h:174:34: note: 
      'CGDisplayModeCopyPixelEncoding' has been explicitly marked deprecated here
CG_EXTERN CFStringRef __nullable CGDisplayModeCopyPixelEncoding(
                                 ^
/Users/admin/Downloads/glfw-3.2/src/cocoa_monitor.m:120:26: warning: 'CGDisplayModeCopyPixelEncoding' is deprecated: first deprecated in OS X 10.11 [-Wdeprecated-declarations]
    CFStringRef format = CGDisplayModeCopyPixelEncoding(mode);
                         ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDirectDisplay.h:174:34: note: 
      'CGDisplayModeCopyPixelEncoding' has been explicitly marked deprecated here
CG_EXTERN CFStringRef __nullable CGDisplayModeCopyPixelEncoding(
                                 ^
3 warnings generated.
[ 10%] Building C object src/CMakeFiles/glfw.dir/cocoa_window.m.o
[ 11%] Building C object src/CMakeFiles/glfw.dir/cocoa_time.c.o
[ 12%] Building C object src/CMakeFiles/glfw.dir/posix_tls.c.o
[ 13%] Building C object src/CMakeFiles/glfw.dir/nsgl_context.m.o
[ 14%] Linking C static library libglfw3.a
[ 14%] Built target glfw
Scanning dependencies of target heightmap
[ 15%] Building C object examples/CMakeFiles/heightmap.dir/heightmap.c.o
[ 16%] Building C object examples/CMakeFiles/heightmap.dir/__/deps/glad.c.o
[ 17%] Linking C executable heightmap.app/Contents/MacOS/heightmap
Copying OS X content examples/heightmap.app/Contents/Resources/glfw.icns
[ 17%] Built target heightmap
Scanning dependencies of target simple
[ 18%] Building C object examples/CMakeFiles/simple.dir/simple.c.o
[ 19%] Building C object examples/CMakeFiles/simple.dir/__/deps/glad.c.o
[ 20%] Linking C executable simple.app/Contents/MacOS/simple
Copying OS X content examples/simple.app/Contents/Resources/glfw.icns
[ 20%] Built target simple
Scanning dependencies of target wave
[ 21%] Building C object examples/CMakeFiles/wave.dir/wave.c.o
[ 22%] Building C object examples/CMakeFiles/wave.dir/__/deps/glad.c.o
[ 23%] Linking C executable wave.app/Contents/MacOS/wave
Copying OS X content examples/wave.app/Contents/Resources/glfw.icns
[ 23%] Built target wave
Scanning dependencies of target splitview
[ 24%] Building C object examples/CMakeFiles/splitview.dir/splitview.c.o
[ 25%] Building C object examples/CMakeFiles/splitview.dir/__/deps/glad.c.o
[ 26%] Linking C executable splitview.app/Contents/MacOS/splitview
Copying OS X content examples/splitview.app/Contents/Resources/glfw.icns
[ 26%] Built target splitview
Scanning dependencies of target particles
[ 27%] Building C object examples/CMakeFiles/particles.dir/particles.c.o
[ 28%] Building C object examples/CMakeFiles/particles.dir/__/deps/tinycthread.c.o
[ 29%] Building C object examples/CMakeFiles/particles.dir/__/deps/getopt.c.o
[ 30%] Building C object examples/CMakeFiles/particles.dir/__/deps/glad.c.o
[ 31%] Linking C executable particles.app/Contents/MacOS/particles
Copying OS X content examples/particles.app/Contents/Resources/glfw.icns
[ 31%] Built target particles
Scanning dependencies of target boing
[ 31%] Building C object examples/CMakeFiles/boing.dir/boing.c.o
[ 32%] Building C object examples/CMakeFiles/boing.dir/__/deps/glad.c.o
[ 33%] Linking C executable boing.app/Contents/MacOS/boing
Copying OS X content examples/boing.app/Contents/Resources/glfw.icns
[ 33%] Built target boing
Scanning dependencies of target gears
[ 34%] Building C object examples/CMakeFiles/gears.dir/gears.c.o
[ 35%] Building C object examples/CMakeFiles/gears.dir/__/deps/glad.c.o
[ 36%] Linking C executable gears.app/Contents/MacOS/gears
Copying OS X content examples/gears.app/Contents/Resources/glfw.icns
[ 36%] Built target gears
Scanning dependencies of target clipboard
[ 37%] Building C object tests/CMakeFiles/clipboard.dir/clipboard.c.o
[ 38%] Building C object tests/CMakeFiles/clipboard.dir/__/deps/getopt.c.o
[ 39%] Building C object tests/CMakeFiles/clipboard.dir/__/deps/glad.c.o
[ 40%] Linking C executable clipboard
[ 40%] Built target clipboard
Scanning dependencies of target title
[ 41%] Building C object tests/CMakeFiles/title.dir/title.c.o
[ 42%] Building C object tests/CMakeFiles/title.dir/__/deps/glad.c.o
[ 43%] Linking C executable title.app/Contents/MacOS/title
[ 43%] Built target title
Scanning dependencies of target windows
[ 44%] Building C object tests/CMakeFiles/windows.dir/windows.c.o
[ 45%] Building C object tests/CMakeFiles/windows.dir/__/deps/getopt.c.o
[ 46%] Building C object tests/CMakeFiles/windows.dir/__/deps/glad.c.o
[ 47%] Linking C executable windows.app/Contents/MacOS/windows
[ 47%] Built target windows
Scanning dependencies of target timeout
[ 48%] Building C object tests/CMakeFiles/timeout.dir/timeout.c.o
[ 49%] Building C object tests/CMakeFiles/timeout.dir/__/deps/glad.c.o
[ 50%] Linking C executable timeout.app/Contents/MacOS/timeout
[ 50%] Built target timeout
Scanning dependencies of target threads
[ 51%] Building C object tests/CMakeFiles/threads.dir/threads.c.o
[ 52%] Building C object tests/CMakeFiles/threads.dir/__/deps/tinycthread.c.o
[ 53%] Building C object tests/CMakeFiles/threads.dir/__/deps/glad.c.o
[ 54%] Linking C executable threads.app/Contents/MacOS/threads
[ 54%] Built target threads
Scanning dependencies of target gamma
[ 55%] Building C object tests/CMakeFiles/gamma.dir/gamma.c.o
[ 56%] Building C object tests/CMakeFiles/gamma.dir/__/deps/getopt.c.o
[ 57%] Building C object tests/CMakeFiles/gamma.dir/__/deps/glad.c.o
[ 58%] Linking C executable gamma
[ 58%] Built target gamma
Scanning dependencies of target tearing
[ 59%] Building C object tests/CMakeFiles/tearing.dir/tearing.c.o
[ 60%] Building C object tests/CMakeFiles/tearing.dir/__/deps/getopt.c.o
[ 61%] Building C object tests/CMakeFiles/tearing.dir/__/deps/glad.c.o
[ 62%] Linking C executable tearing.app/Contents/MacOS/tearing
[ 62%] Built target tearing
Scanning dependencies of target icon
[ 63%] Building C object tests/CMakeFiles/icon.dir/icon.c.o
[ 64%] Building C object tests/CMakeFiles/icon.dir/__/deps/glad.c.o
[ 65%] Linking C executable icon.app/Contents/MacOS/icon
[ 65%] Built target icon
Scanning dependencies of target empty
[ 66%] Building C object tests/CMakeFiles/empty.dir/empty.c.o
[ 67%] Building C object tests/CMakeFiles/empty.dir/__/deps/tinycthread.c.o
[ 68%] Building C object tests/CMakeFiles/empty.dir/__/deps/glad.c.o
[ 69%] Linking C executable empty.app/Contents/MacOS/empty
[ 69%] Built target empty
Scanning dependencies of target glfwinfo
[ 70%] Building C object tests/CMakeFiles/glfwinfo.dir/glfwinfo.c.o
[ 71%] Building C object tests/CMakeFiles/glfwinfo.dir/__/deps/getopt.c.o
[ 72%] Building C object tests/CMakeFiles/glfwinfo.dir/__/deps/glad.c.o
[ 73%] Linking C executable glfwinfo
[ 73%] Built target glfwinfo
Scanning dependencies of target msaa
[ 74%] Building C object tests/CMakeFiles/msaa.dir/msaa.c.o
[ 75%] Building C object tests/CMakeFiles/msaa.dir/__/deps/getopt.c.o
[ 76%] Building C object tests/CMakeFiles/msaa.dir/__/deps/glad.c.o
[ 77%] Linking C executable msaa
[ 77%] Built target msaa
Scanning dependencies of target cursor
[ 78%] Building C object tests/CMakeFiles/cursor.dir/cursor.c.o
[ 79%] Building C object tests/CMakeFiles/cursor.dir/__/deps/glad.c.o
[ 80%] Linking C executable cursor
[ 80%] Built target cursor
Scanning dependencies of target sharing
[ 81%] Building C object tests/CMakeFiles/sharing.dir/sharing.c.o
[ 82%] Building C object tests/CMakeFiles/sharing.dir/__/deps/glad.c.o
[ 83%] Linking C executable sharing.app/Contents/MacOS/sharing
[ 83%] Built target sharing
Scanning dependencies of target monitors
[ 84%] Building C object tests/CMakeFiles/monitors.dir/monitors.c.o
[ 85%] Building C object tests/CMakeFiles/monitors.dir/__/deps/getopt.c.o
[ 86%] Building C object tests/CMakeFiles/monitors.dir/__/deps/glad.c.o
[ 87%] Linking C executable monitors
[ 87%] Built target monitors
Scanning dependencies of target reopen
[ 88%] Building C object tests/CMakeFiles/reopen.dir/reopen.c.o
[ 89%] Building C object tests/CMakeFiles/reopen.dir/__/deps/glad.c.o
[ 90%] Linking C executable reopen
[ 90%] Built target reopen
Scanning dependencies of target iconify
[ 91%] Building C object tests/CMakeFiles/iconify.dir/iconify.c.o
[ 92%] Building C object tests/CMakeFiles/iconify.dir/__/deps/getopt.c.o
[ 92%] Building C object tests/CMakeFiles/iconify.dir/__/deps/glad.c.o
[ 93%] Linking C executable iconify
[ 93%] Built target iconify
Scanning dependencies of target joysticks
[ 94%] Building C object tests/CMakeFiles/joysticks.dir/joysticks.c.o
[ 95%] Building C object tests/CMakeFiles/joysticks.dir/__/deps/glad.c.o
[ 96%] Linking C executable joysticks
[ 96%] Built target joysticks
Scanning dependencies of target events
[ 97%] Building C object tests/CMakeFiles/events.dir/events.c.o
[ 98%] Building C object tests/CMakeFiles/events.dir/__/deps/getopt.c.o
[ 99%] Building C object tests/CMakeFiles/events.dir/__/deps/glad.c.o
[100%] Linking C executable events
[100%] Built target events
Air:glfw-build admin$ 

很好, 编译完了, 执行 make install 进行安装:

Air:glfw-build admin$ make install
[ 14%] Built target glfw
[ 17%] Built target heightmap
[ 20%] Built target simple
[ 23%] Built target wave
[ 26%] Built target splitview
[ 31%] Built target particles
[ 33%] Built target boing
[ 36%] Built target gears
[ 40%] Built target clipboard
[ 43%] Built target title
[ 47%] Built target windows
[ 50%] Built target timeout
[ 54%] Built target threads
[ 58%] Built target gamma
[ 62%] Built target tearing
[ 65%] Built target icon
[ 69%] Built target empty
[ 73%] Built target glfwinfo
[ 77%] Built target msaa
[ 80%] Built target cursor
[ 83%] Built target sharing
[ 87%] Built target monitors
[ 90%] Built target reopen
[ 93%] Built target iconify
[ 96%] Built target joysticks
[100%] Built target events
Install the project...
-- Install configuration: ""
-- Installing: /usr/local/include/GLFW
-- Installing: /usr/local/include/GLFW/glfw3.h
-- Installing: /usr/local/include/GLFW/glfw3native.h
-- Installing: /usr/local/lib/cmake/glfw3/glfw3Config.cmake
-- Installing: /usr/local/lib/cmake/glfw3/glfw3ConfigVersion.cmake
-- Installing: /usr/local/lib/cmake/glfw3/glfw3Targets.cmake
-- Installing: /usr/local/lib/cmake/glfw3/glfw3Targets-noconfig.cmake
-- Installing: /usr/local/lib/pkgconfig/glfw3.pc
-- Installing: /usr/local/lib/libglfw3.a

非常不幸地发现最终编译出来的是一个 libglfw3.a 静态库文件, 但是我们需要的是一个 形如 libglfw3.dylib 的动态库, 所以得重新设置一下编译参数.

Air:glfw-build admin$ cmake -DBUILD_SHARED_LIBS=ON .
-- Could NOT find Vulkan (missing:  VULKAN_LIBRARY VULKAN_INCLUDE_DIR) 
-- Could NOT find Doxygen (missing:  DOXYGEN_EXECUTABLE) 
-- Using Cocoa for window creation
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/admin/Downloads/glfw-3.2/glfw-build
Air:glfw-build admin$ cmake ..
-- Could NOT find Vulkan (missing:  VULKAN_LIBRARY VULKAN_INCLUDE_DIR) 
-- Could NOT find Doxygen (missing:  DOXYGEN_EXECUTABLE) 
-- Using Cocoa for window creation
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/admin/Downloads/glfw-3.2/glfw-build
Air:glfw-build admin$

然后再编译

Air:glfw-build admin$ make
Scanning dependencies of target glfw
[  1%] Building C object src/CMakeFiles/glfw.dir/context.c.o
[  2%] Building C object src/CMakeFiles/glfw.dir/init.c.o
[  3%] Building C object src/CMakeFiles/glfw.dir/input.c.o
[  4%] Building C object src/CMakeFiles/glfw.dir/monitor.c.o
[  5%] Building C object src/CMakeFiles/glfw.dir/vulkan.c.o
[  6%] Building C object src/CMakeFiles/glfw.dir/window.c.o
[  7%] Building C object src/CMakeFiles/glfw.dir/cocoa_init.m.o
[  8%] Building C object src/CMakeFiles/glfw.dir/cocoa_joystick.m.o
[  9%] Building C object src/CMakeFiles/glfw.dir/cocoa_monitor.m.o
/Users/admin/Downloads/glfw-3.2/src/cocoa_monitor.m:52:42: warning: 'CGDisplayIOServicePort' is deprecated: first deprecated in OS X 10.9 [-Wdeprecated-declarations]
    info = IODisplayCreateInfoDictionary(CGDisplayIOServicePort(displayID),
                                         ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDisplayConfiguration.h:372:24: note: 
      'CGDisplayIOServicePort' has been explicitly marked deprecated here
CG_EXTERN io_service_t CGDisplayIOServicePort(CGDirectDisplayID display)
                       ^
/Users/admin/Downloads/glfw-3.2/src/cocoa_monitor.m:91:26: warning: 'CGDisplayModeCopyPixelEncoding' is deprecated: first deprecated in OS X 10.11 [-Wdeprecated-declarations]
    CFStringRef format = CGDisplayModeCopyPixelEncoding(mode);
                         ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDirectDisplay.h:174:34: note: 
      'CGDisplayModeCopyPixelEncoding' has been explicitly marked deprecated here
CG_EXTERN CFStringRef __nullable CGDisplayModeCopyPixelEncoding(
                                 ^
/Users/admin/Downloads/glfw-3.2/src/cocoa_monitor.m:120:26: warning: 'CGDisplayModeCopyPixelEncoding' is deprecated: first deprecated in OS X 10.11 [-Wdeprecated-declarations]
    CFStringRef format = CGDisplayModeCopyPixelEncoding(mode);
                         ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDirectDisplay.h:174:34: note: 
      'CGDisplayModeCopyPixelEncoding' has been explicitly marked deprecated here
CG_EXTERN CFStringRef __nullable CGDisplayModeCopyPixelEncoding(
                                 ^
3 warnings generated.
[ 10%] Building C object src/CMakeFiles/glfw.dir/cocoa_window.m.o
[ 11%] Building C object src/CMakeFiles/glfw.dir/cocoa_time.c.o
[ 12%] Building C object src/CMakeFiles/glfw.dir/posix_tls.c.o
[ 13%] Building C object src/CMakeFiles/glfw.dir/nsgl_context.m.o
[ 14%] Linking C shared library libglfw.dylib
[ 14%] Built target glfw
Scanning dependencies of target heightmap
[ 15%] Building C object examples/CMakeFiles/heightmap.dir/heightmap.c.o
[ 16%] Building C object examples/CMakeFiles/heightmap.dir/__/deps/glad.c.o
[ 17%] Linking C executable heightmap.app/Contents/MacOS/heightmap
[ 17%] Built target heightmap
Scanning dependencies of target simple
[ 18%] Building C object examples/CMakeFiles/simple.dir/simple.c.o
[ 19%] Building C object examples/CMakeFiles/simple.dir/__/deps/glad.c.o
[ 20%] Linking C executable simple.app/Contents/MacOS/simple
[ 20%] Built target simple
Scanning dependencies of target wave
[ 21%] Building C object examples/CMakeFiles/wave.dir/wave.c.o
[ 22%] Building C object examples/CMakeFiles/wave.dir/__/deps/glad.c.o
[ 23%] Linking C executable wave.app/Contents/MacOS/wave
[ 23%] Built target wave
Scanning dependencies of target splitview
[ 24%] Building C object examples/CMakeFiles/splitview.dir/splitview.c.o
[ 25%] Building C object examples/CMakeFiles/splitview.dir/__/deps/glad.c.o
[ 26%] Linking C executable splitview.app/Contents/MacOS/splitview
[ 26%] Built target splitview
Scanning dependencies of target particles
[ 27%] Building C object examples/CMakeFiles/particles.dir/particles.c.o
[ 28%] Building C object examples/CMakeFiles/particles.dir/__/deps/tinycthread.c.o
[ 29%] Building C object examples/CMakeFiles/particles.dir/__/deps/getopt.c.o
[ 30%] Building C object examples/CMakeFiles/particles.dir/__/deps/glad.c.o
[ 31%] Linking C executable particles.app/Contents/MacOS/particles
[ 31%] Built target particles
Scanning dependencies of target boing
[ 31%] Building C object examples/CMakeFiles/boing.dir/boing.c.o
[ 32%] Building C object examples/CMakeFiles/boing.dir/__/deps/glad.c.o
[ 33%] Linking C executable boing.app/Contents/MacOS/boing
[ 33%] Built target boing
Scanning dependencies of target gears
[ 34%] Building C object examples/CMakeFiles/gears.dir/gears.c.o
[ 35%] Building C object examples/CMakeFiles/gears.dir/__/deps/glad.c.o
[ 36%] Linking C executable gears.app/Contents/MacOS/gears
[ 36%] Built target gears
Scanning dependencies of target clipboard
[ 37%] Building C object tests/CMakeFiles/clipboard.dir/clipboard.c.o
[ 38%] Building C object tests/CMakeFiles/clipboard.dir/__/deps/getopt.c.o
[ 39%] Building C object tests/CMakeFiles/clipboard.dir/__/deps/glad.c.o
[ 40%] Linking C executable clipboard
[ 40%] Built target clipboard
Scanning dependencies of target title
[ 41%] Building C object tests/CMakeFiles/title.dir/title.c.o
[ 42%] Building C object tests/CMakeFiles/title.dir/__/deps/glad.c.o
[ 43%] Linking C executable title.app/Contents/MacOS/title
[ 43%] Built target title
Scanning dependencies of target windows
[ 44%] Building C object tests/CMakeFiles/windows.dir/windows.c.o
[ 45%] Building C object tests/CMakeFiles/windows.dir/__/deps/getopt.c.o
[ 46%] Building C object tests/CMakeFiles/windows.dir/__/deps/glad.c.o
[ 47%] Linking C executable windows.app/Contents/MacOS/windows
[ 47%] Built target windows
Scanning dependencies of target timeout
[ 48%] Building C object tests/CMakeFiles/timeout.dir/timeout.c.o
[ 49%] Building C object tests/CMakeFiles/timeout.dir/__/deps/glad.c.o
[ 50%] Linking C executable timeout.app/Contents/MacOS/timeout
[ 50%] Built target timeout
Scanning dependencies of target threads
[ 51%] Building C object tests/CMakeFiles/threads.dir/threads.c.o
[ 52%] Building C object tests/CMakeFiles/threads.dir/__/deps/tinycthread.c.o
[ 53%] Building C object tests/CMakeFiles/threads.dir/__/deps/glad.c.o
[ 54%] Linking C executable threads.app/Contents/MacOS/threads
[ 54%] Built target threads
Scanning dependencies of target gamma
[ 55%] Building C object tests/CMakeFiles/gamma.dir/gamma.c.o
[ 56%] Building C object tests/CMakeFiles/gamma.dir/__/deps/getopt.c.o
[ 57%] Building C object tests/CMakeFiles/gamma.dir/__/deps/glad.c.o
[ 58%] Linking C executable gamma
[ 58%] Built target gamma
Scanning dependencies of target tearing
[ 59%] Building C object tests/CMakeFiles/tearing.dir/tearing.c.o
[ 60%] Building C object tests/CMakeFiles/tearing.dir/__/deps/getopt.c.o
[ 61%] Building C object tests/CMakeFiles/tearing.dir/__/deps/glad.c.o
[ 62%] Linking C executable tearing.app/Contents/MacOS/tearing
[ 62%] Built target tearing
Scanning dependencies of target icon
[ 63%] Building C object tests/CMakeFiles/icon.dir/icon.c.o
[ 64%] Building C object tests/CMakeFiles/icon.dir/__/deps/glad.c.o
[ 65%] Linking C executable icon.app/Contents/MacOS/icon
[ 65%] Built target icon
Scanning dependencies of target empty
[ 66%] Building C object tests/CMakeFiles/empty.dir/empty.c.o
[ 67%] Building C object tests/CMakeFiles/empty.dir/__/deps/tinycthread.c.o
[ 68%] Building C object tests/CMakeFiles/empty.dir/__/deps/glad.c.o
[ 69%] Linking C executable empty.app/Contents/MacOS/empty
[ 69%] Built target empty
Scanning dependencies of target glfwinfo
[ 70%] Building C object tests/CMakeFiles/glfwinfo.dir/glfwinfo.c.o
[ 71%] Building C object tests/CMakeFiles/glfwinfo.dir/__/deps/getopt.c.o
[ 72%] Building C object tests/CMakeFiles/glfwinfo.dir/__/deps/glad.c.o
[ 73%] Linking C executable glfwinfo
[ 73%] Built target glfwinfo
Scanning dependencies of target msaa
[ 74%] Building C object tests/CMakeFiles/msaa.dir/msaa.c.o
[ 75%] Building C object tests/CMakeFiles/msaa.dir/__/deps/getopt.c.o
[ 76%] Building C object tests/CMakeFiles/msaa.dir/__/deps/glad.c.o
[ 77%] Linking C executable msaa
[ 77%] Built target msaa
Scanning dependencies of target cursor
[ 78%] Building C object tests/CMakeFiles/cursor.dir/cursor.c.o
[ 79%] Building C object tests/CMakeFiles/cursor.dir/__/deps/glad.c.o
[ 80%] Linking C executable cursor
[ 80%] Built target cursor
Scanning dependencies of target sharing
[ 81%] Building C object tests/CMakeFiles/sharing.dir/sharing.c.o
[ 82%] Building C object tests/CMakeFiles/sharing.dir/__/deps/glad.c.o
[ 83%] Linking C executable sharing.app/Contents/MacOS/sharing
[ 83%] Built target sharing
Scanning dependencies of target monitors
[ 84%] Building C object tests/CMakeFiles/monitors.dir/monitors.c.o
[ 85%] Building C object tests/CMakeFiles/monitors.dir/__/deps/getopt.c.o
[ 86%] Building C object tests/CMakeFiles/monitors.dir/__/deps/glad.c.o
[ 87%] Linking C executable monitors
[ 87%] Built target monitors
Scanning dependencies of target reopen
[ 88%] Building C object tests/CMakeFiles/reopen.dir/reopen.c.o
[ 89%] Building C object tests/CMakeFiles/reopen.dir/__/deps/glad.c.o
[ 90%] Linking C executable reopen
[ 90%] Built target reopen
Scanning dependencies of target iconify
[ 91%] Building C object tests/CMakeFiles/iconify.dir/iconify.c.o
[ 92%] Building C object tests/CMakeFiles/iconify.dir/__/deps/getopt.c.o
[ 92%] Building C object tests/CMakeFiles/iconify.dir/__/deps/glad.c.o
[ 93%] Linking C executable iconify
[ 93%] Built target iconify
Scanning dependencies of target joysticks
[ 94%] Building C object tests/CMakeFiles/joysticks.dir/joysticks.c.o
[ 95%] Building C object tests/CMakeFiles/joysticks.dir/__/deps/glad.c.o
[ 96%] Linking C executable joysticks
[ 96%] Built target joysticks
Scanning dependencies of target events
[ 97%] Building C object tests/CMakeFiles/events.dir/events.c.o
[ 98%] Building C object tests/CMakeFiles/events.dir/__/deps/getopt.c.o
[ 99%] Building C object tests/CMakeFiles/events.dir/__/deps/glad.c.o
[100%] Linking C executable events
[100%] Built target events
Air:glfw-build admin$ 

编译完之后再执行 make install 安装:

Air:glfw-build admin$ make install
[ 14%] Built target glfw
[ 17%] Built target heightmap
[ 20%] Built target simple
[ 23%] Built target wave
[ 26%] Built target splitview
[ 31%] Built target particles
[ 33%] Built target boing
[ 36%] Built target gears
[ 40%] Built target clipboard
[ 43%] Built target title
[ 47%] Built target windows
[ 50%] Built target timeout
[ 54%] Built target threads
[ 58%] Built target gamma
[ 62%] Built target tearing
[ 65%] Built target icon
[ 69%] Built target empty
[ 73%] Built target glfwinfo
[ 77%] Built target msaa
[ 80%] Built target cursor
[ 83%] Built target sharing
[ 87%] Built target monitors
[ 90%] Built target reopen
[ 93%] Built target iconify
[ 96%] Built target joysticks
[100%] Built target events
Install the project...
-- Install configuration: ""
-- Up-to-date: /usr/local/include/GLFW
-- Up-to-date: /usr/local/include/GLFW/glfw3.h
-- Up-to-date: /usr/local/include/GLFW/glfw3native.h
-- Up-to-date: /usr/local/lib/cmake/glfw3/glfw3Config.cmake
-- Up-to-date: /usr/local/lib/cmake/glfw3/glfw3ConfigVersion.cmake
-- Old export file "/usr/local/lib/cmake/glfw3/glfw3Targets.cmake" will be replaced.  Removing files [/usr/local/lib/cmake/glfw3/glfw3Targets-noconfig.cmake].
-- Installing: /usr/local/lib/cmake/glfw3/glfw3Targets.cmake
-- Installing: /usr/local/lib/cmake/glfw3/glfw3Targets-noconfig.cmake
-- Installing: /usr/local/lib/pkgconfig/glfw3.pc
-- Installing: /usr/local/lib/libglfw.3.2.dylib
-- Installing: /usr/local/lib/libglfw.3.dylib
-- Installing: /usr/local/lib/libglfw.dylib
Air:glfw-build admin$ 

终于看到了 libglfw.dylib, 很好, 基本大功告成也!

试验一下, 在没有完成 GLFW 的编译安装之前, 在 SBCL 中加载 cl-glfw 会报下面的错误:

* (ql:quickload 'cl-glfw)
To load "cl-glfw":
  Load 1 ASDF system:
    cl-glfw
; Loading "cl-glfw"
.........
debugger invoked on a LOAD-FOREIGN-LIBRARY-ERROR in thread
#<THREAD "main thread" RUNNING {100294EC33}>:
  Unable to load any of the alternatives:
   ("libglfw.dylib" (:FRAMEWORK "GLFW"))

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

现在再试试:

* (ql:quickload 'cl-glfw)
To load "cl-glfw":
  Load 1 ASDF system:
    cl-glfw
; Loading "cl-glfw"
.................
(CL-GLFW)
* 

很好, 非常顺利就完成了!

参考文档

在 Mac OS X Yosemite 10.10.5 上配置 OpenGL 编程环境
Compiling GLFW

© 著作权归作者所有

FreeBlues
粉丝 98
博文 280
码字总数 493678
作品 0
其它
程序员
私信 提问
GLFW 3.3 发布,OpenGL、Vulkan 桌面开发库

GLFW 3.3 发布了,GLFW 是一个用于桌面 OpenGL、OpenGL ES 和 Vulkan 的开发库,它提供了一个简单的 API,用于创建窗口、上下文和界面,接收输入和事件。GLFW 是用 C 语言编写的,对 Window...

h4cd
04/18
0
0
MacOS源码安装LuaJIT

今天想在自己的Mac上源码安装LuaJIT, 结果发现各种报错,在此做个笔记,也便以后查阅。 环境 系统版本:macOS Mojave, 10.14.3 XCode: Version 10.1 源码编译LuaJIT 下载源码 解压 编译 安装...

AlgoPeek
02/02
0
0
OpenGL: Ubuntu 上的安装

OpenGL 有好几种安装办法:下面列出二种,GLUT 和 GLFW+GLAD. GLUT 方法 如果上一步出现报错: 将上述 命令改成: 想测验是否成功,详见: Ubuntu 安装 openGL GLFW + GLAD 方法 安装 GLFW 安...

庞贝船长
2018/08/18
0
0
苹果发布 macOS Sierra 10.12.3,修复显卡问题

苹果今天发布了 macOS Sierra 10.12.3 正式版升级补丁,这是 macOS Sierra 自去年9月20日发布以来的第三个升级补丁。macOS Sierra 10.12.3 的发布距离 10.12.2 相隔一个月的时间,并在去年1...

达尔文
2017/01/24
2.4K
12
macOS 10.12.4,可正确显示 Windows 可执行文件了

苹果发布了 macOS Sierra 10.12.4 开发者测试版,新版的主打功能之一就是将 iOS 平台上的 Night Shift 带入了 macOS。除了 Night Shift 功能外,macOS Sierra 10.12.4 还更新了 PDF API,听写...

凝小紫
2017/01/28
2.6K
9

没有更多内容

加载失败,请刷新页面

加载更多

阿里云POLARDB如何助力轻松筹打造5亿用户信赖的大病筹款平台?

轻松筹首创了“大病救助”模式,帮助了众多病患在第一时间解決了医疗资金等问题,为了从源头解决了医疗资金问题。而在轻松筹这样全球5.5亿用户信赖的大病筹款平台的背后,是日益增长的各种数...

阿里云云栖社区
6分钟前
1
0
Confluence 6 在升级过程中查看合并日志

为了监控升级的过程,你应该查看 application log 日志中的输出。 通常日志经常将会显示多个日志实例,这个实例是定义在日志的 INFO 级别的,通常格式如下: WikiToXhtmlMigrationThread-n -...

honeymoose
6分钟前
0
0
git diff 文件对比

git diff filepath 工作区与暂存区比较 git diff HEAD filepath 工作区与HEAD ( 当前工作分支) 比较 git diff --staged 或 --cached filepath 暂存区与HEAD比较 git diff branchName filepa......

李佳顺
6分钟前
0
0
spring mvc 定制化配置

spring mvc 自定义配置 1.实现某些接口,然后让上面的类加载进去. class MyHandlerMethodArgumentResolver implements HandlerMethodArgumentResolver { @Override public boolean......

最爱肉肉
9分钟前
0
0
OSG_采样像机的内容如果不显示到窗口上

cameraLight->setRenderTargetImplementation(Camera::FRAME_BUFFER_OBJECT);// 这句使内容不渲染到屏幕上cameraLight->setRenderOrder(Camera::PRE_RENDER); 1.setRenderTargetImplement......

洛克人杰洛
12分钟前
0
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部