diff --git a/docs/build.dox b/docs/build.dox index aa6c5fe80..f9265d75f 100644 --- a/docs/build.dox +++ b/docs/build.dox @@ -183,44 +183,25 @@ target_link_libraries(myapp glfw ${OPENGL_glu_LIBRARY} ${GLFW_LIBRARIES}) @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 -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. +CMake can import settings from CMake package file, which GLFW supports. @code{.cmake} -find_package(PkgConfig REQUIRED) +find_package(glfw3 REQUIRED) @endcode -This creates the CMake commands to find pkg-config packages. Then you need to -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 +This registers glfw imported target in your build. If you re using CMake < 2.8.11, to be able to include the GLFW header, you need to tell your compiler where it is. @code{.cmake} -include_directories(${GLFW_INCLUDE_DIRS}) +include_directories(${GLFW3_INCLUDE_DIR}) @endcode -You also need to link against the correct libraries. If you are using the -shared library version of GLFW, use the `GLFW_LIBRARIES` variable. +You need to link against glfw library and its transitive dependencies (platform-specific). @code{.cmake} -target_link_libraries(simple ${GLFW_LIBRARIES}) -@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}) +target_link_libraries(simple ${GLFW3_LIBRARY}) @endcode