Re: [CMake] Multiple tests in a single file

2012-01-07 Thread David Cole
On Fri, Jan 6, 2012 at 6:47 PM, David Doria daviddo...@gmail.com wrote:
 On Fri, Jan 6, 2012 at 5:54 PM, Jean-Christophe Fillion-Robin
 jchris.filli...@kitware.com wrote:
 Hi David,

 Not too long ago I was browsing the project of a friend who worked on BTK
 (The toolkit used by Mokka, a motion kinematic  kinetic analyser) [1].

 I noticed that he is using cxxtest [2] along with ctest. It seems it could
 to address the use case you are describing.

 See Example integration [3] and cxxtest source [4]

 Hth
 Jc

 [1] https://b-tk.googlecode.com/svn/web/mokka/index.html
 [2] http://cxxtest.tigris.org/
 [3]
 https://code.google.com/p/b-tk/source/browse/BTK/trunk/Testing/Code/C3DFileReaderTest.h
 [4]
 https://code.google.com/p/b-tk/source/browse/#svn%2FBTK%2Ftrunk%2FUtilities%2FCxxTest%2Fcxxtest

 Thanks Jean-Christophe. So I guess the short answer is ctest can't do this.

 It seems they have made significant modifications to CxxTest so that
 the bin/cxxtestgen that ships with CxxTest is no longer required
 (they've replaced it with C macros). I like the BTK way better :)

 I guess I'm not sure what the advantage of using CTest along with
 something like CxxTest is. If you build an executable using CMake,
 then why not just run ./MyTests from the terminal instead of making an
 interface so that you can call 'ctest'. CTest will report a single
 pass or fail, because as far as it is concerned there is only one
 test, right? The relevant file is
 https://code.google.com/p/b-tk/source/browse/BTK/trunk/Testing/Code/CMakeLists.txt
 that only has one add_test call.

 Any thoughts?

 David
 --

 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

Sounds like you want to use GTest / GoogleTest, much like SimpleITK does.

See the macro ADD_GOOGLE_TESTS in the SimpleITK project, in the file
SimpleITK/Testing/Unit/CMakeLists.txt.

The macro parses the actual test cxx source files, and constructs
filtered add_test calls, such that:

- if a cxx file defines 5 tests, add_test is called 5 times, each test
run via add_test runs exactly one of your tests from the cxx file.

There are other projects that are also doing similar things with
gtest. The fairly new open chemistry project MolCore also uses gtest.
That project explicitly lists its tests in the CMakeLists file such
that you'd have to update the CMakeLists.txt file whenever you add a
test case to an existing cxx test source file.

You are correct: ctest does nothing to support this explicitly. (Aside
from cmake providing a FindGTest.cmake module...) An add_test call
tells ctest run this one test, with this one command line. It's up
to you to write those tests and tell us about them.

But there are fairly easy ways to do what you want, and still drive
the tests, individually, with ctest.


HTH,
David C.
--

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] How not to copy a link

2012-01-07 Thread David Cole
On Fri, Jan 6, 2012 at 10:54 PM, Michael Hertling mhertl...@online.de wrote:
 On 01/06/2012 07:51 PM, Kevin Burge wrote:
 Thanks David.  These are external libraries built outside of CMake,
 without CMake, not imported via any of the import capabilities of cmake,
 and that need to be installed alongside my CMake built files.  I think
 I'm just going to do the install with the rename.  Requires me to be
 more explicit, but, it's not like it changes all that frequently.

 Isn't it sufficient to copy such SONAME symlinks as they are, along with
 the actual library files, of course? Having a symlink from the SONAME to
 the library file is a basic mean of the ABI management on platforms with
 advanced - ;-) - support of shared libraries. Besides, these symlinks
 are automatically created by ldconfig when the latter processes the
 directory.

 Anyway, w.r.t. your initial question, I'd usually suggest to use the
 GET_FILENAME_COMPONENT(... REALPATH) command on the symlink prior
 to the INSTALL() command, but it seems to not work as expected:

 CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR)
 PROJECT(P NONE)
 SET(CMAKE_VERBOSE_MAKEFILE ON)
 EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E
    touch xyz.dat.0)
 EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E
    create_symlink xyz.dat.0 xyz.dat)
 GET_FILENAME_COMPONENT(XYZ xyz.dat REALPATH)
 MESSAGE(XYZ: ${XYZ})

 Due to the documentation of GET_FILENAME_COMPONENT(... REALPATH),

 ... the full path with *all* symlinks resolved (REALPATH).

 I'd expect to see

 XYZ: .../xyz.dat.0

 instead of

 XYZ: .../xyz.dat

 Do I misunderstand GET_FILENAME_COMPONENT() in respect thereof?

 Regards,

 Michael

 On 01/06/12 12:45, David Cole wrote:
 Have you considered setting the VERSION and SOVERSION target
 properties on your libraries instead of doing the symlinks yourself?
 CMake will build and install the symlinks automatically for you on
 platforms where they are supported if you set these target properties.

 http://www.cmake.org/cmake/help/cmake-2-8-docs.html#prop_tgt:SOVERSION
 http://www.cmake.org/cmake/help/cmake-2-8-docs.html#prop_tgt:VERSION

 (Or was that just an example, and you need to do this with other
 symlink files that are not simply the version symlinks for a
 library...?)


 HTH,
 David
 --

 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

