Re: [CMake] macosx fix bundle problems

2009-09-19 Thread Petr Vaněk
Dne čtvrtek 10 Září 2009 16:58:40 Clinton Stimpson napsal(a):
> Plugins should have a directory structure and the libraries end with
>  .dylib. So something like

that .bundle extension is standard in the Macports version of Qt.

> plugins/accessible/libqtaccessiblecompatwidgets.dylib
> plugins/accessible/libqtaccessiblewidgets.dylib
> plugins/codecs/libqcncodecs.dylib
> plugins/codecs/libqjpcodecs.dylib
> plugins/codecs/libqkrcodecs.dylib
> plugins/codecs/libqtwcodecs.dylib

yes, I know. But bundleutilities can find all plugs I need but it doesn't make 
required dir structure. I'm orkarounding it with custom copy scripts.

petr
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] Linking fails on small program

2009-09-19 Thread alexandre

Alain Leblanc a écrit :

cmake_minimum_required (VERSION 2.6)
project (Zou)
add_library(Matrix matrix.cpp)
add_library(Pose pose.cpp)
add_executable (Zou main.cpp)
link_libraries(Zou Pose Matrix)



Do you mean target_link_libraries() here? I don't see anything about
link_libraries()  in the cmake documentation.


That solved my problem. Thank you !
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] Linking fails on small program

2009-09-19 Thread alexandre

Hello,

I have split a small test program into three files (plus header files). 
The CMakeLists.txt is the following :


cmake_minimum_required (VERSION 2.6)
project (Zou)
add_library(Matrix matrix.cpp)
add_library(Pose pose.cpp)
add_executable (Zou main.cpp)
link_libraries(Zou Pose Matrix)

When running (cmake and then) make, I get the following error :

[...]
Linking CXX executable Zou
CMakeFiles/Zou.dir/main.cpp.o: In function `main':
main.cpp:(.text+0xb7): undefined reference to `Triangle::Triangle()'
[...]

Though, Triangle::Triangle() is adequately coded in pose.cpp. What does 
go wrong ?


Thank you,
Alexandre
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] Using boost with cmake?

2009-09-19 Thread motes motes
I have just installed boost for windows:

http://www.boostpro.com/download

Now I would like to use the boost unit-testing framework in my
application that I build with cmake. Any  but how do I add the boost
unit testing framework to my current CMakeLists.txt file?
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] additional target support

2009-09-19 Thread Alexander Neundorf
On Saturday 19 September 2009, Darren ha wrote:
> Hi list!
>
> I was wondering how to implement the following requirements in
> CMakeLists.txt.
> - I want to add 2 additional target to each target.
>   - target.only ; only build target without any dependency check

Did you try "target/fast"  ?

>   - target.clean ; only clean target. not cleaning dependent targets

Isn't the cleaning done only on directory basis ?
So I think currently the only way to do what you want is to structure your 
directories accordingly.

Alex
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Build cmake as a static executable

2009-09-19 Thread Alexander Neundorf
On Saturday 19 September 2009, Xiangyun Kong wrote:
> I need to deploy cmake in an environment in which the old
> shared libraries need to be used, so I would like to build cmake
> as a statically executable without linked any shared libraries.
> Do anyone try to build cmake that way ? Thanks for sharing
> any experience.

On Linux or anyother OS ?
Did you try to run the binary packages available from Kitware directly ?
They should work everywhere.
If not, how do they fail ?

Alex
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] additional target support

2009-09-19 Thread Darren ha
Hi list!

I was wondering how to implement the following requirements in
CMakeLists.txt.
- I want to add 2 additional target to each target.
  - target.only ; only build target without any dependency check
  - target.clean ; only clean target. not cleaning dependent targets

the default 'make clean' command clean all target. this is not what i want
to.

Is there any idea simply implementing upper requirements.?
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] [PATCH] CPack fails because of a sharing violation

2009-09-19 Thread Claudio Bley
Bill Hoffman 
writes:

