cmake find_package examples

Signatures

find_package(<PackageName> [version] [EXACT] [QUIET] [MODULE]
  [REQUIRED|OPTIONAL] [[COMPONENTS] [components...]]
  [OPTIONAL_COMPONENTS components...]
  [REGISTRY_VIEW  (64|32|64_32|32_64|HOST|TARGET|BOTH)]
  [GLOBAL]
  [NO_POLICY_SCOPE]
  [BYPASS_PROVIDER]
)

Examples

u3d-community/U3D cmake/Modules/UrhoCommon.cmake :582

find_package (DirectX REQUIRED ${DIRECTX_REQUIRED_COMPONENTS} OPTIONAL_COMPONENTS ${DIRECTX_OPTIONAL_COMPONENTS})

novelrt/NovelRT Graphics/CMakeLists.txt :12

find_package(Vulkan "1.2" OPTIONAL_COMPONENTS MoltenVK)

f3d-app/f3d CMakeLists.txt :84

find_package(VTK 9.2.6 REQUIRED
  COMPONENTS
    CommonCore
    CommonDataModel
    CommonExecutionModel
    FiltersGeneral
    FiltersGeometry
    ImagingCore
    ImagingHybrid
    InteractionStyle
    InteractionWidgets
    IOCityGML
    IOGeometry
    IOImage
    IOImport
    IOParallel
    IOPLY
    IOXML
    RenderingAnnotation
    RenderingCore
    RenderingOpenGL2
    RenderingVolumeOpenGL2
    TestingCore
    jsoncpp
  OPTIONAL_COMPONENTS
    opengl
    IOExodus
    IOHDF
    IONetCDF
    IOOpenVDB
    RenderingGridAxes
    RenderingRayTracing)

prusa3d/PrusaSlicer cmake/modules/FindwxWidgets.cmake :18

find_package(wxWidgets COMPONENTS core base ... OPTIONAL_COMPONENTS net ...)

facebookresearch/habitat-sim src/cmake/FindMagnumIntegration.cmake :90

find_package(Magnum OPTIONAL_COMPONENTS ${_MAGNUMINTEGRATION_OPTIONAL_DEPENDENCIES})

STORM-IRIT/Radium-Engine doc/CMakeLists.txt :14

find_package(Doxygen 1.8 OPTIONAL_COMPONENTS dot)

alex-petrenko/megaverse src/cmake/modules/FindMagnumIntegration.cmake :89

find_package(Magnum OPTIONAL_COMPONENTS ${_MAGNUMINTEGRATION_OPTIONAL_DEPENDENCIES})

alpaka-group/alpaka cmake/alpakaCommon.cmake :256

find_package(Boost ${_alpaka_BOOST_MIN_VER} REQUIRED
                    OPTIONAL_COMPONENTS atomic)

eclipse-ecal/ecal lang/python/src/nanobind_core/src/CMakeLists.txt :2

find_package(Python
  REQUIRED COMPONENTS Interpreter Development.Module
  OPTIONAL_COMPONENTS Development.SABIModule)

etternagame/etterna CMake/Helpers/DocumentationTools.cmake :3

find_package(Doxygen OPTIONAL_COMPONENTS dot)

NREL/OpenStudio CMake/FindBoost.cmake :12

find_package(Boost
    [version] [EXACT]      # Minimum or EXACT version e.g. 1.67.0
    [REQUIRED]             # Fail with error if Boost is not found
    [COMPONENTS <libs>...] # Boost libraries by their canonical name
                           # e.g. "date_time" for "libboost_date_time"
    [OPTIONAL_COMPONENTS <libs>...]
                           # Optional Boost libraries by their canonical name)
    )

KDE/digikam core/CMakeLists.txt :144

find_package(Qt5 ${QT_MIN_VERSION}
             OPTIONAL_COMPONENTS
             DBus
             OpenGL
)

TheAlgorithms/C-Plus-Plus CMakeLists.txt :58

find_package(Doxygen OPTIONAL_COMPONENTS dot dia)

liminchen/OptCuts ext/libigl/external/cgal/src/CGAL_Project/demo/Polyhedron/CMakeLists.txt :66

