Re: [CMake] CTest: Cannot find any coverage files. Ignoring Coverage request.

2010-08-26 Thread emeplease

Thank you David, my issue is solved.
It's because the SET( CMAKE_CXX_FLAGS ) inside CTest script has no effect ,
instead, I need to insert lines into

   SET (CTEST_INITIAL_CACHE 
   ...
   )


Also, I mistakenly override the CMAKE_CXX_FLAGS in the root CMakeList.txt


Regards,
Joseph
On 08/25/2010 10:54 PM, hgc-01...@hkedcity.net wong wrote:

Hi, David , Thank you for your quick reply.

  I am so sorry to have missed this important detail :  cmake-2.6.4-7.el5.
  I am trying to get the coverage report by running  -S script,   the
  script basically
  works by  ctest -D NighlyBuild,  ctest -D NightlyCoverage ...

  I have noticed that the executable built by cmake does not generate
  any coverage
  files like .gcof .  But during compilation, it does show that it's
  compiling and linking with -fprofile-arcs and  -ftest-coverage.


   

2010/8/25 David Coledavid.c...@kitware.com:
 

How are you running ctest to try to get the coverage reported?
With -D NightlyCoverage?
With a -S script?

What version of ctest?

On Wed, Aug 25, 2010 at 3:31 AM, emepleaseemeple...@gmail.com  wrote:
   


Hi,  I am going to enable coverage test in my project,

I have enabled the following compile options:

---
CXXFLAGS=-g -O0 -Wall -Wshadow \
  -Wunused-function -Wunused -Wno-system-headers \
  -Wno-deprecated -Woverloaded-virtual -Wwrite-strings -fprofile-arcs \
  -ftest-coverage \
CFLAGS=-g -O0 -Wall -W -fprofile-arcs -ftest-coverage \
LDFLAGS=-fprofile-arcs -ftest-coverage \

---

Inside DartConfiguration.tcl :
CoverageCommand: /usr/bin/gcov


---
Inside CMakeCache.txt :
COVERAGE_COMMAND:FILEPATH=/usr/bin/gcov


---



However, I am not able to use coverage test:

Performing coverage
  Cannot find any coverage files. Ignoring Coverage request.



Thank you very much.


Regards,
Joseph


___
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


Re: [CMake] CTest: Cannot find any coverage files. Ignoring Coverage request.

2010-08-26 Thread hgc-01...@hkedcity.net wong
Thank you David, my issue is solved.
It's because the SET( CMAKE_CXX_FLAGS ) inside CTest script has no effect ,
instead, I need to insert lines into

   SET (CTEST_INITIAL_CACHE 
   ...
   )


Also, I mistakenly override the CMAKE_CXX_FLAGS in the root CMakeList.txt


Regards,
Joseph

2010/8/25 emeplease emeple...@gmail.com:


 Hi,  I am going to enable coverage test in my project,

 I have enabled the following compile options:
 ---
 CXXFLAGS=-g -O0 -Wall -Wshadow \
  -Wunused-function -Wunused -Wno-system-headers \
  -Wno-deprecated -Woverloaded-virtual -Wwrite-strings -fprofile-arcs \
  -ftest-coverage \
 CFLAGS=-g -O0 -Wall -W -fprofile-arcs -ftest-coverage \
 LDFLAGS=-fprofile-arcs -ftest-coverage \
 ---

 Inside DartConfiguration.tcl :
 CoverageCommand: /usr/bin/gcov

 ---
 Inside CMakeCache.txt :
 COVERAGE_COMMAND:FILEPATH=/usr/bin/gcov

 ---



 However, I am not able to use coverage test:

 Performing coverage
  Cannot find any coverage files. Ignoring Coverage request.



 Thank you very much.


 Regards,
 Joseph



___
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] several questions about cmake

2010-08-26 Thread Mike McQuaid
On 26 August 2010 01:34, Mark Roden mmro...@gmail.com wrote:
 I'm starting to get deep into CMake, and I have a few questions as I
 try to convert the socket++ library such that it can be compiled by
 CMake on Windows.

 1) The default install directory on Windows is C:\Program Files, or
 C:\Program Files (x86) on 64 bit.  This default will not work on
 Windows 7 (and perhaps Vista), because the user isn't running as
 administrator anymore, and only administrators can modify that
 directory.  There should probably be a warning to that effect on
 windows systems; otherwise, there are painful ways to run install, but
 they are painful.

