Re: [CMake] Bug fix requests for the *next* release of CMake...

2011-10-28 Thread Claudio Bley
Hi.

This one, please: http://public.kitware.com/Bug/view.php?id=12273
(*very* easy ;))

And this one too: http://public.kitware.com/Bug/view.php?id=11773

Thanks,
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] Why are blank-delimited strings in commands escaped on Linux?

2009-10-02 Thread Claudio Bley

Hi. 

Alan W. Irwin
ir...@beluga.phys.uvic.ca writes:

 On 2009-10-02 08:58+0200 Hendrik Sattler wrote:

 Zitat von Alan W. Irwin ir...@beluga.phys.uvic.ca:
 [Use]
 string(REGEX REPLACE   ; CAIRO_LINK_FLAGS_LIST ${CAIRO_LINK_FLAGS})
 [to convert a blank-delimited string to a list].

 Doing this REGEX REPLACE cannot be the recommended way as that
 breaks any paths that contain spaces. Doesn't
 set(CAIRO_LINK_FLAGS_LIST ${CAIRO_LINK_FLAGS})
 also make this a list but honors a possible quoting and escaping?
 (Note: no extra quoting in the above line).

 Hi Hendrik:

 I can never figure out such things 100 per cent from documentation.  Instead
 I try a simple test such as

 set(a hello world\\ hello world)
 message(STATUS a = ${a})
 set(a_list ${a})
 message(STATUS a_list = ${a_list})

 The result is

 -- a = hello world\ hello world
 -- a_list = hello world\ hello world

So, the real issue here is that your CAIRO_LINK_FLAGS variable just
contains a single string, where it should contain a list instead.

You should fix that in your OCaml /PLplot module.

Regards,
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] Why are blank-delimited strings in commands escaped on Linux?

2009-10-02 Thread Claudio Bley
Hendrik Sattler p...@hendrik-sattler.de
writes:

 Zitat von Claudio Bley b_l_...@ml1.net:
 set(a hello world\\ hello world)
 message(STATUS a = ${a})
 set(a_list ${a})
 message(STATUS a_list = ${a_list})

 The result is

 -- a = hello world\ hello world
 -- a_list = hello world\ hello world

 So, the real issue here is that your CAIRO_LINK_FLAGS variable just
 contains a single string, where it should contain a list instead.

 You should fix that in your OCaml /PLplot module.

 He gets that from external tools. They ususally do not provide cmake
 lists.

Ok. Then, he should use separate_arguments:

,
| separate_arguments(CAIRO_LINK_FLAGS)
`

 But I think that his example is wrong, it should be:
 set(a -Lfoo -lbar)
 message(STATUS a = ${a})
 set(a_list ${a})
 message(STATUS a_list = ${a_list})

 Then the result should be
  -- a = -Lfoo -lbar
  -- a_list = -Lfoo;-lbar

No, should it not. How should that be possible? ${a} is not a list, it's
a string (ie. it does not contain semi colons).

The output is:

,
| -- a = -Lfoo -lbar
| -- a_list = -Lfoo -lbar
`

Regards,
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] Why are blank-delimited strings in commands escaped on Linux?

2009-10-02 Thread Claudio Bley
Hendrik Sattler p...@hendrik-sattler.de
writes:

 Zitat von Claudio Bley b_l_...@ml1.net:
 But I think that his example is wrong, it should be:
 set(a -Lfoo -lbar)
 message(STATUS a = ${a})
 set(a_list ${a})
 message(STATUS a_list = ${a_list})

 Then the result should be
  -- a = -Lfoo -lbar
  -- a_list = -Lfoo;-lbar

 No, should it not. How should that be possible? ${a} is not a list, it's
 a string (ie. it does not contain semi colons).

 The output is:

 ,
 | -- a = -Lfoo -lbar
 | -- a_list = -Lfoo -lbar
 `

 Then explain the detailed difference between the following three:
   set(a_list -Lfoo -lbar) - creates a list with -Lfoo and -lbar

Correct, you could've used

,
| set(a_list -Lfoo;-lbar)
`

which is the same.

   set(a_list ${a}) - ???

This looks like a single argument to the set macro. But, ${a} is
exploded (I don't know how to better call it) - ie. if ${a} (ie. the
value of the variable a) is a list with a length greater than 1, the
macro is given several arguments, instead of one or none.

   set(a_list ${a}) - ???

Double quoting prevents exploding the value of ${a} into multiple
arguments - hence, the macro is given a single argument: a string.

To illustrate:

,[ test.cmake ]
| function(first arg)
|   message(${arg})
| endfunction(first)
| 
| set(a_list a b c)
| 
| first(${a_list})
| first(${a_list})
`

,[ cmake -P test.cmake ]
| a
| a;b;c
`

At the end, set(var z) will never set var to a list, if z itself
is no list - no matter whether z was quoted or not.

Regards,
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] [PATCH] CPack fails because of a sharing violation

2009-09-19 Thread Claudio Bley
Bill Hoffman bill.hoff...@kitware.com
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%3B316609x=17y=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


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

2009-09-18 Thread Claudio Bley
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%3B316609x=17y=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.cxx11 Sep 2009 12:18:13 -  1.401
+++ Source/cmSystemTools.cxx18 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;


Regards,
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


[CMake] [PATCH] building Boost.Python fails

2009-09-16 Thread Claudio Bley
Hi.

With Boost 1.40.0 and using CMake 2.6.4 building the Python library
failed because the compiler could not find some header of the parameter
library. (sorry, don't have the compiler message at hand).

This happend after I ran make modularize  make:

,
| [ 34%] Building CXX object 
libs/python/src/CMakeFiles/boost_python-mt-shared.dir/object/inheritance.cpp.obj
| inheritance.cpp
| 
C:\build\vc90nmake\boost_1_40_0\libs\graph\include\boost/graph/named_function_params.hpp(15)
| : fatal error C1083: Datei (Include) kann nicht geöffnet werden: 
boost/parameter/name.hpp: No such file or directory
| NMAKE : fatal error U1077: C:\PROGRA~1\MICROS~1.0\VC\bin\cl.exe: 
Rückgabe-Code
|  0x2
| Stop.
`

After specifying the parameter library as a dependency for Boost.Graph
it compiled without problems.

Regards,
Claudio

--- libs/graph/module.cmake.orig2009-06-08 17:45:46.740488000 +0200
+++ libs/graph/module.cmake 2009-09-16 14:44:52.65625 +0200
@@ -1,4 +1,5 @@
-boost_module(graph DEPENDS property_map tuple multi_index any random)
+boost_module(graph DEPENDS property_map tuple multi_index any random parameter)
 boost_module(graph_mpi DEPENDS mpi graph)
 
 # any is there because of the dependency on 
boost/property_map/dynamic_property_map.hpp
+# parameter is there because named_function_params.hpp includes 
parameter/name.hpp



___
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] building Boost.Python fails

2009-09-16 Thread Claudio Bley
Sorry, wrong list. Supposed to be posting this to boost-cmake... *shame*

-- 
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