I have defined a variable in CMakeLists.txt as follows:
set(MY_PROJECT_DEPENDENCIES boost-core boost-optional sqlite3)
I want to check if there are found using find_package() as follows:
find_package(MY_PROJECT_DEPENDENCIES REQUIRED).
But this does not work. Any workaround for the same?
Edit: As drescherjm suggested using a foreach loop works perfectly. Here is the code snippet:
macro(find_packages)
foreach(package ${ARGN})
find_package(${package} REQUIRED)
endforeach()
endmacro()
Call it using:
find_packages(${MY_PROJECT_DEPENDENCIES})```