[CMake] INCLUDE_DIRECTORIES in sub-directories doesn't work?

Sean Soria sean.soria at gmail.com
Tue Nov 25 16:39:25 EST 2008


CMakeLists.txt:
ADD_EXECUTABLE(hello main.c foo/main.c)
ADD_SUBDIRECTORY(foo)

foo/CMakeLists.txt:
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})

main.c files are empty because this is just a test of checking the compile line.

On Tue, Nov 25, 2008 at 1:31 PM, Bill Hoffman <bill.hoffman at kitware.com> wrote:
> Sean Soria wrote:
>>
>> I wouldn't expect that to work since I can see that it got the memo to
>> include that directory but just doesn't do it.  But I tried it out by
>> using INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) and I got the
>> same bad results.
>>
>
> That should work, if you could provide a small example where it does not
> work that would be helpful.
>
> -Bill
>


More information about the CMake mailing list