find_package(Qt5
             QUIET
             COMPONENTS            OpenGL Script Svg Xml
             OPTIONAL_COMPONENTS   ScriptTools)

KhronosGroup/Vulkan-Samples bldsys/cmake/global_options.cmake :38

find_package(Vulkan QUIET OPTIONAL_COMPONENTS MoltenVK)

gnss-sdr/gnss-sdr CMakeLists.txt :2934

find_package(Doxygen OPTIONAL_COMPONENTS dot)

ossia/score CMakeLists.txt :210

find_package(${QT_VERSION} REQUIRED
  COMPONENTS
    Core
    Widgets
    Gui
    Network
    Xml
    StateMachine
    OpenGL
    OpenGLWidgets
    Qml
    ShaderTools Quick QmlModels
  OPTIONAL_COMPONENTS
    WebSockets
    Svg
    CorePrivate
    WidgetsPrivate
    GuiPrivate
    QmlPrivate
    QuickPrivate
    ShaderToolsPrivate
)

psi4/psi4 external/upstream/libint2/CMakeLists.txt :38

find_package(Libint2 2.8.1 CONFIG  # edit in codedeps
#  COMPONENTS
#    sss
#    CXX_ho
#    impure_sh
#    "eri_c4_d0_l${MAX_AM_ERI}" eri_c3_d0_l4 eri_c2_d0_l4 onebody_d0_l4
#     eri_c4_d1_l2              eri_c3_d1_l3 eri_c2_d1_l3 onebody_d1_l3
#                                                         onebody_d2_l3
#  OPTIONAL_COMPONENTS
#     eri_c4_d2_l2              eri_c3_d2_l3 eri_c2_d2_l3
  )

moneymanagerex/moneymanagerex CMakeLists.txt :347

find_package(wxWidgets 2.9.2 REQUIRED
    COMPONENTS core qa html xml aui adv stc webview base
    OPTIONAL_COMPONENTS scintilla)

OpenMW/openmw CMakeLists.txt :457

find_package(Boost 1.70.0 CONFIG REQUIRED COMPONENTS ${BOOST_COMPONENTS} OPTIONAL_COMPONENTS ${BOOST_OPTIONAL_COMPONENTS})

Kitware/ParaView Plugins/DSP/CMakeLists.txt :10

find_package("Qt${PARAVIEW_QT_MAJOR_VERSION}" REQUIRED Widgets OPTIONAL_COMPONENTS Multimedia)

scanner-research/scanner cmake/Modules/FindDoxygen.cmake :27

find_package(Doxygen
               REQUIRED dot
               OPTIONAL_COMPONENTS mscgen dia)

sandialabs/InterSpec external_libs/Minuit2/doc/CMakeLists.txt :14

find_package(Doxygen OPTIONAL_COMPONENTS dot)

NERSC/timemory cmake/Modules/FindBoost.cmake :12

find_package(Boost
    [version] [EXACT]      # Minimum or EXACT version e.g. 1.67.0
    [REQUIRED]             # Fail with error if Boost is not found
    [COMPONENTS <libs>...] # Boost libraries by their canonical name
                           # e.g. "date_time" for "libboost_date_time"
    [OPTIONAL_COMPONENTS <libs>...]
                           # Optional Boost libraries by their canonical name)
    )

emsec/hal deps/quazip-1.3/CMakeLists.txt :44

find_package(Qt5 REQUIRED COMPONENTS Core
                         OPTIONAL_COMPONENTS Network Test)

ceph/ceph cmake/modules/FindBoost.cmake :19

find_package(Boost
    [version] [EXACT]      # Minimum or EXACT version e.g. 1.67.0
    [REQUIRED]             # Fail with error if Boost is not found
    [COMPONENTS <libs>...] # Boost libraries by their canonical name
                           # e.g. "date_time" for "libboost_date_time"
    [OPTIONAL_COMPONENTS <libs>...]
                           # Optional Boost libraries by their canonical name)
    )

colmap/colmap cmake/FindDependencies.cmake :22

find_package(Boost ${COLMAP_FIND_TYPE} COMPONENTS
             graph
             program_options
             OPTIONAL_COMPONENTS
             system)

