Re: [CMake] Include directories for C compile command

2011-08-04 Thread Glenn Coombs
CMake deliberately works in a top-down manner for most things. So variable values and preprocessor definitions are inherited in subdirectories from the values they had in the parent. And any subsequent changes made to them in the subdirectory scope are not propogated up to the parent. This is a

Re: [CMake] Include directories for C compile command

2011-08-03 Thread Andrei Buzgan
Hello Glenn and thanks, I found out yesterday the method you describe works. I was trying to use include_directories() before, but unfortunately the statement was after any add_directory() statement and it was a matter of scope (what other variable/property updates add_directory() does?). It works

Re: [CMake] Include directories for C compile command

2011-08-03 Thread Glenn Coombs
Have you tried using the include_directories() command ? In your top level CMakeLists.txt add a line like this: include_directories(SWC1 SWC2 SWC3 Common) before you do any add_subdirectory() commands. Does that not add the appropriate -Ixxx flags to the compile command ? It does for me but I'

[CMake] Include directories for C compile command

2011-08-02 Thread Andrei Buzgan
Hello everyone, I'm trying to set up an environment for building a pre-existing medium sized embedded software project, by using CMake 2.8 and MinGW. The compiler kit is specific for the target microcontroller and contains C compiler, assembler, linker, all different executables. I do have some r