Most developers run as administrator so I don't think there should be a warning.

 2) I'm trying to check to see if a certain C++ code chunk will
 compile.  The line is:

 CHECK_CXX_SOURCE_COMPILES(
 #include string.h
 #include stdio.h
  void main(){
  char buf[100];
  char buf2[100];
  strncpy(buf2, buf, 5);
  buf2[5] = '\0';
  puts(buf2);
  } EXTERN_C)

 The EXTERN_C test is failing here.  The problem is, I can cut and
 paste that code into a blank project in vs2008 and it compiles just
 fine.  Is there a way to see the compiler error, or to determine why
 that would fail?

 The code in the configure.in file is:

 AC_TRY_LINK([
 # include string.h
 # include stdio.h
 ], [
  char buf[100];
  strcpy(buf, Hello world\n);
 ],
  bz_cv_cplusplus_needexternCwrapper=no,
  bz_cv_cplusplus_needexternCwrapper=yes)
 ])

 I can't use that directly (or can I?) because the quotation marks in
 Hello World prematurely cut off the code in the SOURCE section of
 CHECK_CXX_SOURCE_COMPILES, and I get an error that the variable World
 makes no sense.


You can use quotes by doing \ rather than .

 3) There is a check for the presence of the Libg++ library, but no
 specific mention of which function is needed.  According to what I can
 find on CheckLibraryExists, I need to provide a specific function to
 determine if that library is present.  The code in configure.in is:

 AC_CHECK_HEADER(_G_config.h, AC_DEFINE(_S_LIBGXX))

 In that case, should I be looking for a particular function in
 _G_config.h (which I don't have, since I'm on Windows) and just using
 it arbitrarily?  I'm not even close to the point where this code can
 fail in compilation and therefore determine the error directly.

I don't think you need to check for that library, certainly not on Windows.

 4) There are two checks for potentially predefined variables, namely
 sys_siglist and sys_errlist.  The code to check for these looks like:

 AC_CACHE_VAL(socketxx_cv_siglist, [
 AC_TRY_LINK([
 # include unistd.h
 # include sys/signal.h
 ], [
 #ifndef _sys_siglist
  extern char* _sys_siglist[];
 #endif
  puts(*_sys_siglist);
 ],
 socketxx_cv_siglist=_sys_siglist,
 socketxx_cv_siglist=sys_siglist) ])
 AC_DEFINE_UNQUOTED(SYS_SIGLIST, $socketxx_cv_siglist)

 Windows doesn't have unistd.h or sys/signal.h, so I know that this
 will fail, regardless of the test.  I'm unfamiliar with these
 variables; does anyone have any insight into them?  It looks like if
 the code compiles, the variable _sys_siglist will be used, otherwise,
 sys_siglist, whatever that is.  I'm tempted to just say that it is
 what it is, and if other unix users have issues, we can fix the cmake
 file then.  The typical sloppiness of someone not dealing with their
 native platform, I guess :)

 There are other problems with converting this file, but I want to
 start with this one and still hack away at the others.

I'd recommend looking at the manpages for these functions and trying
to find a native equivalent you can check for and extend the check.

I wouldn't try and copy all the autoconf checks exactly, just get your
project building first and then create the ones you actually need.

-- 
Cheers,
Mike McQuaid
http://mikemcquaid.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

Re: [CMake] several questions about cmake

2010-08-26 Thread Michael Wild

On 26. Aug, 2010, at 1:34 , Mark Roden wrote:

 I'm starting to get deep into CMake, and I have a few questions as I
 try to convert the socket++ library such that it can be compiled by
 CMake on Windows.
 

Cool!

 1) The default install directory on Windows is C:\Program Files, or
 C:\Program Files (x86) on 64 bit.  This default will not work on
 Windows 7 (and perhaps Vista), because the user isn't running as
 administrator anymore, and only administrators can modify that
 directory.  There should probably be a warning to that effect on
 windows systems; otherwise, there are painful ways to run install, but
 they are painful.

I hope you will create an installer using CPack, and most users will then use 
that instead of compiling from sources, so IMHO that is no real problem.

 
 2) I'm trying to check to see if a certain C++ code chunk will
 compile.  The line is:
 
 CHECK_CXX_SOURCE_COMPILES(
 #include string.h
 #include stdio.h
 void main(){
  char buf[100];
  char buf2[100];
  strncpy(buf2, buf, 5);
  buf2[5] = '\0';
  puts(buf2);
 } EXTERN_C)
 
 The EXTERN_C test is failing here.  The problem is, I can cut and
 paste that code into a blank project in vs2008 and it compiles just
 fine.  Is there a way to see the compiler error, or to determine why
 that would fail?
 
 The code in the configure.in file is:
 
 AC_TRY_LINK([
 # include string.h
 # include stdio.h
 ], [
  char buf[100];
  strcpy(buf, Hello world\n);
 ],
  bz_cv_cplusplus_needexternCwrapper=no,
  bz_cv_cplusplus_needexternCwrapper=yes)
 ])
 
 I can't use that directly (or can I?) because the quotation marks in
 Hello World prematurely cut off the code in the SOURCE section of
 CHECK_CXX_SOURCE_COMPILES, and I get an error that the variable World
 makes no sense.