gnuradio/gnuradio cmake/Modules/GrBoost.cmake :111

find_package(
    Boost ${GR_BOOST_MIN_VERSION} ${GR_BOOST_REQUIRED}
    COMPONENTS ${BOOST_REQUIRED_COMPONENTS}
    OPTIONAL_COMPONENTS unit_test_framework)

root-project/root math/minuit2/doc/CMakeLists.txt :14

find_package(Doxygen OPTIONAL_COMPONENTS dot)

Slicer/Slicer CMake/SlicerBlockInstallQt.cmake :12

find_package(Qt5 REQUIRED
      COMPONENTS
        Qml
        Quick
        QuickWidgets
      OPTIONAL_COMPONENTS
        Positioning  # Soft build-time dependency. See https://bugreports.qt.io/browse/QTBUG-57418
      )

GPSBabel/gpsbabel gui/CMakeLists.txt :25

find_package(Qt6 REQUIRED COMPONENTS Core Gui Network SerialPort Widgets Xml OPTIONAL_COMPONENTS WebEngineWidgets WebChannel)

robotology/yarp cmake/YarpFindDependencies.cmake :309

find_package(Qt5 ${Qt5_REQUIRED_VERSION} COMPONENTS Core Widgets Gui Quick Qml Multimedia Xml PrintSupport OPTIONAL_COMPONENTS DBus QUIET)

apache/qpid-proton CMakeLists.txt :45

find_package(Python 3.9
        REQUIRED COMPONENTS Interpreter
        OPTIONAL_COMPONENTS Development)

jupyter-xeus/cpp-terminal cmake/Documentation.cmake :7

find_package(Doxygen QUIET OPTIONAL_COMPONENTS mscgen dia dot)

BioMedIA/MIRTK CMake/Modules/FindPython.cmake :78

find_package (PythonModules QUIET MODULE
    COMPONENTS ${Python_FIND_Modules_REQUIRED}
    OPTIONAL_COMPONENTS ${Python_FIND_Modules_OPTIONAL}
  )

strawberrymusicplayer/strawberry CMakeLists.txt :227

find_package(Qt${QT_VERSION_MAJOR} ${QT_MIN_VERSION} COMPONENTS ${QT_COMPONENTS} REQUIRED OPTIONAL_COMPONENTS ${QT_OPTIONAL_COMPONENTS})

qt/qtbase examples/widgets/graphicsview/chip/CMakeLists.txt :7

find_package(Qt6
    REQUIRED COMPONENTS Core Gui Widgets
    OPTIONAL_COMPONENTS PrintSupport
)

KavrakiLab/vamp cmake/Python.cmake :6

find_package(Python 3.8
    REQUIRED COMPONENTS Interpreter Development.Module
    OPTIONAL_COMPONENTS Development.SABIModule)

KDE/plasma-workspace CMakeLists.txt :64

find_package(KF6 ${KF6_MIN_VERSION} REQUIRED COMPONENTS
                    Archive Auth CoreAddons Crash DBusAddons Declarative GlobalAccel GuiAddons
                    I18n IconThemes IdleTime ItemModels KCMUtils KDED KIO NewStuff Notifications
                    NotifyConfig Package Parts Prison Runner StatusNotifierItem Svg TextEditor
                    TextWidgets UnitConversion Wallet ColorScheme
                    OPTIONAL_COMPONENTS DocTools)

munich-quantum-toolkit/ddsim CMakeLists.txt :42

find_package(
    Python 3.10 REQUIRED
    COMPONENTS Interpreter Development.Module
    OPTIONAL_COMPONENTS Development.SABIModule)

NauEngine/NauEnginePublic engine/3rdparty_libs/uriparser/cmake/test_find_package/CMakeLists.txt :60

find_package(uriparser 0.9.1 CONFIG REQUIRED
    COMPONENTS
        char
        wchar_t
    OPTIONAL_COMPONENTS
        invalid123
)

nwnxee/unified CMakeModules/FindDoxygen.cmake :27

find_package(Doxygen
               REQUIRED dot
               OPTIONAL_COMPONENTS mscgen dia)

qbs/qbs CMakeLists.txt :43

find_package(Qt${QT_VERSION_MAJOR} OPTIONAL_COMPONENTS Script QUIET)

