Re: [CMake] How to run tests in parallel?

2011-06-15 Thread S Roderick
On Jun 15, 2011, at 07:55 , Dave Ohlsson wrote:

 Hi,
 
 I am new to CMake.
 
 I have a project with a few tests. The tests are independent from each
 other (run in separate directories, etc.).
 
 In my project's CMakeLists.txt, I have:
 
enable_testing()
add_test(NAME test1 COMMAND some command 1)
add_test(NAME test2 COMMAND some command 2)
add_test(NAME test3 COMMAND some command 3)
 
 I can run the tests with this command (from the build directory):
 
make test
 
 This command runs all the tests SERIALLY, and they all pass.
 
 Now, how could I run the tests IN PARALLEL?
 
 I tried this:
 
make -j4 test
 
 and that:
 
make -j 4 test
 
 but the tests are run serially also with these commands.
 
 Note that `make -j 4' builds the objects (.o files) in parallel
 without problems. I have this problem only with tests.
 
 I suppose I am missing something very obvious.
 
 I use Linux.

Undocumented feature (IIRC) ...

make -jN test   # build in parallel
make test ARGS=-jN  # run tests in parallel

for appropriate N
___
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] set CMAKE_INSTALL_PREFIX in CMakeLists

2010-12-02 Thread S Roderick
On Dec 2, 2010, at 04:35 , Michael Wild wrote:

 On 12/02/2010 10:18 AM, Marcel Loose wrote:
 On 30-11-2010 at 18:48, in message
 20101130174852.gc10...@cryptio.net, Tyler
 Roscoe ty...@cryptio.net wrote: 
 On Thu, Nov 25, 2010 at 02:01:31PM +0100, Marcel Loose wrote:
 On 24-11-2010 at 17:45, in message
 20101124164507.gg23...@cryptio.net, Tyler
 Roscoe ty...@cryptio.net wrote: 
 On Wed, Nov 24, 2010 at 12:11:56PM +0100, Micha Renner wrote:
 
  SET(CMAKE_INSTALL_PREFIX /foo/bar CACHE PATH Foo install
 prefix)
 
 So, without the test to
 CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT,
 and without the FORCE option.
 
 No, as I mentioned, there was an article of one the
 CMake-maintainers
 who recommended this.
 
 Micha is correct. CMAKE_INSTALL_PREFIX is set before your
 CMakeLists.txt
 is processed, so the above will never do anything.
 
 tyler
 
 Well, I tested this before I posted my reply. It does work the way
 I
 describe it. Try it yourself.
 
 It doesn't work for me:
 
 [tyle...@tpb006:~/cmake-test-install-prefix]$ cmake --version
 cmake version 2.8.3
 
 [tyle...@tpb006:~/cmake-test-install-prefix]$ cat CMakeLists.txt
 cmake_minimum_required(VERSION 2.8)
 project(p)
 
 set (CMAKE_INSTALL_PREFIX foo CACHE PATH docstring)
 message (CMAKE_INSTALL_PREFIX = ${CMAKE_INSTALL_PREFIX})
 
 [tyle...@tpb006:~/cmake-test-install-prefix]$ mkdir b  cd b 
 cmake ..
 -- The C compiler identification is GNU
 -- The CXX compiler identification is GNU
 -- Check for working C compiler: /usr/bin/gcc
 -- Check for working C compiler: /usr/bin/gcc -- works
 -- Detecting C compiler ABI info
 -- Detecting C compiler ABI info - done
 -- Check for working CXX compiler: /usr/bin/c++
 -- Check for working CXX compiler: /usr/bin/c++ -- works
 -- Detecting CXX compiler ABI info
 -- Detecting CXX compiler ABI info - done
 CMAKE_INSTALL_PREFIX = /usr/local
 -- Configuring done
 -- Generating done
 -- Build files have been written to:
 /tpb006/tylermr/cmake-test-install-prefix/b
 
 Hi Tyler,
 
 I now see why it works for me and not for you. Maybe I didn't write it
 clearly, but I do SET(CMAKE_INSTALL_PREFIX ...) *before* the call to
 PROJECT(). You are right that it doesn't work when you do it after the
 PROJECT() call. Unfortunately, the solution with the IF-test doesn't
 work when you use it before the PROJECT() call, for obvious reasons I
 would say.
 
 So, there are two solutions that work, but you have to choose carefully
 among them.
 
 1) Use this snippet *before* PROJECT(xxx):
  SET(CMAKE_INSTALL_PREFIX path CACHE PATH comment)
 
 2) Use this snippet *after* PROJECT(xxx):
  IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
SET(CMAKE_INSTALL_PREFIX path CACHE PATH comment FORCE)
  ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
 
 Best regards,
 Marcel Loose.
 
 Considering what David said, the first solution depends on the
 implementation details of the PROJECT command and is very fragile since
 it works accidentally for some versions of CMake. I don't consider it
 to be an option at all. I would suggest to always use the second option.

As long as one of these approaches works, I'm happy. Just choose one, and 
document it.
S

___
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] set CMAKE_INSTALL_PREFIX in CMakeLists

2010-11-30 Thread S Roderick
On Nov 30, 2010, at 13:40 , David Cole wrote:

 It probably works accidentally if you do the set before the project command.

That is what we do, and it definitely works for us. Set it _before_ the 
PROJECT() statement.

 
 Unfortunately, the project command has significant side effects.
 Setting a default (cached) value for CMAKE_INSTALL_PREFIX might be one
 of those...
 
 
 On Tuesday, November 30, 2010, Tyler Roscoe ty...@cryptio.net wrote:
 On Thu, Nov 25, 2010 at 02:01:31PM +0100, Marcel Loose wrote:
 On 24-11-2010 at 17:45, in message
 20101124164507.gg23...@cryptio.net, Tyler
 Roscoe ty...@cryptio.net wrote:
 On Wed, Nov 24, 2010 at 12:11:56PM +0100, Micha Renner wrote:
 
   SET(CMAKE_INSTALL_PREFIX /foo/bar CACHE PATH Foo install
 prefix)
 
 So, without the test to
 CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT,
 and without the FORCE option.
 
 No, as I mentioned, there was an article of one the
 CMake-maintainers
 who recommended this.
 
 Micha is correct. CMAKE_INSTALL_PREFIX is set before your
 CMakeLists.txt
 is processed, so the above will never do anything.
 
 tyler
 
 Well, I tested this before I posted my reply. It does work the way I
 describe it. Try it yourself.
 
 It doesn't work for me:
 
 [tyle...@tpb006:~/cmake-test-install-prefix]$ cmake --version
 cmake version 2.8.3
 
 [tyle...@tpb006:~/cmake-test-install-prefix]$ cat CMakeLists.txt
 cmake_minimum_required(VERSION 2.8)
 project(p)
 
 set (CMAKE_INSTALL_PREFIX foo CACHE PATH docstring)
 message (CMAKE_INSTALL_PREFIX = ${CMAKE_INSTALL_PREFIX})
 
 [tyle...@tpb006:~/cmake-test-install-prefix]$ mkdir b  cd b  cmake ..
 -- The C compiler identification is GNU
 -- The CXX compiler identification is GNU
 -- Check for working C compiler: /usr/bin/gcc
 -- Check for working C compiler: /usr/bin/gcc -- works
 -- Detecting C compiler ABI info
 -- Detecting C compiler ABI info - done
 -- Check for working CXX compiler: /usr/bin/c++
 -- Check for working CXX compiler: /usr/bin/c++ -- works
 -- Detecting CXX compiler ABI info
 -- Detecting CXX compiler ABI info - done
 CMAKE_INSTALL_PREFIX = /usr/local
 -- Configuring done
 -- Generating done
 -- Build files have been written to: 
 /tpb006/tylermr/cmake-test-install-prefix/b

___
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] cmake: could NOT find Boost

2010-05-04 Thread S Roderick
On May 4, 2010, at 12:41 , Mike Ladwig wrote:

 Hi.
 
 I'm having a problem compiling scantailor on CentOS 5.4.  The version of 
 cmake that comes with CentOS was too old, so I downloaded the current cmake 
 binary, which seems to be working well.
 
 The problem is that the CentOS version of boost is also out-of-date, so I 
 needed to download and build that, which I did successfully.  I installed the 
 new boost (1.42) in /usr/local and have been unable to get cmake to recognize 
 it.
 
 I have tried -DBOOST_ROOT=/usr/local/ -DBOOSTROOT=/usr/local/ 
 -DBOOST_INCLUDEDIR=/usr/local/include/ -DBOOST_LIBRARYDIR=/usr/local/lib/ 
 -DBoost_ADDITIONALVERSIONS=1.42.0 and many variations on these.
 
 Am I missing something, or is cmake just unable to find boost anywhere other 
 than default locations?


Have you tried (in a clean build tree)

export CMAKE_PREFIX_PATH=/usr/local
cmake ...

The above works with MacPorts installed boost v1.42 in /opt/local for Mac OS X.
Stephen
___
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] Apply FIND_PACKAGE_HANDLE_STANDARD_ARGS() on COMPONENTS

2010-04-22 Thread S Roderick
On Apr 22, 2010, at 06:21 , Michael Hertling wrote:

 On 04/21/2010 09:29 PM, S Roderick wrote:
 On Apr 21, 2010, at 15:13 , Alexander Neundorf wrote:
 
 On Tuesday 20 April 2010, Michael Hertling wrote:
 Dear CMake community, dear CMake developers,
 
 ...
 There's another aspect related to this I'd like to comment on: During
 the abovementioned considerations on the bug tracker and the mailing
 list, the question has arisen if it's reasonable to set XXX_FOUND to
 FALSE if any of the requested components aren't found. As for myself,
 I'd say: No, it isn't. Let's have a look at the following scenario:
 
 Package XXX normally provides components YY1 and YY2, but for some
 reason, only YY1 is installed. Moreover, XXX provides a config file
 XXXConfig.cmake. Now, a project's CMake script requests both YY1/2 by
 FIND_PACKAGE(XXX COMPONENTS YY1 YY2). As Brad King has pointed out in
 http://www.mail-archive.com/cmake@cmake.org/msg15952.html, finding a
 config file results in XXX_FOUND to be set to TRUE automatically. Thus,
 the absence of YY2 does not mean the absence of XXX as a whole in any
 case, and, notwithstanding, the requesting CMake script should have a
 chance to proceed even if YY2 isn't available, i.e. the following seems
 reasonable: XXX_YY1_FOUND=TRUE, XXX_YY2_FOUND=FALSE *but* XXX_FOUND=TRUE.
 
 I think I don't agree here.
 If I say
 find_package(XXX COMPONENTS YY1 YY2 REQUIRED)
 I think it makes a lot of sense to interpret this as search package XXX, 
 and 
 I need YY1 and YY2 from it.
 What other reason would I have to give YY1 and YY2 there otherwise ?
 If it still succeeds if they are not found, why should I list them then ?
 
 
 +1
 
 find_package(XXX COMPONENTS YY1 YY2 REQUIRED)
 
 means to me, I _require_ both YY1 and YY2 from XXX. Any other YYx I don't 
 care about.
 
 Yes, of course, the REQUIRED option is definitive; it's
 COMPONENTS without REQUIRED which raises the questions.
 
 The first version above translates to me to be
 
 find_package(XXX COMPONENTS YY1 REQUIRED)
 
 I only _require_ YY1.
 
 As I have replied recently to AN, I sometimes dislike FIND_PACKAGE() to
 look for unrequested components, so I need to request them even if they
 are optional, but this is just my personal preference and, also, not my
 concern here.
 
 My concern is that FIND_PACKAGE(XXX COMPONENTS YY) will always return
 XXX_FOUND=TRUE if it's driven by XXXConfig.cmake, regardless if YY is
 found or not, while the same command could return XXX_FOUND=FALSE if
 driven by FindXXX.cmake since the latter has XXX_FOUND in its hands.
 Thus, IMHO, it should be reconsidered how XXX_FOUND is interpreted
 w.r.t. components because I would expect both variants - XXXConfig
 and FindXXX - to behave the same.

That seems to make sense. YY isn't listed as required, therefore it is 
optional. Having XXX_FOUND=TRUE seems reasonable if CMake found some portion of 
XXX, regardless of whether it did, or did not, find YY. If we required YY, then 
we should have added REQUIRED.

Now the fact that COMPONENTS and REQUIRED are mutually exclusive is not right 
IMHO. I'd love to hear Kitware's take on why it was done this way.
Stephen
___
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] Problem after upgrading to OSX 10.6.3!

2010-03-31 Thread S Roderick
On Mar 31, 2010, at 14:03 , Bradley Lowekamp wrote:

 Hello,
 
 The down arrow (and other arrow keys) is no longer working after I patched to 
 OSX 10.6.3 with ccmake. This is very weird! Other applications seems fine.
 
 I have tried 3 upgraded machines, all failing to get curser to move with the 
 down arrow to move to the next variable (2.8 local build, ~2.9.20100222 local 
 build, 2.8 released binary). I tried 2 that were 10.6.2 and then worked fine 
 (2.8 local build)! 
 
 I then tried using Terminal on 10.6.3, but sshing into a 10.6.2. This time 
 the down arrow worked!
 
 Also we just built 2.8.1 release, and the same thing is occurring...
 
 Brad

+1 here with 10.6.3, but not 10.6.2

cmake = 2.8.0 from MacPorts

Stephen
___
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] simple ctest

2009-11-04 Thread S Roderick

On Nov 4, 2009, at 11:43 AM, Mathieu Malaterre wrote:


On Wed, Nov 4, 2009 at 4:52 PM,  th@gmx.de wrote:
I changed over to learn the windows batch a bit and I created a  
short script to do the work, for some things I planed to integrate  
into ctest.


The rest works like a charm (configuring, building, reporting,  
packaging etc)


I am not sure about the status of ctest scripting - is it widely use?


I gave up one time and used shell script.
Now I am stuck with this shell script and being forced to install
cygwin just to be able to execute this shell script, while if I had
taken the time it could be writen using ctest and be portable. You'll
have the same problem when you'll start doing stuff on *nix platform
and your batch file will be duplicated in some kind of shell script.

2cts
--
Mathieu


Ditto here. Take the time to use CTest scripts ...

My 2c.
Stephen

___
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] CTest/CDash and git

2009-10-23 Thread S Roderick

On Oct 23, 2009, at 08:21 , Brad King wrote:


Andrew Maclean wrote:

I guess the subject says it all. What is the status of using CMake,
Ctest and CDash with git?


CMake 2.8 comes with a CTest that can drive dashboards using git-based
work trees (plus hg and bzr).  The ctest_update() command runs git  
pull
to update the work tree, and reports file-wise changes.  It doesn't  
support
the nightly start time since that doesn't make sense for DVCS.   
Nightly

builds currently just pull the latest version.


Sounds fantastic! Thanks for all the great work, Brad  co.
Stephen
___
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] CMake with Qt (plus pkg-config)

2009-10-22 Thread S Roderick

On Oct 22, 2009, at 06:15 , Murray Cumming wrote:


I'm trying to use CMake for the first time, as an experiment, with
little a Qt-based project. It also uses an additional library, via
pkg-config.

So far Qt's include files don't seem to be found, and I wonder how I  
can

cause moc to be used to generate some of the .cc files.

Here's what I have so far:
http://github.com/murraycu/qlom/blob/qlom_cmake/CMakeLists.txt
based on the many and varied google results.

Can anyone give me some clues?


Try something like this

code
SET(SOURCES a.cpp b.cpp)

SET(UIS a.ui b.ui)

SET(MOC_HEADERS a.h b.h)

# generate sources from MOC headers
QT4_WRAP_CPP(MOC_SOURCES ${MOC_HEADERS})

# generate user-interface files
QT4_WRAP_UI(UIS_H ${UIS})

ADD_EXECUTABLE(gui ${SOURCES} ${MOC_SOURCES} ${UIS_H})
/code

HTH
Stephen
___
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 error after upgrading to snow leopard

2009-09-11 Thread S Roderick

On Sep 11, 2009, at 14:27 , Sean McBride wrote:


On 9/11/09 4:24 PM, Boudewijn Rempt said:

I'm getting weird linking errors after I upgraded to Snow Leopard.  
I'm using
the CVS version of cmake. If I have the MACOSX_BUNDLE flag in  
ADD_EXECUTABLE,

there are lots of weird visiblity errors like:
nking CXX executable HyvesDesktop.app/Contents/MacOS/HyvesDesktop
/usr/local/bin/cmake -E cmake_link_script CMakeFiles/ 
HyvesDesktop.dir/

link.txt --verbose=1
/usr/bin/c++-mmacosx-version-min=10.6 -Wall -arch i386 -fPIC -
fvisibility=hidden -fvisibility-inlines-hidden -Wl,- 
search_paths_first -

headerpad_max_install_names -fPIC CMakeFiles/HyvesDesktop.dir/
HyvesDesktop_automoc.cpp.o CMakeFiles/HyvesDesktop.dir/src/main.cpp.o
CMakeFiles/HyvesDesktop.dir/qrc_HyvesDesktop.cxx.o  -o  
HyvesDesktop.app/

Contents/MacOS/HyvesDesktop
Undefined symbols:
CrashHandler::CrashHandler::~CrashHandler(), referenced from:
_main in main.cpp.o
_main in main.cpp.o
QString::free(QString::Data*), referenced from:
QString::~QString()in main.cpp.o
Updater::Updater::instance(), referenced from:
_main in main.cpp.o


Are all those symbols from some library/framework you are linking
against?  Qt I assume?


Do you need to explicitly list the Qt libraries to link against, in  
the above link command line?

Stephen

___
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] macport issue?

2009-09-05 Thread S Roderick

On Sep 5, 2009, at 15:18 , Bill Hoffman wrote:


I found this with a google alert:

http://www.nabble.com/-MacPorts---21120:-Cmake-fails-to-sync--or-bootstrap--Not-sure-what-it-trying-to-say-sorry.-td25310279.html

Is there anyone on this list that is having this problem with CMake?


I recently built cmake 2.6.4 under MacPorts 1.8.0 in Snow Leopard and  
had no issue.


He's using a very old version of XCode and OS X Tiger though ... 2.2.1  
and 10.4.11 respectively.

Stephen

___
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