> Claudio Bley wrote:
>> Hi.
>>
>> Trying to build & install Boost I ran into the following error when
>> CPack was called:
>>
>> ,
>> | CPack: -   Install component: fusion_headers
>> | CMake Error at libs/fusion/cmake_install.cmake:31 (FILE):
>> |   file Problem setting modification time on file
>> |   
>> "C:/build/vc90nmake/boost_1_40_0/_CPack_Packages/win32/NSIS/Boost-1.40.0-vc9/fusion_headers/include/boost-1_40/boost/fusion/include/iterator_facade.hpp"
>> | Call Stack (most recent call first):
>> |   libs/cmake_install.cmake:48 (INCLUDE)
>> |   cmake_install.cmake:37 (INCLUDE)
>> | | CPack Error: Error when generating package: Boost
>> | NMAKE : fatal error U1077: ""C:\Programme\CMake 2.6\bin\cpack.exe"": 
>> Return-Code "0x1"
>> | Stop.
>> `
>>
>> I debugged cpack.exe and realized that the error occured in
>> Source/cmSystemTools.cxx:CopyFileTime() when trying to open the target
>> file.
>>
>> GetLastError() returned ERROR_SHARING_VIOLATION. 
>>
>> According to
>> http://support.microsoft.com/?scid=kb%3Ben-us%3B316609&x=17&y=20 one
>> should retry attempting to open the file until successfull.
>>
>> I implemented this approach (see the following patch) and succeeded in
>> building an installer package for Boost.
>>
>> Of course, there a some other places where CreateFile is called and this
>> problem might happen there also. It might be a good idea to generalize
>> this into an utility function.
>>
>> Btw, do you realize that the cmSystemToolsWindowsHandle class is broken
>> according to its copy/assignment semantics?
>>
>>
>> Index: Source/cmSystemTools.cxx
>> ===
>> RCS file: /cvsroot/CMake/CMake/Source/cmSystemTools.cxx,v
>> retrieving revision 1.401
>> diff -u -r1.401 cmSystemTools.cxx
>> --- Source/cmSystemTools.cxx 11 Sep 2009 12:18:13 -  1.401
>> +++ Source/cmSystemTools.cxx 18 Sep 2009 14:43:23 -
>> @@ -2134,11 +2134,26 @@
>>  bool cmSystemTools::CopyFileTime(const char* fromFile, const char* toFile)
>>  {
>>  #if defined(_WIN32) && !defined(__CYGWIN__)
>> +  const DWORD retryDelay_millisecs = 250;
>> +  const int maxRetries = 15;
>> +  int retries = 0;
>> +
>>cmSystemToolsWindowsHandle hFrom =
>>  CreateFile(fromFile, GENERIC_READ, FILE_SHARE_READ, 0,
>> OPEN_EXISTING, 0, 0);
>> -  cmSystemToolsWindowsHandle hTo =
>> -CreateFile(toFile, GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0);
>> +
>> +  HANDLE hTry;
>> +
>> +  while ((hTry = CreateFile(toFile, GENERIC_WRITE, +
>> FILE_SHARE_WRITE, 0, OPEN_EXISTING, 0, 0)) == INVALID_HANDLE_VALUE
>> + && GetLastError() == ERROR_SHARING_VIOLATION
>> + && ++retries <= maxRetries) +{
>> +Sleep(retryDelay_millisecs);
>> +}
>> +
>> +  cmSystemToolsWindowsHandle hTo(hTry);
>> +
>>if(!hFrom || !hTo)
>>  {
>>  return false;
>>
>>
>
> Why is it trying to copy a file that is being used?
>
> Seems like there is some other issue here, and this just gets around a
> different bug...

At first, it is trying to copy the file time from one file to another,
and the _target_ file is locked by another process.

On a multi-processing operating system you can't control what other
processes are doing, and of course, some other process (or the user
herself) might actually open the file during the
file-time-copy-process.

In my case it is the anti-virus software blocking access to the file
until it has determined whether the file is malicious or not. That
leads to a race-condition and the file is usually unlocked before
CPack tries to open it to change the timestamps, but at some point in
the packaging process it always failed because the AV software had not
completed examining the file.

I would think that this is a perfectly valid usage scenario one would
have to cope with in the code.

Cheers,
Claudio

___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] newcomer question about dependencies

2009-09-19 Thread Anatoly Shirokov
I have analized approach used by Visual Studio 7 generator and reproduce 
it in the Visual Studio 6 generator. I would be appreciate for reviewing 
my patches (see attachment).  May be I've lost some important details.

Thanks in advance for any comments.
BR,
Anatoly Shirokov.


ÿþ21a22,48

> 
//--------------------------------------------------------------------------

> bool

> 
cmGlobalVisualStudio6Generator::TargetCompare

> ::operator()(cmTarget const* l, 
cmTarget const* r)

> {

>  // Make sure ALL_BUILD is first so 
it is the default active project.

>  if(strcmp(r->GetName(), "ALL_BUILD") 
== 0)

>  {

>   return false;

>  }

>  if(strcmp(l->GetName(), "ALL_BUILD") 
== 0)

>  {

>   return true;

>  }

>  return strcmp(l->GetName(), 
r->GetName()) < 0;

> }

> 

> 
//--------------------------------------------------------------------------

> 
cmGlobalVisualStudio6Generator::OrderedTargetDependSet

> 
::OrderedTargetDependSet(cmGlobalGenerator::TargetDependSet
 const& targets)

> {

>  
for(cmGlobalGenerator::TargetDependSet::const_iterator
 ti =

>   targets.begin(); ti != 
targets.end(); ++ti)

>  {

>   this->insert(*ti);

>  }

> }

172,175c199,202

< // Write a DSW file to the stream

< void cmGlobalVisualStudio6Generator

< ::WriteDSWFile(std::ostream& 
fout,cmLocalGenerator* root,

<                
std::vector<cmLocalGenerator*>& 
generators)

---

> void 
cmGlobalVisualStudio6Generator::AddAllBuildDepends(

>  cmLocalGenerator* root,

>  cmTarget* target,

>  cmGlobalGenerator::TargetDependSet& 
originalTargets)

177,219d203

<   // Write out the header for a DSW 
file

<   this->WriteDSWHeader(fout);

<   

<   // Get the home directory with the 
trailing slash

<   std::string homedir = 
root->GetMakefile()->GetStartOutputDirectory();

<   homedir += "/";

<     

<   unsigned int i;

<   bool doneAllBuild = false;

<   bool doneRunTests = false;

<   bool doneInstall = false;

<   bool doneEditCache = false;

<   bool doneRebuildCache = false;

<   bool donePackage = false;

< 

<   for(i = 0; i < generators.size(); 
++i)

<     {

<     if(this->IsExcluded(root, 
generators[i]))

<       {

<       continue;

<       }

<     cmMakefile* mf = 
generators[i]->GetMakefile();

<     

<     // Get the source directory from 
the makefile

<     std::string dir = 
mf->GetStartOutputDirectory();

<     // remove the home directory and 
/ from the source directory

<     // this gives a relative path 

<     cmSystemTools::ReplaceString(dir, 
homedir.c_str(), "");

< 

<     // Get the list of create dsp 
files names from the LocalGenerator, 
more

<     // than one dsp could have been 
create