InsightSoftwareConsortium/ITK Wrapping/Generators/Doc/CMakeLists.txt :1

find_package(Doxygen REQUIRED OPTIONAL_COMPONENTS dot)

logicalclocks/rondb storage/ndb/rest-server2/extra/drogon/drogon-1.9.7/CMakeLists.txt :843

find_package(Doxygen OPTIONAL_COMPONENTS dot dia)

mcallegari/qlcplus CMakeLists.txt :57

find_package(Qt${QT_VERSION_MAJOR} OPTIONAL_COMPONENTS Script)

KDE/marble src/lib/marble/declarative/CMakeLists.txt :34

find_package(Qt6 ${REQUIRED_QT_VERSION} OPTIONAL_COMPONENTS Positioning)

gazebosim/gazebo-classic cmake/SearchForStuff.cmake :184

find_package(DART ${DART_MIN_REQUIRED_VERSION} CONFIG OPTIONAL_COMPONENTS collision-bullet collision-ode utils-urdf)

Chatterino/chatterino2 CMakeLists.txt :143

find_package(Boost REQUIRED OPTIONAL_COMPONENTS headers)

kraxarn/spotify-qt CMakeLists.txt :33

find_package(Qt${QT_VERSION_MAJOR} OPTIONAL_COMPONENTS DBus QUIET)

Governikus/AusweisApp cmake/Libraries.cmake :161

find_package(${Qt} ${MIN_QT_VERSION} REQUIRED COMPONENTS ${QT_COMPONENTS} OPTIONAL_COMPONENTS ${QT_COMPONENTS_OPTIONAL})

Jackarain/proxy third_party/boost/libs/cobalt/CMakeLists.txt :178

find_package(Boost REQUIRED COMPONENTS system OPTIONAL_COMPONENTS json context url unit_test_framework)

Jij-Inc/OpenJij cmake/GenerateDocs.cmake :2

find_package(Doxygen
                 REQUIRED dot
                 OPTIONAL_COMPONENTS mscgen dia)

mosra/magnum-plugins src/MagnumPlugins/BasisImageConverter/Test/CMakeLists.txt :33

find_package(Magnum REQUIRED
    COMPONENTS DebugTools
    OPTIONAL_COMPONENTS AnyImageImporter)

freeorion/freeorion CMakeLists.txt :301

find_package(Boost OPTIONAL_COMPONENTS python${Boost_PYTHON_SUFFIX})

ossia/libossia src/CMakeLists.txt :21

find_package(${QT_VERSION} QUIET OPTIONAL_COMPONENTS Gui Qml)

libjxl/libjxl doc/CMakeLists.txt :11

find_package(Doxygen OPTIONAL_COMPONENTS dot)

ledger/ledger CMakeLists.txt :89

find_package(Boost ${Required_Boost_Version}
  REQUIRED date_time filesystem iostreams regex unit_test_framework
  ${BOOST_PYTHON} OPTIONAL_COMPONENTS nowide
  CONFIG)

halide/Halide CMakeLists.txt :203

find_package(Halide_LLVM 18...99 REQUIRED  # Use 99 to fake a minimum-only constraint
             COMPONENTS WebAssembly X86
             OPTIONAL_COMPONENTS AArch64 ARM Hexagon NVPTX PowerPC RISCV)

mhx/dwarfs CMakeLists.txt :195

find_package(Boost ${BOOST_REQUIRED_VERSION} REQUIRED CONFIG
               COMPONENTS chrono iostreams program_options
               OPTIONAL_COMPONENTS process)

ggarra13/mrv2 src/CMakeLists.txt :44

find_package(Vulkan OPTIONAL_COMPONENTS glslang shaderc_combined SPIRV-Tools)

Slicer/SlicerGitSVNArchive CMake/SlicerBlockInstallQt.cmake :12

find_package(Qt5 REQUIRED
      COMPONENTS
        Qml
        Quick
        QuickWidgets
      OPTIONAL_COMPONENTS
        Positioning  # Soft build-time dependency. See https://bugreports.qt.io/browse/QTBUG-57418
      )

isce-framework/isce3 extern/CMakeLists.txt :98