Just put \ in front of the quotation marks, and the hello world code will work.


 
 3) There is a check for the presence of the Libg++ library, but no
 specific mention of which function is needed.  According to what I can
 find on CheckLibraryExists, I need to provide a specific function to
 determine if that library is present.  The code in configure.in is:
 
 AC_CHECK_HEADER(_G_config.h, AC_DEFINE(_S_LIBGXX))
 
 In that case, should I be looking for a particular function in
 _G_config.h (which I don't have, since I'm on Windows) and just using
 it arbitrarily?  I'm not even close to the point where this code can
 fail in compilation and therefore determine the error directly.

In that case I just find a sufficiently unique function in libg++ (using e.g. 
the nm tool on Unix systems or dumpbin on Windows). But what above code 
actually does corresponds to

find_file(G_CONFIG_H_PATH _G_config.h)
if(G_CONFIG_H_PATH)
  set(_S_LIBGXX 1)
else()
  set(_S_LIBGXX 0)
endif()

Actually, it does a bit more (see the docs of AC_DEFINE), but I don't think it 
is relevant to you.

 
 4) There are two checks for potentially predefined variables, namely
 sys_siglist and sys_errlist.  The code to check for these looks like:
 
 AC_CACHE_VAL(socketxx_cv_siglist, [
 AC_TRY_LINK([
 # include unistd.h
 # include sys/signal.h
 ], [
 #ifndef _sys_siglist
  extern char* _sys_siglist[];
 #endif
  puts(*_sys_siglist);
 ],
 socketxx_cv_siglist=_sys_siglist,
 socketxx_cv_siglist=sys_siglist) ])
 AC_DEFINE_UNQUOTED(SYS_SIGLIST, $socketxx_cv_siglist)
 
 Windows doesn't have unistd.h or sys/signal.h, so I know that this
 will fail, regardless of the test.  I'm unfamiliar with these
 variables; does anyone have any insight into them?  It looks like if
 the code compiles, the variable _sys_siglist will be used, otherwise,
 sys_siglist, whatever that is.  I'm tempted to just say that it is
 what it is, and if other unix users have issues, we can fix the cmake
 file then.  The typical sloppiness of someone not dealing with their
 native platform, I guess :)
 

Those are definitely unixy, they contain operating system signal and error 
descriptions and are usually accessed through the psginal, strsignal, perror 
and strerror family of functions. Normally they should not be accessed 
directly. I think the above code assumes it's running on Unix and just 
determines whether the C library implementor prefixed the variables with a _ 
(to mark them for internal use only).

 There are other problems with converting this file, but I want to
 start with this one and still hack away at the others.
 
 Thanks!
 Mark

HTH

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] Running a command after generation of Makefile

2010-08-26 Thread Johny
I do not want all the include flags to be isystem, only one. I'm using 
cmake version 2.8.2


Cheers,
Johny

On 08/25/2010 09:46 PM, Bill Hoffman wrote:

On Wed, Aug 25, 2010 at 3:01 PM, Michael Wildthem...@gmail.com  wrote:
   

On 25. Aug, 2010, at 18:57 , Johny wrote:

 

Hey,

I was trying to use the SYSTEM option in the include_directories command , 
however it does not seem to work on the MACOSX platform. So i wrote a little 
fix which basically replaces all the -I${foldername} with -isystem 
${foldername}. However these commands need to be executed after my makefiles 
are generated and i wud like to not have the user execute another cmake script 
before running make. Is it possible?

Cheers,
Johny
   

If you want *all* -I to be replaced by -isystem, simply set the 
CMAKE_INCLUDE_FLAG_C and CMAKE_INCLUDE_FLAG_CXX variables to -isystem.

Michael
 

What version of CMake?

Platforms/Darwin.cmake has this in git master:
# Xcode does not support -isystem yet.
IF(XCODE)
   SET(CMAKE_INCLUDE_SYSTEM_FLAG_C)
   SET(CMAKE_INCLUDE_SYSTEM_FLAG_CXX)
ENDIF(XCODE)

I seem to remember it doing that by default in older versions...

-Bill
   


___
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] Different configurations with Visual Studio

2010-08-26 Thread Mark Van Peteghem
2010/7/5 John Drescher dresche...@gmail.com

  I see, thanks. I intend to write a Python script that adds the extra
  platform solution, because we really need that. Visual Studio and
  Code::Blocks project files are XML files, so it shouldn't be too hard.
 

 What is wrong with different build folders for each compiler / ide?


(sorry for picking this up again so late)

We do have different build folders for each compiler / ide, but I mean
'build folder' as the folder where the object files and executable ends. We
just want one project file with different platform solutions, so we don't
have to reload the project file when we want to switch. Having two project
files in the same solution also is not an option, because the source files
and many settings are the same. Besides, this is a big solution file with
over 50 project files, so doubling that would make things a lot harder.

I don't really understand why some find this an awkward way of doing things,
it is simply convenient to have both platforms in one project file, e.g. it
is easy to build everything at once. I don't see any drawbacks.

Mark
___
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] Different configurations with Visual Studio

2010-08-26 Thread Mike McQuaid
On 26 August 2010 10:17, Mark Van Peteghem mar...@gmail.com wrote:
 We do have different build folders for each compiler / ide, but I mean
 'build folder' as the folder where the object files and executable ends. We
 just want one project file with different platform solutions, so we don't
 have to reload the project file when we want to switch. Having two project
 files in the same solution also is not an option, because the source files
 and many settings are the same. Besides, this is a big solution file with
 over 50 project files, so doubling that would make things a lot harder.

 I don't really understand why some find this an awkward way of doing things,
 it is simply convenient to have both platforms in one project file, e.g. it
 is easy to build everything at once. I don't see any drawbacks.

In that case, use various if/else statements depending on your
platform and just use a different build directory for each platform,
then each will have a different build folder but also a different
CMake cache so the variables will be parsed differently.
-- 
Cheers,
Mike McQuaid
http://mikemcquaid.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] VS2010 + Intel Fortran (CompilerPro) 12

2010-08-26 Thread Biddiscombe, John A.
I tried and failed to generate working project files for the Fortran 12 
compiler with Visual Studio 2010. (NMake works ok)

Has anyone else tried with success ?

If not ... is there any possibility of CMake Developers targeting the New Intel 
tool suite in the near future?

I'd like to have a go at creating a generator for the Fortran projects, but 
it'd probably take me too long to be of use with my current projects.

Just hoping that someone out there is already fixing it.

JB
___
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] several questions about cmake

2010-08-26 Thread Hickel, Kelly


 -Original Message-
 From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On
 Behalf Of Mike McQuaid
 Sent: Thursday, August 26, 2010 1:12 AM
 To: Mark Roden
 Cc: cmake@cmake.org
 Subject: Re: [CMake] several questions about cmake
 
 On 26 August 2010 01:34, Mark Roden mmro...@gmail.com wrote:
  I'm starting to get deep into CMake, and I have a few questions as I
  try to convert the socket++ library such that it can be compiled by
  CMake on Windows.
 
  1) The default install directory on Windows is C:\Program Files, or
  C:\Program Files (x86) on 64 bit.  This default will not work on
  Windows 7 (and perhaps Vista), because the user isn't running as
  administrator anymore, and only administrators can modify that
  directory.  There should probably be a warning to that effect on
  windows systems; otherwise, there are painful ways to run install,
 but
  they are painful.
 
 Most developers run as administrator so I don't think there should be a
 warning.
 

In Windows 7 and Windows 2008 server, being logged in as a user in the 
Administrators 
group is not sufficient, you have to elevate the privs of your process to write 
in those directories.
Another possibility is turning off UAC all together.

So the warning might still be a good idea.

-Kelly
___
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] Running a command after generation of Makefile

2010-08-26 Thread Bill Hoffman

On 8/26/2010 4:00 AM, Johny wrote:

  SET(CMAKE_INCLUDE_SYSTEM_FLAG_C)
SET(CMAKE_INCLUDE_SYSTEM_FLAG_CXX)

Can you try:

 SET(CMAKE_INCLUDE_SYSTEM_FLAG_C -isystem)
   SET(CMAKE_INCLUDE_SYSTEM_FLAG_CXX -isystem)



--
Bill Hoffman
Kitware, Inc.
28 Corporate Drive
Clifton Park, NY 12065
bill.hoff...@kitware.com
http://www.kitware.com
518 881-4905 (Direct)
518 371-3971 x105
Fax (518) 371-4573
___
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] several questions about cmake

2010-08-26 Thread Mark Roden
On Wed, Aug 25, 2010 at 11:17 PM, Michael Wild them...@gmail.com wrote:

 On 26. Aug, 2010, at 1:34 , Mark Roden wrote:

 I'm starting to get deep into CMake, and I have a few questions as I
 try to convert the socket++ library such that it can be compiled by
 CMake on Windows.


 Cool!
Thanks, I think so to :)


 1) The default install directory on Windows is C:\Program Files, or
 C:\Program Files (x86) on 64 bit.  This default will not work on
 Windows 7 (and perhaps Vista), because the user isn't running as
 administrator anymore, and only administrators can modify that
 directory.  There should probably be a warning to that effect on
 windows systems; otherwise, there are painful ways to run install, but
 they are painful.

 I hope you will create an installer using CPack, and most users will then use 
 that instead of compiling from sources, so IMHO that is no real problem.