It works if you use:

  GET_FILENAME_COMPONENT(XYZ ${CMAKE_CURRENT_BINARY_DIR}/xyz.dat REALPATH)

I'm not 100% sure if the behavior is expected to be defined for
non-full paths. Hopefully Brad sees this and chimes in. If not, I'll
try to remember to ask him about it on Monday.


HTH,
David
--

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] How not to copy a link

2012-01-07 Thread David Cole
On Sat, Jan 7, 2012 at 9:47 AM, David Cole david.c...@kitware.com wrote:
 On Fri, Jan 6, 2012 at 10:54 PM, Michael Hertling mhertl...@online.de wrote:
 On 01/06/2012 07:51 PM, Kevin Burge wrote:
 Thanks David.  These are external libraries built outside of CMake,
 without CMake, not imported via any of the import capabilities of cmake,
 and that need to be installed alongside my CMake built files.  I think
 I'm just going to do the install with the rename.  Requires me to be
 more explicit, but, it's not like it changes all that frequently.

 Isn't it sufficient to copy such SONAME symlinks as they are, along with
 the actual library files, of course? Having a symlink from the SONAME to
 the library file is a basic mean of the ABI management on platforms with
 advanced - ;-) - support of shared libraries. Besides, these symlinks
 are automatically created by ldconfig when the latter processes the
 directory.

 Anyway, w.r.t. your initial question, I'd usually suggest to use the
 GET_FILENAME_COMPONENT(... REALPATH) command on the symlink prior
 to the INSTALL() command, but it seems to not work as expected:

 CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR)
 PROJECT(P NONE)
 SET(CMAKE_VERBOSE_MAKEFILE ON)
 EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E
    touch xyz.dat.0)
 EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E
    create_symlink xyz.dat.0 xyz.dat)
 GET_FILENAME_COMPONENT(XYZ xyz.dat REALPATH)
 MESSAGE(XYZ: ${XYZ})

 Due to the documentation of GET_FILENAME_COMPONENT(... REALPATH),

 ... the full path with *all* symlinks resolved (REALPATH).

 I'd expect to see

 XYZ: .../xyz.dat.0

 instead of

 XYZ: .../xyz.dat

 Do I misunderstand GET_FILENAME_COMPONENT() in respect thereof?

 Regards,

 Michael

 On 01/06/12 12:45, David Cole wrote:
 Have you considered setting the VERSION and SOVERSION target
 properties on your libraries instead of doing the symlinks yourself?
 CMake will build and install the symlinks automatically for you on
 platforms where they are supported if you set these target properties.

 http://www.cmake.org/cmake/help/cmake-2-8-docs.html#prop_tgt:SOVERSION
 http://www.cmake.org/cmake/help/cmake-2-8-docs.html#prop_tgt:VERSION

 (Or was that just an example, and you need to do this with other
 symlink files that are not simply the version symlinks for a
 library...?)


 HTH,
 David
 --

 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

 It works if you use:

  GET_FILENAME_COMPONENT(XYZ ${CMAKE_CURRENT_BINARY_DIR}/xyz.dat REALPATH)

 I'm not 100% sure if the behavior is expected to be defined for
 non-full paths. Hopefully Brad sees this and chimes in. If not, I'll
 try to remember to ask him about it on Monday.


 HTH,
 David


It appears to be resolved w.r.t. the current *source* directory when
you do not give the full path, and since xyz.dat does not actually
exist in the source dir, there's no way we can know that it is
supposed to be a symlink.

But get_filename_component has to work with non-existing files since
some people need that simply to compute where files should go, or what
other file's base names should be based on CMake variables alone...

Hope that explains it better.

I know it's *possible* to use non-full paths in many contexts within
CMake and still get the results you expect, but because of little
nuggets like this, ...

... I always, always, always use full paths anyway, unconditionally. I
always recommend to everyone that they also adopt this CMake best
practice of referring to files by their full path names whenever
possible. It eliminates confusion, ambiguity and unintended mistaken
results -- and is 100% absolutely worth the effort.