find_package(OpenMP OPTIONAL_COMPONENTS CXX)

openclonk/openclonk CMakeLists.txt :326

find_package(GTK3 COMPONENTS gthread gio gobject glib OPTIONAL_COMPONENTS gtksourceview)

fpoussin/QtUsb CMakeLists.txt :22

find_package(Qt6 ${PROJECT_VERSION} CONFIG
    OPTIONAL_COMPONENTS
)

karastojko/mailio CMakeLists.txt :109

find_package(Doxygen COMPONENTS doxygen OPTIONAL_COMPONENTS dot)

cwida/FastLanes publications/data_parallelized_encodings/CMakeLists.txt :105

find_package(Doxygen OPTIONAL_COMPONENTS dot)

DLR-SC/tigl cmake/FindBoost.cmake :12

find_package(Boost
    [version] [EXACT]      # Minimum or EXACT version e.g. 1.67.0
    [REQUIRED]             # Fail with error if Boost is not found
    [COMPONENTS <libs>...] # Boost libraries by their canonical name
                           # e.g. "date_time" for "libboost_date_time"
    [OPTIONAL_COMPONENTS <libs>...]
                           # Optional Boost libraries by their canonical name)
    )

ovsky/sumi-emu vcpkg_installed/x64-windows/share/boost/cmake-build/BoostRoot.cmake :234

find_package(Boost COMPONENTS ${required_components} OPTIONAL_COMPONENTS ${optional_components} REQUIRED CONFIG)

TeXworks/texworks CMakeLists.txt :218

find_package(Qt5 OPTIONAL_COMPONENTS Script ScriptTools)

StephLin/KCP CMakeLists.txt :46

find_package(Doxygen OPTIONAL_COMPONENTS dot)

klee/klee docs/CMakeLists.txt :15

find_package(Doxygen OPTIONAL_COMPONENTS dot)

celtera/libremidi cmake/libremidi.deps.cmake :37

find_package(Boost REQUIRED OPTIONAL_COMPONENTS cobalt)

trilinos/Trilinos packages/compadre/CMakeLists.txt :187

FIND_PACKAGE(Trilinos COMPONENTS Kokkos KokkosKernels OPTIONAL_COMPONENTS Gtest)

Komet/MediaElch docs/CMakeLists.txt :3

find_package(Doxygen OPTIONAL_COMPONENTS dot)

fluffos/fluffos src/thirdparty/libtelnet/doc/man/man3/CMakeLists.txt :1

find_package(Doxygen
  OPTIONAL_COMPONENTS dot)

stella-cv/stella_vslam src/stella_vslam/CMakeLists.txt :13

find_package(g2o REQUIRED
             COMPONENTS
             g2o::core
             g2o::stuff
             g2o::types_sba
             g2o::types_sim3
             g2o::solver_dense
             g2o::solver_eigen
             g2o::solver_csparse
             g2o::csparse_extension
             OPTIONAL_COMPONENTS
             g2o::csparse)

pyside/pyside-setup sources/pyside6/cmake/PySideSetup.cmake :198

find_package(Qt6
    COMPONENTS ${required_modules}
    OPTIONAL_COMPONENTS ${optional_modules}
)

google/glog CMakeLists.txt :67

find_package (GTest 1.11 COMPONENTS GTest OPTIONAL_COMPONENTS GMock NO_MODULE)

dlstreamer/dlstreamer samples/gstreamer/cpp/draw_face_attributes/CMakeLists.txt :11

find_package(OpenCV OPTIONAL_COMPONENTS core imgproc)

ufz/ogs scripts/cmake/Find.cmake :5

find_package(Doxygen 1.9.2 OPTIONAL_COMPONENTS dot)

MITK/MITK CMake/PackageDepends/MITK_OpenGL_Config.cmake :5

find_package(OpenGL REQUIRED OPTIONAL_COMPONENTS GLX)

pyushkevich/itksnap CMakeLists.txt :1745

find_package(Doxygen OPTIONAL_COMPONENTS dot)

adobe/lagrange modules/ui/CMakeLists.txt :71

find_package(OpenGL REQUIRED OPTIONAL_COMPONENTS OpenGL)