I generally intend to create an installer using WiX, mainly out of
ignorance of CPack and extensive experience using WiX.  Not that WiX
is better-- it has some serious usability problems-- but it integrates
nicely with visual studio.

However, I'm more talking about when I run CMake to install on my own machine.

My work paradigm runs like this:
1) get all the libraries I need
2) compile them all
3) put the libraries and headers into a file
4) make my own project in visual studio
5) reference those libraries and headers in my project

Why not put it all into CMake, I hear you cry?  A few reasons:
1) For the longest time (and still ongoing), the gdcm version in itk
doesn't match the latest greatest from gdcm.  There is a compiler
switch to use 'system gdcm', whatever that means on Windows, but other
projects I have require the 1.2 branch in itk.  So I can (and do) have
multiple versions of itk to account for this, and so need to ensure I
reference the right one.
2) I'm generally not messing directly with the libraries I install via
cmake, I just compile against them and use provided functions.  Going
through the cmakelists process is not helpful when I'm just using the
libraries as is.  When I modify the libraries, then I use CMake,
because that's the way these libraries come.
3) Since I don't want to recompile the libraries on multiple machines,
I just check in the results of running the installation into source
control.  This works great when you're deploying on windows;
everything compiles and builds on one machine will work on another, so
reproducing my dev environment, either for a coworker or for myself on
another machine, is much simpler and saves more time than getting the
source, making sure it's the same source as what I started with, and
rebuilding again.

So, yes, a warning would be very nice, given the way that I use the
installation option in CMake.


 2) I'm trying to check to see if a certain C++ code chunk will
 compile.  The line is:

 CHECK_CXX_SOURCE_COMPILES(
 #include string.h
 #include stdio.h
 void main(){
  char buf[100];
  char buf2[100];
  strncpy(buf2, buf, 5);
  buf2[5] = '\0';
  puts(buf2);
 } EXTERN_C)

 The EXTERN_C test is failing here.  The problem is, I can cut and
 paste that code into a blank project in vs2008 and it compiles just
 fine.  Is there a way to see the compiler error, or to determine why
 that would fail?

 The code in the configure.in file is:

 AC_TRY_LINK([
 # include string.h
 # include stdio.h
 ], [
  char buf[100];
  strcpy(buf, Hello world\n);
 ],
  bz_cv_cplusplus_needexternCwrapper=no,
  bz_cv_cplusplus_needexternCwrapper=yes)
 ])

 I can't use that directly (or can I?) because the quotation marks in
 Hello World prematurely cut off the code in the SOURCE section of
 CHECK_CXX_SOURCE_COMPILES, and I get an error that the variable World
 makes no sense.

 Just put \ in front of the quotation marks, and the hello world code will 
 work.

That's not my point.  The code I gave has no double quotes in it, and
it still doesn't compile properly, but it does compile and work in a
visual studio environment.
If I do:

CHECK_CXX_SOURCE_COMPILES(
#include string.h
#include stdio.h
 void main(){
  char buf[100];
  strcpy(buf, \Hello world\n\);
 } EXTERN_C)

I get

Performing Test EXTERN_C
Performing Test EXTERN_C - Failed

But that code compiles in an empty vs2008 project.

 How can I get the compiler error?  I don't see why this code test should fail.




 3) There is a check for the presence of the Libg++ library, but no
 specific mention of which function is needed.  According to what I can
 find on CheckLibraryExists, I need to provide a specific function to
 determine if that library is present.  The code in configure.in is:

 AC_CHECK_HEADER(_G_config.h, AC_DEFINE(_S_LIBGXX))

 In that case, should I be looking for a particular function in
 _G_config.h (which I don't have, since I'm on Windows) and just using
 it arbitrarily?  I'm not even close to the point where this code can
 fail in compilation and therefore determine the error directly.

 In that case I just find a 

Re: [CMake] several questions about cmake

2010-08-26 Thread John Drescher
On Thu, Aug 26, 2010 at 6:47 AM, Hickel, Kelly kelly_hic...@bmc.com wrote:


 -Original Message-
 From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On
 Behalf Of Mike McQuaid
 Sent: Thursday, August 26, 2010 1:12 AM
 To: Mark Roden
 Cc: cmake@cmake.org
 Subject: Re: [CMake] several questions about cmake

 On 26 August 2010 01:34, Mark Roden mmro...@gmail.com wrote:
  I'm starting to get deep into CMake, and I have a few questions as I
  try to convert the socket++ library such that it can be compiled by
  CMake on Windows.
 
  1) The default install directory on Windows is C:\Program Files, or
  C:\Program Files (x86) on 64 bit.  This default will not work on
  Windows 7 (and perhaps Vista), because the user isn't running as
  administrator anymore, and only administrators can modify that
  directory.  There should probably be a warning to that effect on
  windows systems; otherwise, there are painful ways to run install,
 but
  they are painful.

 Most developers run as administrator so I don't think there should be a
 warning.


 In Windows 7 and Windows 2008 server, being logged in as a user in the 
 Administrators
 group is not sufficient, you have to elevate the privs of your process to 
 write in those directories.
 Another possibility is turning off UAC all together.

 So the warning might still be a good idea.