Cheers,
David
--

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] Bug fix requests for the *next* release of CMake...

2012-01-07 Thread Daniel Dekkers
Xcode stuff would be great...
http://public.kitware.com/Bug/view.php?id=12640
http://public.kitware.com/Bug/view.php?id=12506
http://public.kitware.com/Bug/view.php?id=12532

On Jan 2, 2012, at 6:11 PM, David Cole wrote:

 Hi all,
 
 Replies requested. Short replies only. Read on. Just a short reply
 with bug numbers or links to the bugs is all we need here. Please move
 specific discussions into the bugs themselves or start a new thread to
 talk about it... Replies on this thread should just be a collector for
 bug numbers.
 
 Example one-line reply:
 
  http://public.kitware.com/Bug/view.php?id=12647
 
 We are aiming for quarterly releases from now on, scheduling them
 every 3 months. That would make the next release of CMake version
 2.8.8, scheduled to have an rc1 release candidate on Wed. March 7,
 2012 -- just 9 weeks from this Wednesday.
 
 If you have a particular issue that you think should be fixed for
 inclusion in 2.8.8, please bring it up within the next two weeks.
 Ideally, each issue will be discussed as needed on the mailing list to
 come to any consensus about what should be done to fix it, and then an
 entry in the bug tracker may be used to keep it on the radar screen,
 and to track activity related to it. You can see what's on the roadmap
 for this release here:
 http://public.kitware.com/Bug/roadmap_page.php?version_id=90
 
 Patches are always welcome. Patches that include testing of any new
 features, or tests that prove a bug is really fixed on the dashboards,
 basically any patch with testing is preferred over a patch with no
 testing. Also, if you are *adding* code, then you also probably need
 to add *tests* of that code, so that the coverage percentage stays as
 is or rises.
 
 Please discuss issues here as needed, and add notes to existing issues
 in the bug tracker that you are interested in seeing fixed -- we will
 be looking at the mailing list and activity in the bug tracker to help
 prioritize the bug fixes that will occur in the near future.
 
 
 Thanks,
 David Cole
 Kitware, Inc.
 
 
 P.S. - as a nice summary of what we accomplished in the CMake 2.8.7
 release, see here:
 http://public.kitware.com/Bug/changelog_page.php?version_id=89
 -- it currently lists 43 issues that we resolved: nice job, everybody!
 
 (Many of those were specifically addressed because somebody brought it
 up in response to my similar email from just after the last release...
 Don't be shy!)
 --
 
 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

--

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] Are u using mingw32 gcc / with Cmake?

2012-01-07 Thread Bram Kouwenberg
I'm looking for someone with a mingw32 install next to Cmake. I have a
problem compiling probably because of mingw32 --look below if you want.

shout out if you have mingw32


-- Forwarded message --
From: Jean-Christophe Fillion-Robin jchris.filli...@kitware.com
Date: Tue, Jan 3, 2012 at 3:24 PM
Subject: Re: [CMake] compiling problem cmake
To: Bram Kouwenberg kouwenberg.b...@gmail.com
Cc: cmake@cmake.org


Hi,

On Ubuntu, compiling python 2.5.6 following the instruction listed here [1]
works.
[1]
http://www.vtk.org/Wiki/BuildingPythonWithCMake#Building_Python_for_Linux_or_Windows

Somebody with mingw will have to check what's wrong.

Step by step:

