Thinking about this some more, I suspect Petr's comments may be on the
right track. What matters is the value of this variable in the scope of the
*directory* being processed. You need the CMAKE_INCLUDE_CURRENT_DIR
variable to be set in that directory scope, if I'm understanding the docs
correctly.
Hi Tiago.
Yes, Craig's original comment applies. Targets do not have scope, variables
do. Because you're in a function, you'd need to set the variable using
PARENT_SCOPE to have it apply outside the function:
function(AddTest)
#...
set(CMAKE_INCLUDE_CURRENT_DIR ON PARENT_SCOPE)
#...
endfunc
Are you sure what you want isn't to specify INTERFACE header directories on
whatever is being passed in as the ${TEST_LIBRARIES} libraries? If the
requirement to have the parent directory's source/binary dirs added to the
header search path is coming from those instead of the test's own
executable,
Hi Craig,
Maybe my problem description was lacking. Below is the function I have.
Both CMAKE_INCLUDE_CURRENT_DIR and the target are defined on the same
function scope, but this does not seem to work. I need to define
CMAKE_INCLUDE_CURRENT_DIR on the parent CMakeLists file.
function(AddTest)
s
function() introduces a new scope, so if you want changes you make to
variables inside the function to be visible outside the function, you need
to use set(... PARENT_SCOPE). Alternatively, a macro() does not introduce a
new scope, so replacing your function() with a macro() may also yield the
beha
Hi,
Does CMAKE_INCLUDE_CURRENT_DIR need to be set outside of a function?
I have a function where I define an executable "add_executable". This
executable uses moc'ed Qt clasees, so I need to set
CMAKE_INCLUDE_CURRENT_DIR. It seems like I have to set it from the top
level script calling the functi
On Tuesday 20 March 2007 21:45:15 Brandon J. Van Every wrote:
> Feel free to improve the docs if you have better wordsmithing. It is a
> wiki, after all. I haven't had time + brain cells, and I'm no more
> responsible for the maintenance of the docs than you or anyone else. I
> just try to impro
Pascal Fleury wrote:
So it will in effect "automatically add the current source dir and current
binary dir to the include directories in every directory" as the doc says.
However, the *current* directory has a different value when cmake is
processing project/src/CMakeLists.txt than when proce
On Tuesday 20 March 2007 10:00:58 Kishore, Jonnalagadda (IE10) wrote:
>
> So by that you mean that every folder where a CMakeLists.txt is
> processed, includes itself in the search path but not the other folders
> where the other CMakeLists.txt were processed!?
That's my understanding, yes.
> I
> On Tuesday 20 March 2007 07:07:35 Kishore, Jonnalagadda (IE10) wrote:
> > > Kishore, Jonnalagadda (IE10) wrote:
> > This is now a little confusing especially, when the description says
"
> > automatically add CMAKE_CURRENT_SOURCE_DIR and
CMAKE_CURRENT_BINARY_DIR
> > to the include directories _in
On Tuesday 20 March 2007 07:07:35 Kishore, Jonnalagadda (IE10) wrote:
> > Kishore, Jonnalagadda (IE10) wrote:
> This is now a little confusing especially, when the description says "
> automatically add CMAKE_CURRENT_SOURCE_DIR and CMAKE_CURRENT_BINARY_DIR
> to the include directories _in every dir
> Kishore, Jonnalagadda (IE10) wrote:
> >
> > If I understand you correctly, you mean to say that in the top level
> > CMakeLists.txt, if I SET(CMAKE_INCLUDE_CURRENT_DIR ON) and
> > INCLUDE_DIRECTORY(.) then all other subdirectories I add will all
> > automatically include the other directories?
>
Kishore, Jonnalagadda (IE10) wrote:
If I understand you correctly, you mean to say that in the top level
CMakeLists.txt, if I SET(CMAKE_INCLUDE_CURRENT_DIR ON) and
INCLUDE_DIRECTORY(.) then all other subdirectories I add will all
automatically include the other directories?
This however, is not
Kishore, Jonnalagadda (IE10) wrote:
I just checked again and confirm that the information was already there under the section
"Various Options"
http://www.cmake.org/Wiki/CMake_Useful_Variables#Various_Options
Now it is also added under "Environment Variables"
http://www.cmake.org/Wiki/CMake_
> On Friday 16 March 2007 17:56:46 Brandon J. Van Every wrote:
> > Kishore, Jonnalagadda (IE10) wrote:
> > > But then, despite setting the value I had to put in
> > > INCLUDE_DIRECTORIES(.)
> >
> > And I was brief because I don't know if there any caveats on how it
can
> > be used. Maybe you foun
> > > Thanks for your reply. I did read the wiki that basically said the
> same
> > > thing.
> >
> > That's 'cuz I wrote it after it was posted here. :-)
>
> That's funny! I am pretty sure I thought of using it after reading about
> it on one of the pages... ;-)
I just checked again and confirm
On Friday 16 March 2007 17:56:46 Brandon J. Van Every wrote:
> Kishore, Jonnalagadda (IE10) wrote:
> > But then, despite setting the value I had to put in
> > INCLUDE_DIRECTORIES(.)
>
> And I was brief because I don't know if there any caveats on how it can
> be used. Maybe you found a bug. Mayb
kitts wrote:
But then, despite setting the value I had to put in
INCLUDE_DIRECTORIES(.)
And I was brief because I don't know if there any caveats on how it can
be used. Maybe you found a bug. Maybe the behavior isn't consistent
across generators. Maybe the value isn't propagated
On Friday 16 Mar 2007 IST, Brandon J. Van Every wrote:
> Kishore, Jonnalagadda (IE10) wrote:
> >> -Original Message-
> >>
> >>
> >> CMAKE_INCLUDE_CURRENT_DIR is the same as
> >> INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}
> >> ${CMAKE_CURRENT_SOURCE_DIR}) for all targets.
> >>
> >>
Kishore, Jonnalagadda (IE10) wrote:
-Original Message-
CMAKE_INCLUDE_CURRENT_DIR is the same as
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}) for all targets.
If you have a project that constantly needs to add the current source
directory and the cur
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On
> Behalf Of Filipe Sousa
> Sent: Friday, March 16, 2007 2:33 AM
> To: cmake@cmake.org
> Subject: Re: [CMake] CMAKE_INCLUDE_CURRENT_DIR?
>
> -BEGIN PGP SIGNED MESSAGE
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Brandon J. Van Every wrote:
>
> When explaining a variable, it's good to put it on the wiki. I did it
> this time.
> http://www.cmake.org/Wiki/CMake_Useful_Variables#Environment_Variables
>
>
> Cheers,
> Brandon Van Every
Thanks Brandon!
I'm not g
Brandon J. Van Every wrote:
>
> When explaining a variable, it's good to put it on the wiki. I did it
> this time.
> http://www.cmake.org/Wiki/CMake_Useful_Variables#Environment_Variables
>
>
> Cheers,
> Brandon Van Every
Thanks Brandon!
I'm not good at writing documentation and my poor englis
Filipe Sousa wrote:
CMAKE_INCLUDE_CURRENT_DIR is the same as
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}) for all targets.
When explaining a variable, it's good to put it on the wiki. I did it
this time.
http://www.cmake.org/Wiki/CMake_Useful_Variables#En
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Kishore, Jonnalagadda (IE10) wrote:
> Can someone explain to me the use of CMAKE_INCLUDE_CURRENT_DIR?
>
> In the root CMakeLists.txt file of my project I tried setting the
> variable to ON (tried 1 as well) with:
>
> SET(CMAKE_INCLUDE_CURRENT_DIR ON)
Can someone explain to me the use of CMAKE_INCLUDE_CURRENT_DIR?
In the root CMakeLists.txt file of my project I tried setting the
variable to ON (tried 1 as well) with:
SET(CMAKE_INCLUDE_CURRENT_DIR ON)
This seemed to make no difference. My expectation reading
http://www.cmake.org/Wiki/CMake_Use
Alexander Neundorf wrote:
Von: Brad King <[EMAIL PROTECTED]>
The idea of that option was to make *double-quote* includes look the
same for in-source and out-of-source builds. For angle-bracket
includes only the explicitly given include path should be used.
Note in your example that running
> Von: Brad King <[EMAIL PROTECTED]>
...
> > Also the name
> > "CMAKE_INCLUDE_CURRENT_DIR" suggests that then the current dir will
> > be part of the include path. But as it is now, this is only true for
> > out-of-source builds.
>
> Given the name and that this isn't the default anyway I
> Von: Brad King <[EMAIL PROTECTED]>
>
> Alexander Neundorf wrote:
> > Hi,
> >
> > in cmLocalGenerator.cxx there's the following code:
> >
> > if(!inSource && this->Makefile->IsOn("CMAKE_INCLUDE_CURRENT_DIR"))
> > {
> >includeSourceDir = true;
> >includeBinaryDir = true;
Alexander Neundorf wrote:
Hi,
in cmLocalGenerator.cxx there's the following code:
if(!inSource && this->Makefile->IsOn("CMAKE_INCLUDE_CURRENT_DIR"))
{
includeSourceDir = true;
includeBinaryDir = true;
}
Why is there the test for !inSource ?
This means if I have in one directo
Hi,
in cmLocalGenerator.cxx there's the following code:
if(!inSource && this->Makefile->IsOn("CMAKE_INCLUDE_CURRENT_DIR"))
{
includeSourceDir = true;
includeBinaryDir = true;
}
Why is there the test for !inSource ?
This means if I have in one directory:
test1.h
main.c:
31 matches
Mail list logo