How to find folder with pattern in Cmake

32 Views Asked by At

I am new to Cmake and having to build a app with it. My app is built from many driver modules stored in folder with naming structure like MOD1_<AR_PKG_NAME>, MOD2_<AR_PKG_NAME>...And <AR_PKG_NAME> is what I don't care. So I want to add path to each module to CMAKE_MUDULE_PATH without using <AR_PKG_NAME>. I could build if I did as below

set(CMAKE_MODULE_PATH
   ${CMAKE_MODULE_PATH}
   ${CMAKE_CURRENT_LIST_DIR}/../Platform_${AR_PKG_NAME}/
   ${CMAKE_CURRENT_LIST_DIR}/../Crypto_${AR_PKG_NAME}/
   ${CMAKE_CURRENT_LIST_DIR}/../CryIf_${AR_PKG_NAME}/
   ${CMAKE_CURRENT_LIST_DIR}/../Csm_${AR_PKG_NAME}/
)

Now I want change it to smt like this

set(CMAKE_MODULE_PATH
   ${CMAKE_MODULE_PATH}
   ${CMAKE_CURRENT_LIST_DIR}/../Platform_*/
   ${CMAKE_CURRENT_LIST_DIR}/../Crypto_*/
   ${CMAKE_CURRENT_LIST_DIR}/../CryIf_*/
   ${CMAKE_CURRENT_LIST_DIR}/../Csm_*/
)

How can I do it in Cmake?

How to find an folder from a pattern

0

There are 0 best solutions below