How to know library variable names for CMakeLists?

前端 未结 3 1165
不知归路
不知归路 2020-12-04 02:07

When using CMakeLists to compile an OpenGL project, I have the following line to link glut and gl:

target_link_libraries(my_exe ${OPENGL_gl_LIBRARY} ${GLUT_L         


        
3条回答
  •  温柔的废话
    2020-12-04 02:44

    Those variables are obtained via find_package(XXX) calls.

    Such calls are redirected, depended from the library, either to FindXXX.cmake script (shipped with CMake or contained in the project which uses it) or to XXXConfig.cmake script (shipped with the library itself).

    So, for determine meaningful variable's names you need to consult appropriate script. Usually, interface of the script (input-output variables) is described in comments at the beginning of the script.

    Documentation for FindXXX.cmake scripts shipped with CMake may be read in CMake documentation pages about modules.

提交回复
热议问题