Alex Makarenko | 1 Jul 2006 08:03
Picon

dependencies on auto-generated files and VC-8.0

Hello,

We are porting a fairly large C++ project from linux/gcc to win32/vc-80. We
are using cmake 2.4.2. Everything is ok except for dependencies between
targets and auto-generated files. 

Before going into details I want to ask a general question about a paragraph
on p.16 of Mastering CMake book which says "CMake has built-in dependency
analysis capabilities for C and C++ source code files. Since IDE's support
and maintain dependency information, CMake skips this step for those build
systems." 

Does it mean that CMake does not communicate any dependency information to
Visual Studio? If so, then there is no point in trying to relate the
dependency structure to CMake.

Thanks a lot,
Alex Makarenko
William A. Hoffman | 1 Jul 2006 13:28
Picon

Re: dependencies on auto-generated files and VC-8.0

At 02:03 AM 7/1/2006, Alex Makarenko wrote:
>Hello,
>
>We are porting a fairly large C++ project from linux/gcc to win32/vc-80. We
>are using cmake 2.4.2. Everything is ok except for dependencies between
>targets and auto-generated files. 
>
>Before going into details I want to ask a general question about a paragraph
>on p.16 of Mastering CMake book which says "CMake has built-in dependency
>analysis capabilities for C and C++ source code files. Since IDE's support
>and maintain dependency information, CMake skips this step for those build
>systems." 
>
>Does it mean that CMake does not communicate any dependency information to
>Visual Studio? If so, then there is no point in trying to relate the
>dependency structure to CMake.

No, that means that CMake does not scan the c++/c files for #include lines
and create depend information.  The custom commands and inter-target
depends are given to the IDE.  For auto generated files, make sure
the files are in the source list for the target that uses them.  If the
two targets do not link to each other (which is rare), you can use
add_dependency to connect two targets.

So, maybe you could provide a small example of the problem you are
having and it should be simple to fix.

-Bill
William A. Hoffman | 1 Jul 2006 21:21
Picon

RE: dependencies on auto-generated files and VC-8.0

At 03:09 PM 7/1/2006, Alex Makarenko wrote:
>Hi Bill,
>
>Thanks a lot for your response, here's the basic structure of the project:
>
>File: Autogen{.h/.cpp}
>   > generated using ADD_CUSTOM_COMMAND
>
>Library: Lib0
>   > compiles Autogen{.h/.cpp} into a lib with ADD_LIBRARY()
>
>File: humanwritten.cpp
>   > #include's Autogen.h
>
>Library: Lib1
>   > builds humanwritten.cpp into a lib
>   > links to Lib0
>
>This works with gcc Makefiles. The problem is that VCC jumps to compile Lib1
>before Lib0 is finished (or even started) and before the Autogen.* files are
>generated.
>
>Lib1's CMakeLists.txt file includes the following:
>  ADD_LIBRARY( Lib1 STATIC ${SRCS} )
>  TARGET_LINK_LIBRARIES( Lib1 Lib0 )
>
>So do you mean that I have to manually add the list of files included from
>humanwritten.h/cpp to the source list of Lib1? And is that the part of the
>job that CMake expects VCC to do?
>
(Continue reading)

Alex Makarenko | 2 Jul 2006 03:12
Picon

RE: dependencies on auto-generated files and VC-8.0

> 
> Try this:
> ADD_DEPENDENCIES(Lib1 Lib0)
> 

Tried it, does not change anything, unfortunately. 

My understanding is that with non-custom targets (like libraries)
TARGET_LINK_LIBRARIES implies the dependency which ADD_DEPENDENCIES
specifies explicitly for custom targets.
William A. Hoffman | 2 Jul 2006 04:32
Picon

RE: dependencies on auto-generated files and VC-8.0

At 09:12 PM 7/1/2006, Alex Makarenko wrote:
>> 
>> Try this:
>> ADD_DEPENDENCIES(Lib1 Lib0)
>> 
>
>Tried it, does not change anything, unfortunately. 
>
>My understanding is that with non-custom targets (like libraries)
>TARGET_LINK_LIBRARIES implies the dependency which ADD_DEPENDENCIES
>specifies explicitly for custom targets.

It should work, and does for other projects, so something odd is happening here.
Can you provide a small example, and add a bug to the bug tracker?

-Bill
Alex Makarenko | 2 Jul 2006 11:00
Picon

Re: dependencies on auto-generated files and VC-8.0

Hi Bill,

everything works now. In the process of collecting details to show to you I 
realized that problems were in a different dependent library and that one did 
not have the TARGET_LINK_LIBRARIES or ADD_DEPENDENDCY set.

thanks a lot for your time,
alex

On Sunday 02 July 2006 12:32, you wrote:
> At 09:12 PM 7/1/2006, Alex Makarenko wrote:
> >> Try this:
> >> ADD_DEPENDENCIES(Lib1 Lib0)
> >
> >Tried it, does not change anything, unfortunately.
> >
> >My understanding is that with non-custom targets (like libraries)
> >TARGET_LINK_LIBRARIES implies the dependency which ADD_DEPENDENCIES
> >specifies explicitly for custom targets.
>
> It should work, and does for other projects, so something odd is happening
> here. Can you provide a small example, and add a bug to the bug tracker?
>
> -Bill
Andriy Rysin | 2 Jul 2006 18:24
Picon

question about linker flags from PKGCONFIG

Hi

I've got a question about PKGCONFIG usage
Let's say I've got SOMELIB_CFLAGS and SOMELIB_LD_FLAGS from PKGCONFIG by
this:

PKGCONFIG(somelib SOMELIB_INCLUDE_DIR SOMELIB_LINK_DIR SOMELIB_LD_FLAGS
SOMELIB_CFLAGS)

I could use
SET(CMAKE_CXX_FLAGS "${SOMELIB_CFLAGS} ${CMAKE_CXX_FLAGS}")
to set includes for that dir, but I could not find any CMAKE_LD_FLAGS to
add SOMELIB_LD_FLAGS to, so that I've got my library included on linking
stage

I would really appreciate any help here.

Thanks,
Andriy

P.S. BTW as far as I understand *_INCLUDE_DIR and *_LINK_DIR are quite
useless for application developer, am I correct?
Alexander Neundorf | 3 Jul 2006 02:18
Picon

cmake 2.4.3 release schedule ?

Hi,

when is 2.4.3 scheduled ?
We (KDE) don't have any open issues with it, and having a release with the 
improved handling of generated files would be nice :-)

Bye
Alex

--

-- 

"Feel free" – 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail
Manuel Klimek | 3 Jul 2006 08:14

Bug #3218 - Automatic Visual Studio dependency generation

Hi there,

Here's a got a completely reworked version of my patch.
For me this is a killer feature when working with Visual
Studio 2005 and cmake: It automatically generates
workspaces for projects in subdirectories that contain
all required visual studio projects to compile the project
in the subdirectory.
This is very useful for big projects where you have
many applications using a lot of common libraries, but you
don't want to use the toplevel workspace, because loading
time and intellisense can be a real pain.
Feedback welcome :-)

Cheers,
Manuel

PS: The patch is against cmake 2.4.2 but will probably work on HEAD, too

Index: cmGlobalVisualStudio71Generator.cxx
===================================================================
---
cmGlobalVisualStudio71Generator.cxx	(.../tags/cmake-2.4.2/Source/cmGlobalVisualStudio71Generator.cxx)	(revision
16548)
+++
cmGlobalVisualStudio71Generator.cxx	(.../trunk/cmake/Source/cmGlobalVisualStudio71Generator.cxx)	(revision
16548)
 <at>  <at>  -48,7 +48,7  <at>  <at> 
 void cmGlobalVisualStudio71Generator
 ::WriteSLNFile(std::ostream& fout,
(Continue reading)

Kris Dekeyser | 3 Jul 2006 09:24
Picon

RE: Regex changes between cmake 2.0.6 and 2.4.2 ??

Then, is there any configuration setting that could influence the regex behavior ? 

- Kris

> -----Original Message-----
> From: Brad King [mailto:brad.king@...] 
> Sent: vrijdag 30 juni 2006 19:24
> To: Kris Dekeyser
> Cc: 'cmake@...'
> Subject: Re: [CMake] Regex changes between cmake 2.0.6 and 2.4.2 ??
> 
> Kris Dekeyser wrote:
> > Hi,
> >  
> > I was running my build macros in the latest CMake (2.4.2) 
> and encountered very strange errors. With some debug printing 
> I discovered that the new CMake version behaves differently 
> regarding RegEx testing compared to the version 2.0.6 that we 
> currently use.
> >  
> > This is a summary of what we do:
> >  
> > SET(RegexAbsoluteDir "^([a-zA-Z][:])?[/\\\\]")
> > 
> > #--- Make directories absolute
> > SET(DirList)
> > PRINT_MESSAGE(9 "WordList ${WordList}")
> > FOREACH(word ${WordList})
> >   PRINT_MESSAGE(9 "word ${word}")
> >   IF(${word} MATCHES ${RegexAbsoluteDir})
(Continue reading)


Gmane