I agree. Installing on these systems even as administrator to the
default location C:\Program Files\  fails. I usually have CMake
install elsewhere by changing the CMAKE_INSTALL_PREFIX

John
___
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] several questions about cmake

2010-08-26 Thread Clinton Stimpson

On 08/26/2010 09:45 AM, John Drescher wrote:

On Thu, Aug 26, 2010 at 6:47 AM, Hickel, Kellykelly_hic...@bmc.com  wrote:
   


 

-Original Message-
From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On
Behalf Of Mike McQuaid
Sent: Thursday, August 26, 2010 1:12 AM
To: Mark Roden
Cc: cmake@cmake.org
Subject: Re: [CMake] several questions about cmake

On 26 August 2010 01:34, Mark Rodenmmro...@gmail.com  wrote:
   

I'm starting to get deep into CMake, and I have a few questions as I
try to convert the socket++ library such that it can be compiled by
CMake on Windows.

1) The default install directory on Windows is C:\Program Files, or
C:\Program Files (x86) on 64 bit.  This default will not work on
Windows 7 (and perhaps Vista), because the user isn't running as
administrator anymore, and only administrators can modify that
directory.  There should probably be a warning to that effect on
windows systems; otherwise, there are painful ways to run install,
 

but
   

they are painful.
 

Most developers run as administrator so I don't think there should be a
warning.

   

In Windows 7 and Windows 2008 server, being logged in as a user in the 
Administrators
group is not sufficient, you have to elevate the privs of your process to write 
in those directories.
Another possibility is turning off UAC all together.

So the warning might still be a good idea.

 

I agree. Installing on these systems even as administrator to the
default location C:\Program Files\  fails. I usually have CMake
install elsewhere by changing the CMAKE_INSTALL_PREFIX

   


Interesting.. because on Unix systems the default is /usr/local which 
also requires elevated privileges.


Clint
___
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] several questions about cmake

2010-08-26 Thread Knox, Kent
 1) The default install directory on Windows is C:\Program Files, or

 C:\Program Files (x86) on 64 bit. ?This default will not work on

 Windows 7 (and perhaps Vista), because the user isn't running as

 administrator anymore, and only administrators can modify that

 directory. ?There should probably be a warning to that effect on

 windows systems; otherwise, there are painful ways to run install, but

 they are painful.



Most developers run as administrator so I don't think there should be a 
warning.

As a matter of fact, most developers do NOT run as administrator on Win7 and 
Vista; default users start with a split security token and you have to elevate 
permissions to write to the 'program files' directory.  The only way around 
this is to turn off UAC; that's an individual decision whether one feels safe 
doing that.

I would also like to see the default install directory for cmake change.  In 
the meantime, I have my cmake script itself change the default:

# On windows, it's convenient to change the default install prefix such that it 
does NOT point to 'program files'
if( WIN32 AND CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT )
set( CMAKE_INSTALL_PREFIX ${PROJECT_BINARY_DIR}/install CACHE 
PATH Install path prefix, prepended onto install directories FORCE )
endif( )



___
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] VS2010 + Intel Fortran (CompilerPro) 12

2010-08-26 Thread Bill Hoffman
On Thu, Aug 26, 2010 at 5:18 AM, Biddiscombe, John A. biddi...@cscs.ch wrote:
 I tried and failed to generate working project files for the Fortran 12
 compiler with Visual Studio 2010. (NMake works ok)



 Has anyone else tried with success ?



 If not ... is there any possibility of CMake Developers targeting the New
 Intel tool suite in the near future?



 I’d like to have a go at creating a generator for the Fortran projects, but
 it’d probably take me too long to be of use with my current projects.



 Just hoping that someone out there is already fixing it.



Nobody is working on this right now.  The original Fortran VS
integration was paid for by a support contract with Kitware.  Of
course VS 2010 changes all of that, and requires some new code.

I don't even have that compiler here at Kitware.  If you were to
create a patch and run a dashboard that would be great.  :)

It might not be that hard...

-Bill
___
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] several questions about cmake

2010-08-26 Thread Michael Hertling
On 08/26/2010 05:38 PM, Mark Roden wrote:

 2) I'm trying to check to see if a certain C++ code chunk will
 compile.  The line is:

 CHECK_CXX_SOURCE_COMPILES(
 #include string.h
 #include stdio.h
 void main(){
  char buf[100];
  char buf2[100];
  strncpy(buf2, buf, 5);
  buf2[5] = '\0';
  puts(buf2);
 } EXTERN_C)

 The EXTERN_C test is failing here.  The problem is, I can cut and
 paste that code into a blank project in vs2008 and it compiles just
 fine.  Is there a way to see the compiler error, or to determine why
 that would fail?

 The code in the configure.in file is:

 AC_TRY_LINK([
 # include string.h
 # include stdio.h
 ], [
  char buf[100];
  strcpy(buf, Hello world\n);
 ],
  bz_cv_cplusplus_needexternCwrapper=no,
  bz_cv_cplusplus_needexternCwrapper=yes)
 ])

 I can't use that directly (or can I?) because the quotation marks in
 Hello World prematurely cut off the code in the SOURCE section of
 CHECK_CXX_SOURCE_COMPILES, and I get an error that the variable World
 makes no sense.

 Just put \ in front of the quotation marks, and the hello world code will 
 work.
 
 That's not my point.  The code I gave has no double quotes in it, and
 it still doesn't compile properly, but it does compile and work in a
 visual studio environment.
 If I do:
 
 CHECK_CXX_SOURCE_COMPILES(
 #include string.h
 #include stdio.h
  void main(){
   char buf[100];
   strcpy(buf, \Hello world\n\);
  } EXTERN_C)
 
 I get
 
 Performing Test EXTERN_C
 Performing Test EXTERN_C - Failed
 
 But that code compiles in an empty vs2008 project.
 
  How can I get the compiler error?  I don't see why this code test should 
 fail.

You need to escape the newline in the string literal four-fold, i.e.
\Hello worldn\. Moreover, void isn't allowed as the return
type of main() in C++, use int instead.

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] CMake and CTest for Google tests (Chris Hillery)

2010-08-26 Thread Neelima Mehdiratta

Hi Chris,

Your suggestion to generate testlist.cmake in your build directory and
then re-run cmake worked with some tweaking.

Thank you!!

Neelima

Message: 3
Date: Wed, 25 Aug 2010 18:31:46 -0700
From: Chris Hillery chillery-cm...@lambda.nu
Subject: Re: [CMake] CMake and CTest for Google tests
To: Neelima Mehdiratta nmehdira...@decarta.com
Cc: cmake@cmake.org
On Wed, Aug 25, 2010 at 3:17 PM, Neelima Mehdiratta
nmehdira...@decarta.com
 wrote:

 ADD_CUSTOM_COMMAND(TARGET ${BIN_NAME}

 POST_BUILD

 WORKING_DIRECTORY ${SRC_DIR}

 COMMAND bash ./addtestscrpt

 COMMAND ${CMAKE_COMMAND} ${SRC_DIR}/DDSCommonTests/CMakeLists.txt

 )


I'm not sure, but I think you're very close to the right answer here.
The
problem with the above COMMAND is that it doesn't quite make sense - you
can't specify a CMakeLists.txt file as an argument to CMake; it's not a
scripting language in that sense, at least when it's doing build-tree
configuration.

I think what you should do is the following. In your top-level
CMakeLists.txt, have something like

IF (EXISTS ${CMAKE_BINARY_DIR}/testlist.cmake)
  INCLUDE (${CMAKE_BINARY_DIR}/testlist.cmake)
ENDIF (EXISTS ${CMAKE_BINARY_DIR}/testlist.cmake)

and then change your custom to command to generate testlist.cmake in
your
build directory and then re-run cmake:

ADD_CUSTOM_COMMAND(TARGET ${CMAKE_BINARY_DIR}/testlist.cmake
  POST_BUILD
  WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
  COMMAND bash addtestscript
  COMMAND ${CMAKE_COMMAND} ${CMAKE_SOURCE_DIR}
)

You'll need to tweak the invocation of addtestscript to successfully
generate testlist.cmake in the build directory, and then I think it'll
all
work.

Ceej
aka Chris Hillery

___
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 and CTest for Google tests

2010-08-26 Thread Neelima Mehdiratta
Hi Fraser,

 

That's a great suggestion!  Thank you for the script.  It appears that
CMake has support for GTESTS in CMake 2.8.2 which uses a macro, very
similar to yours.

 

http://public.kitware.com/cgibin/viewcvs.cgi/Modules/FindGTest.cmake?rev
ision=1.4root=CMakeview=markup

 

Thanks again!

Neelima

 



From: Fraser Hutchison [mailto:fraser.hutchi...@googlemail.com] 
Sent: Thursday, August 26, 2010 2:28 AM
To: Neelima Mehdiratta
Cc: cmake@cmake.org
Subject: Re: [CMake] CMake and CTest for Google tests

 

Hi Neelima,

If you're building the test executable(s) using CMake already and
assuming you have a variable like ${GTEST_SOURCE_FILES} which is a list
of all your test source files, you could probably get away without using
a script to generate a list of names by doing something like:

