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)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay