Re: [CMake] install() and EXCLUDE_FROM_ALL issue ( patch review )

2007-08-03 Thread Brad King
Alexandru Ciobanu wrote:
 You are right. The patch does not do the right thing.
 I just observed that it also completely removes the
 preinstall rule for excluded directories.
 
 So make install insde those dirs will fail because there
 is no preinstall.
 
 Alexander Neundorf wrote:

 I guess the EXCLUDE_FROM_ALL targets will then also not be relinked if
 they are installed, right ?

 Maybe for EXCLUDE_FROM_ALL targets the relinking should happen when
 the target gets built, not when it's installed ?

Actually the patch may not have been as far off as you think.  It just
has to be applied to half of the contents inside the if statement.  The
full patch against 2.4.7 is attached.

I'll submit this for inclusion in the 2.4 branch.  It has been fixed in
the CVS version.

-Brad
Index: Source/cmGlobalUnixMakefileGenerator3.cxx
===
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalUnixMakefileGenerator3.cxx,v
retrieving revision 1.56.2.9
diff -c -3 -p -r1.56.2.9 cmGlobalUnixMakefileGenerator3.cxx
*** Source/cmGlobalUnixMakefileGenerator3.cxx	13 Oct 2006 14:52:02 -	1.56.2.9
--- Source/cmGlobalUnixMakefileGenerator3.cxx	3 Aug 2007 19:49:29 -
*** cmGlobalUnixMakefileGenerator3
*** 861,871 
lg-WriteMakeRule(ruleFileStream, 
  Pre-install relink rule for target.,
localName.c_str(), depends, commands, true);
! depends.clear();
! depends.push_back(localName);
! commands.clear();
! lg-WriteMakeRule(ruleFileStream, Prepare target for install.,
!   preinstall, depends, commands, true);
  }
  
// add the clean rule
--- 861,875 
lg-WriteMakeRule(ruleFileStream, 
  Pre-install relink rule for target.,
localName.c_str(), depends, commands, true);
! 
! if (!exclude  t-second.IsInAll())
!   {
!   depends.clear();
!   depends.push_back(localName);
!   commands.clear();
!   lg-WriteMakeRule(ruleFileStream, Prepare target for install.,
! preinstall, depends, commands, true);
!   }
  }
  
// add the clean rule
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] install() and EXCLUDE_FROM_ALL issue ( reconfirmed in 2.4.7 )

2007-08-02 Thread Alexander Neundorf
On Wednesday 01 August 2007 17:24, Alexandru Ciobanu wrote:
 Hi!

 Please ignore my last message. According to bug 3100
 info, this should have been fixed after 2.2.3.

 I have just reproduced it with 2.4.7.

 Check the attached test case. Here are the steps to reproduce:
   1. cd build
   2. cmake ..
   3. make
 ... will build only the lilbrary...
   4. make install
 ... will check all the targets and build the test ...
 ... will install only the lib ...

 At step 4, the test should not be built.

 If you guys confirm it, I'll re-add this to the Bug Tracker.

I think it's the relinking step which doesn't care about EXCLUDE_FROM_ALL. Can 
you please check that there is not already a bug report about this ?

I.e. has make; make preinstall the same effect ?

Alex
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] install() and EXCLUDE_FROM_ALL issue ( reconfirmed in 2.4.7 )

2007-08-02 Thread Alexandru Ciobanu

Hi, Alexander!

Yes you are right, the sequence:
  make
  make preinstall
has the same effect - it builds the targets in the
EXCLUDED_FROM_ALL directory.

Regarding the bug reports, I've found one that
exposes the same issue, but it has status fixed,
and was filed for an older version ( 2.2.3):
http://www.cmake.org/Bug/bug.php?op=showbugid=3100pos=0

Alex Ciobanu



Alexander Neundorf wrote:
I think it's the relinking step which doesn't care about EXCLUDE_FROM_ALL. Can 
you please check that there is not already a bug report about this ?


I.e. has make; make preinstall the same effect ?

Alex
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


  


___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] install() and EXCLUDE_FROM_ALL issue ( reconfirmed in 2.4.7 )

2007-08-02 Thread Brandon Van Every
On 8/2/07, Alexander Neundorf [EMAIL PROTECTED] wrote:
 On Thursday 02 August 2007 10:01, Brandon Van Every wrote:
 
  I'm not shocked.  Anecdotally we've seen weird dependency errors for
  Chicken on Linux, but since I'm not the Linux guy, we were never able

 With static or shared libs ?
 With shared libs there really should be no problems, with static libs it is
 much harder to get right.

Indeed it was a static library problem, and we solved it by
switching to dynamic linking for the bootstrap, IIRC.  But this was
maybe 2 months ago and is no longer fresh in my mind as to the
details.  We never nailed down a Linux reproducer, as I wasn't doing
Linux at the time.  It was definitely a Linux-specific issue though.


Cheers,
Brandon Van Every
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] install() and EXCLUDE_FROM_ALL issue ( reconfirmed in 2.4.7 )

2007-08-02 Thread Brandon Van Every
On 8/2/07, Alexandru Ciobanu [EMAIL PROTECTED] wrote:
 Hi, Brandon!

 I am on 32bit Linux. I've reproduced this on the
 following systems (with 2.4.6 and 2.4.7):
  - Red Hat Enterprise 5
  - SUSE Linux Enterprise Server 10
  - Ubuntu 7.04

 On these systems cmake generates Makefiles.

I'm not shocked.  Anecdotally we've seen weird dependency errors for
Chicken on Linux, but since I'm not the Linux guy, we were never able
to pin down the problem.  Instead I changed something about the build
and the dependency problem went away.  I suspect there's a bug or two
lurking in Linux dependency checking toolchains.


Cheers,
Brandon Van Every
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] install() and EXCLUDE_FROM_ALL issue ( reconfirmed in 2.4.7 )

2007-08-02 Thread Alexander Neundorf
On Thursday 02 August 2007 10:01, Brandon Van Every wrote:
 On 8/2/07, Alexandru Ciobanu [EMAIL PROTECTED] wrote:
  Hi, Brandon!
 
  I am on 32bit Linux. I've reproduced this on the
  following systems (with 2.4.6 and 2.4.7):
   - Red Hat Enterprise 5
   - SUSE Linux Enterprise Server 10
   - Ubuntu 7.04
 
  On these systems cmake generates Makefiles.

 I'm not shocked.  Anecdotally we've seen weird dependency errors for

The problem described here has AFAICT nothing to do with library dependency 
checking, but with the handling of EXCLUDE_FROM_ALL targets when installing, 
i.e. the relink step.

 Chicken on Linux, but since I'm not the Linux guy, we were never able

With static or shared libs ?
With shared libs there really should be no problems, with static libs it is 
much harder to get right.

Bye
Alex
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] install() and EXCLUDE_FROM_ALL issue ( reconfirmed in 2.4.7 )

2007-08-02 Thread Alexandru Ciobanu

Hi!

I am not sure if any previous target related EXCLUDE_FROM_ALL
problems are linked with this one, but what I found is this:

 - in CMakeFiles/Makefile2 ( which defines the preinstall
 rule ) there is a section that processes the test/ directory.

I removed it and make install did work correctly. So it's a
matter of finding where it happens in the code. I am looking
into that now.

Alex Ciobanu


Brandon Van Every wrote:

On 8/2/07, Alexander Neundorf [EMAIL PROTECTED] wrote:
  

On Thursday 02 August 2007 10:01, Brandon Van Every wrote:


I'm not shocked.  Anecdotally we've seen weird dependency errors for
Chicken on Linux, but since I'm not the Linux guy, we were never able
  

With static or shared libs ?
With shared libs there really should be no problems, with static libs it is
much harder to get right.



Indeed it was a static library problem, and we solved it by
switching to dynamic linking for the bootstrap, IIRC.  But this was
maybe 2 months ago and is no longer fresh in my mind as to the
details.  We never nailed down a Linux reproducer, as I wasn't doing
Linux at the time.  It was definitely a Linux-specific issue though.


Cheers,
Brandon Van Every
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


  


___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] install() and EXCLUDE_FROM_ALL issue ( patch review )

2007-08-02 Thread Alexander Neundorf
On Thursday 02 August 2007 13:01, Alexandru Ciobanu wrote:
 Hi!

 I was able to find and correct the problem.
 I have used the 2.4.7 release sources.

 Here is the trivial patch ( also attached):
 --- cmake-2.4.7/Source/cmGlobalUnixMakefileGenerator3.cxx
 2007-07-16 17:12:31.0 -0400
 +++ cmake-2.4.7-x/Source/cmGlobalUnixMakefileGenerator3.cxx
 2007-08-02 12:36:52.0 -0400
 @@ -850,7 +850,7 @@
  t-second.GetName(), depends, commands, true);

// Add rules to prepare the target for installation.
 -  if(t-second.NeedRelinkBeforeInstall())
 +  if(!exclude  t-second.NeedRelinkBeforeInstall())
  {
  localName = lg-GetRelativeTargetDirectory(t-second);
  localName += /preinstall;


 This will prevent the addition of the preinstall rule for EXCLUDED_FROM_ALL
 directories.

I guess the EXCLUDE_FROM_ALL targets will then also not be relinked if they 
are installed, right ?

Maybe for EXCLUDE_FROM_ALL targets the relinking should happen when the target 
gets built, not when it's installed ?

Alex
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] install() and EXCLUDE_FROM_ALL issue ( patch review )

2007-08-02 Thread Alexandru Ciobanu

Hi!

I was able to find and correct the problem.
I have used the 2.4.7 release sources.

Here is the trivial patch ( also attached):
--- cmake-2.4.7/Source/cmGlobalUnixMakefileGenerator3.cxx   
2007-07-16 17:12:31.0 -0400
+++ cmake-2.4.7-x/Source/cmGlobalUnixMakefileGenerator3.cxx 
2007-08-02 12:36:52.0 -0400

@@ -850,7 +850,7 @@
t-second.GetName(), depends, commands, true);

  // Add rules to prepare the target for installation.
-  if(t-second.NeedRelinkBeforeInstall())
+  if(!exclude  t-second.NeedRelinkBeforeInstall())
{
localName = lg-GetRelativeTargetDirectory(t-second);
localName += /preinstall;


This will prevent the addition of the preinstall rule for EXCLUDED_FROM_ALL
directories.

I've tested it for all my projects. But it obviously needs to be 
overseen by others.


Alex Ciobanu

PS: I now understand what the bug 3100 fix was all about. The author 
fixed the
problem for the cmake_install.cmake file, which was probably enough in 
2.2.3.


--- cmake-2.4.7/Source/cmGlobalUnixMakefileGenerator3.cxx	2007-07-16 17:12:31.0 -0400
+++ cmake-2.4.7-x/Source/cmGlobalUnixMakefileGenerator3.cxx	2007-08-02 12:36:52.0 -0400
@@ -850,7 +850,7 @@
 t-second.GetName(), depends, commands, true);
 
   // Add rules to prepare the target for installation.
-  if(t-second.NeedRelinkBeforeInstall())
+  if(!exclude  t-second.NeedRelinkBeforeInstall())
 {
 localName = lg-GetRelativeTargetDirectory(t-second);
 localName += /preinstall;
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] install() and EXCLUDE_FROM_ALL issue ( patch review )

2007-08-02 Thread Alexandru Ciobanu

Hi, Alex!

You are right. The patch does not do the right thing.
I just observed that it also completely removes the
preinstall rule for excluded directories.

So make install insde those dirs will fail because there
is no preinstall.

Alex

Alexander Neundorf wrote:

On Thursday 02 August 2007 13:01, Alexandru Ciobanu wrote:
  

Hi!

I was able to find and correct the problem.
I have used the 2.4.7 release sources.

Here is the trivial patch ( also attached):
--- cmake-2.4.7/Source/cmGlobalUnixMakefileGenerator3.cxx
2007-07-16 17:12:31.0 -0400
+++ cmake-2.4.7-x/Source/cmGlobalUnixMakefileGenerator3.cxx
2007-08-02 12:36:52.0 -0400
@@ -850,7 +850,7 @@
 t-second.GetName(), depends, commands, true);

   // Add rules to prepare the target for installation.
-  if(t-second.NeedRelinkBeforeInstall())
+  if(!exclude  t-second.NeedRelinkBeforeInstall())
 {
 localName = lg-GetRelativeTargetDirectory(t-second);
 localName += /preinstall;


This will prevent the addition of the preinstall rule for EXCLUDED_FROM_ALL
directories.



I guess the EXCLUDE_FROM_ALL targets will then also not be relinked if they 
are installed, right ?


Maybe for EXCLUDE_FROM_ALL targets the relinking should happen when the target 
gets built, not when it's installed ?


Alex
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


  


___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] install() and EXCLUDE_FROM_ALL issue ( patch review )

2007-08-02 Thread Hendrik Sattler
Am Donnerstag 02 August 2007 19:26 schrieb Alexander Neundorf:
 I guess the EXCLUDE_FROM_ALL targets will then also not be relinked if they
 are installed, right ?

 Maybe for EXCLUDE_FROM_ALL targets the relinking should happen when the
 target gets built, not when it's installed ?

Or evaluate if the target _can_ be installdc (hence if it was built manually) 
and only then run the preinstall for it. Would that be possible?

HS

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] install() and EXCLUDE_FROM_ALL issue

2007-08-01 Thread Alexandru Ciobanu

Hi!

Another observation I have is that the file
cmake_install.cmake is generated correctly,
it does not include the test/ directory.

So I am inclined to think that normally
make install should not ckeck the targets
in test/.

I've found a workaround in one Alexander Neundorf's
posts. The idea is to run:
  cmake -P cmake_install.cmake
instead of
  make install

Alex Ciobanu
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] install() and EXCLUDE_FROM_ALL issue

2007-08-01 Thread Brandon Van Every
On 8/1/07, Alexandru Ciobanu [EMAIL PROTECTED] wrote:
 Hi!

 Given the following simple setup:

add_subdirectory ( lib )
add_subdirectory ( tests EXCLUDE_FROM_ALL )

 When I run make it correctly builds only the lib.

 When I run make install it checks for the presence of *all* the
 targets including the ones from test/.

 Why is that? And is that a desired?

Not sure.

 If so, how can I separately install the lib before ( or without )
 building the tests.

Given the behavior, you would need an IF(conditional) around your
INSTALL statements for /tests.

Cheers,
Brandon Van Every
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] install() and EXCLUDE_FROM_ALL issue

2007-08-01 Thread Brandon Van Every
Well this is sounding like a bug.  You checked the bug tracker?  You
have a trivial reproducer?

Cheers,
Brandon Van Every

On 8/1/07, Alexandru Ciobanu [EMAIL PROTECTED] wrote:
 Hi!

 Another observation I have is that the file
 cmake_install.cmake is generated correctly,
 it does not include the test/ directory.

 So I am inclined to think that normally
 make install should not ckeck the targets
 in test/.

 I've found a workaround in one Alexander Neundorf's
 posts. The idea is to run:
cmake -P cmake_install.cmake
 instead of
make install

 Alex Ciobanu
 ___
 CMake mailing list
 CMake@cmake.org
 http://www.cmake.org/mailman/listinfo/cmake

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] install() and EXCLUDE_FROM_ALL issue ( reconfirmed in 2.4.7 )

2007-08-01 Thread Alexandru Ciobanu

Hi!

Please ignore my last message. According to bug 3100
info, this should have been fixed after 2.2.3.

I have just reproduced it with 2.4.7.

Check the attached test case. Here are the steps to reproduce:
 1. cd build
 2. cmake ..
 3. make
   ... will build only the lilbrary...
 4. make install
   ... will check all the targets and build the test ...
   ... will install only the lib ...

At step 4, the test should not be built.

If you guys confirm it, I'll re-add this to the Bug Tracker.

Alex Ciobanu



Alexandru Ciobanu wrote:

Hi Brandon,

This is my bad.

This seems to have been solved in 2.4.7:
http://www.cmake.org/Bug/bug.php?op=showbugid=3100

Alex Ciobanu


Brandon Van Every wrote:

Well this is sounding like a bug.  You checked the bug tracker?  You
have a trivial reproducer?

Cheers,
Brandon Van Every

On 8/1/07, Alexandru Ciobanu [EMAIL PROTECTED] wrote:
 

Hi!

Another observation I have is that the file
cmake_install.cmake is generated correctly,
it does not include the test/ directory.

So I am inclined to think that normally
make install should not ckeck the targets
in test/.

I've found a workaround in one Alexander Neundorf's
posts. The idea is to run:
   cmake -P cmake_install.cmake
instead of
   make install

Alex Ciobanu
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake



___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


  


___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake






install_exlcude_from_all.tar.gz
Description: GNU Zip compressed data
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] install() and EXCLUDE_FROM_ALL issue

2007-08-01 Thread Alexandru Ciobanu

Hi Brandon,

This is my bad.

This seems to have been solved in 2.4.7:
http://www.cmake.org/Bug/bug.php?op=showbugid=3100

Alex Ciobanu


Brandon Van Every wrote:

Well this is sounding like a bug.  You checked the bug tracker?  You
have a trivial reproducer?

Cheers,
Brandon Van Every

On 8/1/07, Alexandru Ciobanu [EMAIL PROTECTED] wrote:
  

Hi!

Another observation I have is that the file
cmake_install.cmake is generated correctly,
it does not include the test/ directory.

So I am inclined to think that normally
make install should not ckeck the targets
in test/.

I've found a workaround in one Alexander Neundorf's
posts. The idea is to run:
   cmake -P cmake_install.cmake
instead of
   make install

Alex Ciobanu
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake



___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


  


___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] install() and EXCLUDE_FROM_ALL issue ( reconfirmed in 2.4.7 )

2007-08-01 Thread Brandon Van Every
On 8/1/07, Alexandru Ciobanu [EMAIL PROTECTED] wrote:
 Hi!

 Please ignore my last message. According to bug 3100
 info, this should have been fixed after 2.2.3.

 I have just reproduced it with 2.4.7.

 Check the attached test case. Here are the steps to reproduce:
   1. cd build
   2. cmake ..
   3. make
 ... will build only the lilbrary...
   4. make install
 ... will check all the targets and build the test ...
 ... will install only the lib ...

 At step 4, the test should not be built.

 If you guys confirm it, I'll re-add this to the Bug Tracker.

I cannot reproduce this under mingw.  My steps are slightly different
than yours:
1. run CMakeSetup, specify an out-of-source build
2. cd build
3. mingw32-make
4. mingw32-make install

What OS and toolchain are you using?

Cheers,
Brandon Van Every
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake