DEV Community

tinhnguyentrung
tinhnguyentrung

Posted on

CMake basic - find_packet

Refer to Find_package

The command find_package has two modes:

  • Module mode
  • Config mode

Module mode

This command finds Find<package>.cmake file located withing our project.

CMakeLists.txt
cmake/FindFoo.cmake
cmake/FindBoo.cmake
Enter fullscreen mode Exit fullscreen mode
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
find_package(Foo REQUIRED) # FOO_INCLUDE_DIR, FOO_LIBRARIES
find_package(Boo REQUIRED) # BOO_INCLUDE_DIR, BOO_LIBRARIES
Enter fullscreen mode Exit fullscreen mode

....

Top comments (0)