Update build.dox

This commit is contained in:
Zbigniew Mandziejewicz 2015-03-12 11:11:57 +08:00
parent e2ff064544
commit f63d50977f

View File

@ -183,44 +183,25 @@ target_link_libraries(myapp glfw ${OPENGL_glu_LIBRARY} ${GLFW_LIBRARIES})
@endcode @endcode
@subsection build_link_cmake_pkgconfig With CMake on Unix and installed GLFW binaries @subsection build_link_cmake With CMake and installed GLFW binaries
CMake can import settings from pkg-config, which GLFW supports. When you CMake can import settings from CMake package file, which GLFW supports.
installed GLFW, the pkg-config file `glfw3.pc` was installed along with it.
First you need to find the PkgConfig package. If this fails, you may need to
install the pkg-config package for your distribution.
@code{.cmake} @code{.cmake}
find_package(PkgConfig REQUIRED) find_package(glfw3 REQUIRED)
@endcode @endcode
This creates the CMake commands to find pkg-config packages. Then you need to This registers glfw imported target in your build. If you re using CMake < 2.8.11, to be able to include
find the GLFW package.
@code{.cmake}
pkg_search_module(GLFW REQUIRED glfw3)
@endcode
This creates the CMake variables you need to use GLFW. To be able to include
the GLFW header, you need to tell your compiler where it is. the GLFW header, you need to tell your compiler where it is.
@code{.cmake} @code{.cmake}
include_directories(${GLFW_INCLUDE_DIRS}) include_directories(${GLFW3_INCLUDE_DIR})
@endcode @endcode
You also need to link against the correct libraries. If you are using the You need to link against glfw library and its transitive dependencies (platform-specific).
shared library version of GLFW, use the `GLFW_LIBRARIES` variable.
@code{.cmake} @code{.cmake}
target_link_libraries(simple ${GLFW_LIBRARIES}) target_link_libraries(simple ${GLFW3_LIBRARY})
@endcode
If you are using the static library version of GLFW, use the
`GLFW_STATIC_LIBRARIES` variable instead.
@code{.cmake}
target_link_libraries(simple ${GLFW_STATIC_LIBRARIES})
@endcode @endcode