Aim
Here are some examples showing how to use cmake find packet.
Learn from
Here
Examples - use default modules
ALSA library
You can install the library first.
$ sudo apt-get install libasound2
You can put the following code into CMakeLists.txt.
# Handle ALSA / ASound libraries
find_package(ALSA)
if (ALSA_FOUND)
message (STATUS "Info - Found ALSA library: ${ALSA_LIBRARY}")
message (STATUS "Info - Found ALSA include: ${ALSA_INCLUDE_DIR}")
else (ALSA_FOUND)
message (FATAL_ERROR "Info - ALSA is not found")
endif (ALSA_FOUND)
How can I know which variables I can use?