exbluesbreaker
exbluesbreaker

Reputation: 2356

Cmake additional includes

How to set additional includes for cmake project (not in CmakeLists.txt) or how to include additional *.cmake file for project without overwriting this project CMakeLists.txt.

I try -DCMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES=<...> and -DCMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES=<...>, but there is no effect.

Upvotes: 5

Views: 6263

Answers (1)

sakra
sakra

Reputation: 65751

You can add additional include directories by specifying them in the variables CMAKE_CXX_FLAGS and CMAKE_C_FLAGS upon invoking cmake:

cmake -DCMAKE_CXX_FLAGS="-I /path/to/dir" ..

Upvotes: 7

Related Questions