FOREACH(GTEST_SOURCE_FILE ${GTEST_SOURCE_FILES})
  FILE(STRINGS ${GTEST_SOURCE_FILE} GTEST_NAMES REGEX ^TEST)
  FOREACH(GTEST_NAME ${GTEST_NAMES})
STRING(REGEX REPLACE [\) \(,] ; GTEST_NAME ${GTEST_NAME})
LIST(GET GTEST_NAME 1 GTEST_GROUP_NAME)
LIST(GET GTEST_NAME 3 GTEST_NAME)
ADD_TEST(${GTEST_GROUP_NAME}.${GTEST_NAME}
${EXECUTABLE_OUTPUT_PATH}/${BIN_NAME}
--gtest_filter=${GTEST_GROUP_NAME}.${GTEST_NAME})
  ENDFOREACH()
ENDFOREACH()

This relies on the tests each being defined by the Gtest macro TEST(test
fixture, test name) or TEST_F(test fixture, test name) in the source
files, but it would avoid the need to have the test executable built
before running the ADD_TEST command.

Cheers,

Fraser.




On 25/08/2010 11:17 PM, Neelima Mehdiratta wrote: 

I am using Google Tests to create unit tests for our software.  We are
using CMake (version 4.6-patch 2)  for building the unit tests
executable.  Since the list of unit tests is expected to grow to
thousands of tests, I am looking for a way to automate creating a file
(say testlist) on the fly that will contain the list of all our unit
tests specified using the CTest ADD_TEST command. My thought was to use
INCLUDE(testlist) to read in the list of tests at the appropriate point
in the CMakeLists.txt file(i.e, just after calling ENABLE_TESTING().

 

I have a shell (bash) script (addtestscrpt) that needs to run the unit
tests executable to get the list of all unit tests and then put ADD_TEST
for each of those tests into a file which would look like this:

 

ADD_TEST(DDSCfgTest.ctr ${EXECUTABLE_OUTPUT_PATH}/${BIN_NAME}
--gtest_filter=DDSCfgTest.ctr)

ADD_TEST(DDSCfgTest.ReadBool ${EXECUTABLE_OUTPUT_PATH}/${BIN_NAME}
--gtest_filter=DDSCfgTest.ReadBool)

ADD_TEST(DDSCfgTest.ReadInt ${EXECUTABLE_OUTPUT_PATH}/${BIN_NAME}
--gtest_filter=DDSCfgTest.ReadInt)

 

The problem that I'm having is that I need the unit tests executable to
generate the list of all tests and then INCLUDE the list in a
CMakeList.txt file after the unit tests executable is built. 

 

I tried using ADD_CUSTOM_COMMAND with POST_BUILD to run my shell script
(COMMAND ./addtestscript) which runs and creates the list of ADD_TEST()
commands and puts them in a file. But I don't know how to include this
file in the ADD_CUSTOM_COMMAND

 

The closest I got was:

 

ADD_CUSTOM_COMMAND(TARGET ${BIN_NAME}

POST_BUILD

WORKING_DIRECTORY ${SRC_DIR}

COMMAND bash ./addtestscrpt

COMMAND ${CMAKE_COMMAND} ${SRC_DIR}/DDSCommonTests/CMakeLists.txt

)

where ${SRC_DIR}/DDSCommonTests/CMakeLists.txt

contains

ENABLE_TESTING()

INCLUDE(${SRC_DIR)/testlist)

 

but this doesn't work presumably because CTest needs to know about the
CTestTestfile.cmake in this directory, again in the post_build step.

 

Is there any way to a) Add the INCLUDE(testlist) to the
ADD_CUSTOM_COMMAND or b) tell CTest to read the CTestTestfile.cmake from
that directory or c) Any other way of solving this?

 

Thanks.

 

 

 
 
___
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-commits] CMake branch, master, updated. v2.8.2-286-gd8ccd17

2010-08-26 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  d8ccd1760c39ba836dc8daf3c0ea4f313be663cc (commit)
  from  737261785a85f365c28ce4fb3da7695f8c09e139 (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=d8ccd1760c39ba836dc8daf3c0ea4f313be663cc
commit d8ccd1760c39ba836dc8daf3c0ea4f313be663cc
Author: KWSys Robot kwro...@kitware.com
AuthorDate: Fri Aug 27 00:01:05 2010 -0400
Commit: KWSys Robot kwro...@kitware.com
CommitDate: Fri Aug 27 00:10:03 2010 -0400

KWSys Nightly Date Stamp

diff --git a/Source/kwsys/kwsysDateStamp.cmake 
b/Source/kwsys/kwsysDateStamp.cmake
index 329b7df..7fe952b 100644
--- a/Source/kwsys/kwsysDateStamp.cmake
+++ b/Source/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR  2010)
 SET(KWSYS_DATE_STAMP_MONTH 08)
 
 # 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