What is the difference between find_package(podofo CONFIG REQUIRED) and find_package(podofo REQUIRED)?

If your project is about to link to a lib, you probably need to use the find_package command of CMake.

find_package(libname CONFIG REQUIRED)

or, find_package(libname REQUIRED)

What is the difference between them? They both search some directories for some .cmake files, which will be called to generate some CMake variables for the libname library such as $PODOFO_INCUDE_DIRS. But the two commands search different directories for different .cmake files.

find_package(libname REQUIRED) will search for Findlibname.cmake while find_package(libname CONFIG REQUIRED) will search for libname-config.cmake.

vcpkg installed packages use libname-config.cmake so you have to use find_package(libname CONFIG REQUIRED) in the CMakelists.txt of your project. You have instructed CMake to use vcpkg by using the CMAKE_TOOLCHAIN_FILE variable while vcpkg knows where the libname-config.cmake is.

reference

 

 

Did you like this?
Tip admin with Cryptocurrency

Donate Bitcoin to admin

Scan to Donate Bitcoin to admin
Scan the QR code or copy the address below into your wallet to send some bitcoin:

Donate Bitcoin Cash to admin

Scan to Donate Bitcoin Cash to admin
Scan the QR code or copy the address below into your wallet to send bitcoin:

Donate Ethereum to admin

Scan to Donate Ethereum to admin
Scan the QR code or copy the address below into your wallet to send some Ether:

Donate Litecoin to admin

Scan to Donate Litecoin to admin
Scan the QR code or copy the address below into your wallet to send some Litecoin:

Donate Monero to admin

Scan to Donate Monero to admin
Scan the QR code or copy the address below into your wallet to send some Monero:

Donate ZCash to admin

Scan to Donate ZCash to admin
Scan the QR code or copy the address below into your wallet to send some ZCash:

Leave a Reply