wget http://www.python.org/ftp/python/2.5.6/Python-2.5.6.tgz
tar -xzvf Python-2.5.6.tgz
cd Python-2.5.6
cvs -d :pserver:anon...@www.paraview.org:/cvsroot/ParaView3 login
cvs -d :pserver:anon...@www.paraview.org:/cvsroot/ParaView3 co -d
CMakeBuildForPython -r Python-2_5_1-BRANCH
ParaView3/Utilities/CMakeBuildForPython
cp -r CMakeBuildForPython/* .
cmake .
make

[...]
[ 99%] Building C object CMakeFiles/pythonLib.dir/Modules/xxsubtype.o
[100%] Building C object CMakeFiles/pythonLib.dir/Modules/_weakref.o
Linking C static library libpython2.5.a
[100%] Built target pythonLib
Scanning dependencies of target python
[100%] Building C object CMakeFiles/python.dir/Modules/python.o
Linking C executable python
/usr/bin/ld: libpython2.5.a(posixmodule.o): in function
posix_tempnam:posixmodule.c(.text+0x4c23): warning: the use of `tempnam' is
dangerous, better use `mkstemp'
/usr/bin/ld: libpython2.5.a(posixmodule.o): in function
posix_tmpnam:posixmodule.c(.text+0x4ced): warning: the use of `tmpnam_r' is
dangerous, better use `mkstemp'
[100%] Built target python

Hth
Jc



On Mon, Jan 2, 2012 at 9:07 PM, Bram Kouwenberg
kouwenberg.b...@gmail.comwrote:

 here s the same message with the screenie as a png

 -- Forwarded message --
 From: Bram Kouwenberg kouwenberg.b...@gmail.com
 Date: Tue, Jan 3, 2012 at 2:43 AM
 Subject: Re: [CMake] compiling problem cmake
 To: Jean-Christophe Fillion-Robin jchris.filli...@kitware.com
 Cc: cmake@cmake.org


 the python source i got from http://python.org/ftp/python/2.5.6/

 the directions I followed were mainly from
 http://www.vtk.org/Wiki/BuildingPythonWithCMake#Building_Python_for_Linux_or_Windows
  were
 I took the 251 snapshot and changed the patch number to 6. Then during
 configuring I had to manually indicate some modules and env variables, up
 until this error appeared. let me know if you need know more

 On Tue, Jan 3, 2012 at 12:53 AM, Jean-Christophe Fillion-Robin 
 jchris.filli...@kitware.com wrote:

 Hi Bram,

 In order to reproduce and understand the problem, would also be great to
 point us to a repository or place to download the sources.

 Additionally, could you also mention which version of CMake and which
 generator you were using ?

 Hth
 Jc

 On Mon, Jan 2, 2012 at 6:30 PM, Bram Kouwenberg 
 kouwenberg.b...@gmail.com wrote:

 Hi, i want to compile an old python version from source with cmake on
 win 7 but during this process things go wrong with compiling a test
 already; below is the error text: there's a proble creating a folder 
 '/cmTryCompileExec/fast'
 in CmakeTmp. I don't now why. the only strange thing is in explorer I see
 the following tree:


 C:\python256\CMakeFiles\CMakeTmp\CMakeFiles\cmTryCompileExec.dir


 it seems the config process creates another Cmakefiles folder. I have no
 clue why since I'm not familiar with configuring/compiling, but it might
 explain why this TryCompilefast folder cannot be created.


 Anybody see what the problem is here?


 tnx



 The C compiler identification is GNU

 The CXX compiler identification is GNU

 Found Eclipse version 4.1 ()

 Check for working C compiler: C:/MinGW32/bin/gcc.exe

 Check for working C compiler: C:/MinGW32/bin/gcc.exe -- broken

 CMake Error at C:/Program Files/CMake
 2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):

 The C compiler C:/MinGW32/bin/gcc.exe is not able to compile a simple

 test program.

  It fails with the following output:

  Change Dir: C:/python256/CMakeFiles/CMakeTmp

   Run Build Command:C:/PROGRA~1/CMAKE2~1.8/bin/cmake.exe

 cmTryCompileExec/fast

  CMake Error: The source directory

 C:/python256/CMakeFiles/CMakeTmp/cmTryCompileExec/fast does not exist.

  Specify --help for usage, or press the help button on the CMake GUI.

 CMake will not be able to correctly generate this project.

 Call Stack (most recent call first):

 CMakeLists.txt:3 (project)

  Configuring incomplete, errors occurred!

 --

 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




 --
 +1 919 869 8849






-- 
+1 919 869 8849
--

Powered by 

[CMake] How to identify MSVC-compatible compiler?

2012-01-07 Thread Dave Abrahams

Is there a variable that will tell me when the compiler supports
MSVC-compatible command-line flags?  I'd like to have something cleaner
than checking for 

  WINDOWS AND ( MSVC OR INTEL )

If not, I can of course roll my own, but this seems like something that
should be in CMake's standard library.

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com


--

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.7-10-ge0d1e7e

2012-01-07 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  e0d1e7e0852e81bf231cc264b832014167d6 (commit)
  from  cad7508615b529c139fdfdf16989ae370f5697ab (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=e0d1e7e0852e81bf231cc264b832014167d6
commit e0d1e7e0852e81bf231cc264b832014167d6
Author: KWSys Robot kwro...@kitware.com
AuthorDate: Sun Jan 8 00:05:09 2012 -0500
Commit: KWSys Robot kwro...@kitware.com
CommitDate: Sun Jan 8 00:05:09 2012 -0500

KWSys Nightly Date Stamp

diff --git a/Source/kwsys/kwsysDateStamp.cmake 
b/Source/kwsys/kwsysDateStamp.cmake
index b364958..fbfd25c 100644
--- a/Source/kwsys/kwsysDateStamp.cmake
+++ b/Source/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR  2012)
 SET(KWSYS_DATE_STAMP_MONTH 01)
 
 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   07)
+SET(KWSYS_DATE_STAMP_DAY   08)

---

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