1

I have currently, in my CMake lists :

FIND_PATH(BOINC_INCLUDE_DIR NAMES boinc_api.h PATH_SUFFIXES boinc DOC "The Boinc include directory (where boinc_api.h is)") 

This command find the directory /usr/include/boinc. But I want to add all the subdirectories in the boinc directory. How to do that ?

Thank you very much.

1 Answer 1

2

Try the following code. It iterates through all files and directories in BOINC_INCLUDE_DIR and appends directories to include directories list:

FILE(GLOB _ALL_FILES ${BOINC_INCLUDE_DIR} ${BOINC_INCLUDE_DIR}/*) FOREACH(_FILE ${_ALL_FILES}) IF(IS_DIRECTORY ${_FILE}) INCLUDE_DIRECTORIES(${_FILE}) ENDIF() ENDFOREACH() 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.