Re: [CMake] BUILD_COMMAND having a hard time getting usable command lines

2011-11-27 Thread Michael Hertling
On 11/26/2011 07:14 PM, J Decker wrote:
 Earlier I wondered if there was a way to stop recusive invocation of a
 build command in a cmake script - I found something like a solution;
 when I run the command, set an environment variable and don't run the
 command if that environment variable is set... But...
 
 If I specify 'TARGET' in BUILD_COMMAND, then it gets extra quotes
 around it, which make it impossible to pass to execute_process.  Also
 why doesn't cmake-gui run certain commands?
 
 --example - probably incomplete ---
 
 PROJECT( whatever )
   build_command( GENERATOR_BUILD_COMMAND CONFIGURATION
 ${CMAKE_BUILD_TYPE} PROJECT_NAME ${PROJECT_NAME} TARGET all )
   message( build command:${GENERATOR_BUILD_COMMAND} )
 
 - output  ---
 
 build command:e:/tools/unix/mingw/bin/mingw32-make.exe -i all
 mingw32-make.exe: *** No rule to make target `all'.  Stop.

What happens if you omit the TARGET clause in BUILD_COMMAND()?
Target all should be the default when nothing is specified.

 ---end output, begin explanation
 
 In order to get BUILD_COMMAND output to work at all I have to
 
 STRING( REPLACE \  ; GENERATOR_BUILD_COMMAND
 ${GENERATOR_BUILD_COMMAND} )

AFAIK, that's exactly the job of SEPARATE_ARGUMENTS().

 which replaces the spaces in the command with semicolons, so it looks
 like seperate commands for
 
   EXECUTE_PROCESS(COMMAND ${GENERATOR_BUILD_COMMAND}
 WORKING_DIRECTORY ${CMAKE_BINARY_DIR} )
 
  and in cmake-gui the output looks something like
 
 ---
 build command:e:/tools/unix/mingw/bin/mingw32-make.exe -i all
 Executing command... (output just before Execute_process)
 Configuring done
 ---
   but the command is never actually executed?  I go out to a command
 line and type cmake . and the build goes.

I can confirm this, but if I understand correctly, you are trying
to build the project while it still undergoes its configuration, in
particular before the generation step has finished. If so, wouldn't
you expect quite strange behaviors? Could you provide a small and
self-contained example which demonstrates what you intend to do?

Regards,

Michael
--

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] parallel build using cmake --build?

2011-11-27 Thread Steve M. Robbins
On Sat, Nov 26, 2011 at 10:46:10AM -0500, John Drescher wrote:
 On Fri, Nov 25, 2011 at 10:16 PM, Steve M. Robbins st...@sumost.ca wrote:
  Hi,
 
  To build VTK on our windows build server, I wrote a small batch script
  that invokes cmake --build.
 
  My developer machine is multicore; is there a way to get cmake --build
  to run multiple jobs?
 
 
 On windows, I use the following tool
 
 http://www.codeproject.com/KB/cpp/runjobs.aspx
 
 to build each configuration (Debug, Release, RelWithDebInfo ...) in
 parallel using separate calls to cmake --build.

Thanks -- that's great tip.

In my present case, however, I'm building just the Release
configuration and was hoping to parallelize that with the equivalent
of make -jN.


To Michael Hertling's comment:

 cmake --build is just a front-end for the native build tool CMake
 generates input for. If this tool can be invoked via the command
 line with options for parallel building, you can provide them after
 the -- in the cmake --build command, e.g. cmake --build
 bindir -- -j 4 for parallel building with Makefiles.

I would do this if I were using makefiles.  In the present case, I'm
using Microsoft VS2010.  I was kind of hoping that cmake had
abstracted the parallelism so that I could stay ignorant of the Visual
Studio command line details and possibly in future write build scripts
that are cross-platform.

Thanks,
-Steve


signature.asc
Description: Digital signature
--

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] parallel build using cmake --build?

2011-11-27 Thread Michael Hertling
On 11/27/2011 05:21 PM, Steve M. Robbins wrote:
 On Sat, Nov 26, 2011 at 10:46:10AM -0500, John Drescher wrote:
 On Fri, Nov 25, 2011 at 10:16 PM, Steve M. Robbins st...@sumost.ca wrote:
 Hi,

 To build VTK on our windows build server, I wrote a small batch script
 that invokes cmake --build.

 My developer machine is multicore; is there a way to get cmake --build
 to run multiple jobs?


 On windows, I use the following tool

 http://www.codeproject.com/KB/cpp/runjobs.aspx

 to build each configuration (Debug, Release, RelWithDebInfo ...) in
 parallel using separate calls to cmake --build.
 
 Thanks -- that's great tip.
 
 In my present case, however, I'm building just the Release
 configuration and was hoping to parallelize that with the equivalent
 of make -jN.

IIRC, cmake --build once invoked MSBuild in a VS environment, and
MSBuild has the /maxcpucount option, see [1]. Have you already tried
to achieve something similar with the VS2010 devenv-based mechanism?

 To Michael Hertling's comment:
 
 cmake --build is just a front-end for the native build tool CMake
 generates input for. If this tool can be invoked via the command
 line with options for parallel building, you can provide them after
 the -- in the cmake --build command, e.g. cmake --build
 bindir -- -j 4 for parallel building with Makefiles.
 
 I would do this if I were using makefiles.  In the present case, I'm
 using Microsoft VS2010.  I was kind of hoping that cmake had
 abstracted the parallelism so that I could stay ignorant of the Visual
 Studio command line details and possibly in future write build scripts
 that are cross-platform.

Are configured build scripts an option? As a project knows for which
build tool it is configured, it should be able to generate a build-
tool-independent build script for itself.

Regards,

Michael

[1] http://msdn.microsoft.com/en-us/library/ms164311.aspx
--

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-commits] CMake branch, master, updated. v2.8.6-277-g10c3113

2011-11-27 Thread KWSys Robot
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project CMake.

The branch, master has been updated
   via  10c3113464eb66739550f18dd06f8b2f75affe99 (commit)
  from  66f44dcdf4ba725735d6e2023b79bbed4033c728 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=10c3113464eb66739550f18dd06f8b2f75affe99
commit 10c3113464eb66739550f18dd06f8b2f75affe99
Author: KWSys Robot kwro...@kitware.com
AuthorDate: Sun Nov 27 00:05:05 2011 -0500
Commit: KWSys Robot kwro...@kitware.com
CommitDate: Sun Nov 27 00:05:05 2011 -0500

KWSys Nightly Date Stamp

diff --git a/Source/kwsys/kwsysDateStamp.cmake 
b/Source/kwsys/kwsysDateStamp.cmake
index 6ee8947..58aca97 100644
--- a/Source/kwsys/kwsysDateStamp.cmake
+++ b/Source/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR  2011)
 SET(KWSYS_DATE_STAMP_MONTH 11)
 
 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   26)
+SET(KWSYS_DATE_STAMP_DAY   27)

---

Summary of changes:
 Source/kwsys/kwsysDateStamp.cmake |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
CMake
___
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits


[Cmake-commits] CMake branch, next, updated. v2.8.6-2050-g3bb3ae8

2011-11-27 Thread Stephen Kelly
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project CMake.

The branch, next has been updated
   via  3bb3ae85f5a565827916aea82b8b0a04a7351e6a (commit)
   via  585b06314ec85e5ada78951ef5be696163f07494 (commit)
   via  5c64568dc6c9e9e72916675ceca67cc965a6a647 (commit)
   via  550f341c3dbebdfb5ad8fd6953dc80e8e41d0d7f (commit)
   via  9a82600c9522504872daae091011fcef8c06a993 (commit)
   via  d465fb99cdaeedda8eed5893071df3260bc451f0 (commit)
   via  66f44dcdf4ba725735d6e2023b79bbed4033c728 (commit)
   via  d63af6df7cceaa2c727490001b1ab0382b6c899c (commit)
   via  27e6ea9d2a28bf53fe284b08bfd441b57af64f7a (commit)
  from  a3860c3931afde8695a962b7c9eb89bbd0827a25 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3bb3ae85f5a565827916aea82b8b0a04a7351e6a
commit 3bb3ae85f5a565827916aea82b8b0a04a7351e6a
Merge: a3860c3 585b063
Author: Stephen Kelly steve...@gmail.com
AuthorDate: Sun Nov 27 18:19:43 2011 -0500
Commit: CMake Topic Stage kwro...@kitware.com
CommitDate: Sun Nov 27 18:19:43 2011 -0500

Merge topic 'target-include-directories' into next

585b063 Hack to workaround caching of flags per directory.
5c64568 Extract and use the INCLUDE_DIRECTORIES target properties.
550f341 Exit the loop when we have determined the language.
9a82600 Fix typos arguement - argument.
d465fb9 Trim trailing whitespace.
66f44dc KWSys Nightly Date Stamp
d63af6d KWSys Nightly Date Stamp
27e6ea9 KWSys Nightly Date Stamp


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=585b06314ec85e5ada78951ef5be696163f07494
commit 585b06314ec85e5ada78951ef5be696163f07494
Author: Stephen Kelly steve...@gmail.com
AuthorDate: Mon Nov 7 11:49:33 2011 +0100
Commit: Stephen Kelly steve...@gmail.com
CommitDate: Mon Nov 28 00:09:54 2011 +0100

Hack to workaround caching of flags per directory.

This needs a better solution.

diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index b697f2b..5f7f948 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1207,7 +1207,9 @@ const char* cmLocalGenerator::GetIncludeFlags(const 
std::vectorstd::string in
   key += forResponseFile? @ : ;
   if(this-LanguageToIncludeFlags.count(key))
 {
-return this-LanguageToIncludeFlags[key].c_str();
+  // Introduced to cmLocalUnixMakefileGenerator in 
692ba48c4e5762b370f2999e902b8bd677c77161
+  // It seems to just be memoization. Can it be removed?
+// return this-LanguageToIncludeFlags[key].c_str();
 }
 
   cmOStringStream includeFlags;

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5c64568dc6c9e9e72916675ceca67cc965a6a647
commit 5c64568dc6c9e9e72916675ceca67cc965a6a647
Author: Stephen Kelly steve...@gmail.com
AuthorDate: Sat Nov 5 16:17:49 2011 +0100
Commit: Stephen Kelly steve...@gmail.com
CommitDate: Mon Nov 28 00:09:54 2011 +0100

Extract and use the INCLUDE_DIRECTORIES target properties.

diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index ffbeb48..b697f2b 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -574,7 +574,11 @@ void 
cmLocalGenerator::AddCustomCommandToCreateObject(const char* ofname,
   std::string flags;
   flags += this-Makefile-GetSafeDefinition(varString.c_str());
   flags +=  ;
-  flags += this-GetIncludeFlags(lang);
+{
+std::vectorstd::string includes;
+this-GetIncludeDirectories(includes, lang);
+flags += this-GetIncludeFlags(includes, lang);
+}
   flags += this-Makefile-GetDefineFlags();
 
   // Construct the command lines.
@@ -1192,8 +1196,8 @@ cmLocalGenerator::ConvertToIncludeReference(std::string 
const path)
 }
 
 //
-const char* cmLocalGenerator::GetIncludeFlags(const char* lang,
-  bool forResponseFile)
+const char* cmLocalGenerator::GetIncludeFlags(const std::vectorstd::string 
includes,
+  const char* lang, bool 
forResponseFile)
 {
   if(!lang)
 {
@@ -1207,9 +1211,6 @@ const char* cmLocalGenerator::GetIncludeFlags(const char* 
lang,
 }
 
   cmOStringStream includeFlags;
-  std::vectorstd::string includes;
-  this-GetIncludeDirectories(includes, lang);
-  std::vectorstd::string::iterator i;
 
   std::string flagVar = CMAKE_INCLUDE_FLAG_;
   flagVar += lang;
@@ -1251,6 +1252,7 @@ const char* cmLocalGenerator::GetIncludeFlags(const char* 
lang,
 #ifdef __APPLE__
   emitted.insert(/System/Library/Frameworks);
 #endif
+  std::vectorstd::string::const_iterator i;
   for(i =