Lewuathe/mlir-hello thirdparty/llvm-project/pstl/CMakeLists.txt :46

find_package(TBB 2018 REQUIRED tbb OPTIONAL_COMPONENTS tbbmalloc)

qt/qtmultimedia CMakeLists.txt :23

find_package(Qt6 ${PROJECT_VERSION} QUIET CONFIG
    OPTIONAL_COMPONENTS
        Gui
        Network
        Svg
        Widgets
        Quick
        Qml
        Test
        QuickTest
        QuickControls2
        Quick3D
        OpenGLPrivate
        Concurrent)

Kitware/VTK CMake/FindTBB.cmake :75

find_package(TBB CONFIG ${_tbb_find_quiet}
  COMPONENTS ${_tbb_find_components}
  OPTIONAL_COMPONENTS ${_tbb_find_optional_components})

Geant4/geant4 cmake/Modules/FindTBB.cmake :84

find_package(TBB CONFIG ${_tbb_find_quiet}
  COMPONENTS ${_tbb_find_components}
  OPTIONAL_COMPONENTS ${_tbb_find_optional_components})

lagadic/visp apps/calibration/hand-eye/CMakeLists.txt :5

find_package(VISP REQUIRED visp_vision visp_io OPTIONAL_COMPONENTS visp_gui visp_robot visp_sensor)

ADVRHumanoids/OpenSoT external/soth-ext/cmake/boost.cmake :27

FIND_PACKAGE(Boost ${BOOST_REQUIRED} OPTIONAL_COMPONENTS ${boost_python_name})

personalrobotics/aikido CMakeLists.txt :90

find_package(DART 6.8.5 REQUIRED
  COMPONENTS optimizer-nlopt utils
  OPTIONAL_COMPONENTS utils-urdf # for 'perception' target
  CONFIG
)

roahmlab/RAPTOR CMakeLists.txt :49

find_package(Python 3.10
  REQUIRED COMPONENTS Interpreter Development.Module
  OPTIONAL_COMPONENTS Development.SABIModule)

qt/qtserialport CMakeLists.txt :23

find_package(Qt6 ${PROJECT_VERSION} CONFIG OPTIONAL_COMPONENTS Gui Widgets)

munich-quantum-toolkit/qcec CMakeLists.txt :40

find_package(
    Python 3.10 REQUIRED
    COMPONENTS Interpreter Development.Module
    OPTIONAL_COMPONENTS Development.SABIModule)

qt/qtwebengine CMakeLists.txt :36

find_package(Qt6 ${PROJECT_VERSION} CONFIG QUIET OPTIONAL_COMPONENTS
    Gui Widgets Network OpenGL Quick Qml PrintSupport
    WebChannel WebChannelQuick Positioning QuickControls2
    Test QuickWidgets QuickTest WebSockets Designer
    JpegPrivate PngPrivate HarfbuzzPrivate FreetypePrivate ZlibPrivate
    HttpServer Svg
)

qt/qtdeclarative CMakeLists.txt :23

find_package(Qt6 ${PROJECT_VERSION} QUIET CONFIG OPTIONAL_COMPONENTS Gui Network Widgets OpenGL OpenGLWidgets Sql Concurrent Test TestInternalsPrivate LanguageServerPrivate LinguistTools Svg ExamplesAssetDownloaderPrivate)

CGAL/cgal AABB_tree/benchmark/AABB_tree/CMakeLists.txt :7

find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Core)

m-a-d-n-e-s-s/madness cmake/modules/FindTBB.cmake :230

find_package(TBB CONFIG ${_tbb_find_quiet}
        COMPONENTS ${_tbb_find_components}
        OPTIONAL_COMPONENTS ${_tbb_find_optional_components}
        HINTS ${TBB_PREFIX_PATH})

qtproject/pyside-pyside-setup sources/pyside6/cmake/PySideSetup.cmake :198

find_package(Qt6
    COMPONENTS ${required_modules}
    OPTIONAL_COMPONENTS ${optional_modules}
)

ElektraInitiative/libelektra src/tools/qt-gui/CMakeLists.txt :11

find_package (
	Qt5
	OPTIONAL_COMPONENTS Svg
	QUIET)