[CMake] One last try

2010-06-21 Thread Gerry Weaver
Hello All,


I've been using cmake for many years. I must admit that I have always been 
somewhat bothered by the complexity of it, but it hasn't really become an issue 
until now. When Microsoft Visual Studio 2008 came out, I upgraded in order to 
get some new apis I needed. When I tried a cmake based build with this new 
compiler, it failed with problems finding sdk libs and various resource files. 
I fiddled with it for a couple of days, but could not get it to work. I also 
spent some time searching the Internet for a solution to my problem with no 
luck. All I could find was some very basic responses regarding vsvars32.bat 
etc. I then punted and used the Borland compiler instead. I am now facing the 
same situation again. I need to use Visual Studio 2008 on another project. 
Unfortunately, I cannot use Borland this time because the libs I need will not 
compile under the Borland compiler. I started with a clean machine, executed 
the vsvars32.bat and got the same exact problem I had before. I searched the 
Internet again thinking surely this problem had been resolved, but apparently 
it hasn't. I don't feel very comfortable in investing several days hacking up 
cmake to get this to work. This all leads me to the following questions.


1. Is cmake supposed to support Visual Studio 2008 out of the box?
2. If not, is there support for Visual Studio 2010?
3. If not, is there a patch or fix for either of the above?


cmake 2.8.1
msvc 2008
winxp sp4
Nmake Makefiles




Thanks,
-G   ___
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] install() command - order of evaluation

2010-06-21 Thread Sukender
Hi all,

It seems install(SCRIPT) is called before install(TARGETS) ; is there a way to 
change this?

Actually I try to insert a script just before packaging (ie. at the end of 
"INSTALL" target). I'd like to have:
- Prepare all files (install(FILES), and install(TARGETS))
- Run my script (install(SCRIPT)), so that it operates on a file created by 
install(TARGETS).
- Package
What I got is a script running on a non existing file (install(TARGETS) did not 
run before install(SCRIPT)).
(Note: my "install(SCRIPT)" command is after the "install(TARGETS)" command in 
my CMake files, but the order doesn't seem to be kept... or is it?)

Or is there a better way to get what I want?

Side question: Is it possible to have multiple "PACKAGE" targets (for instance 
"PACKAGE_NORMAL", "PACKAGE_SPECIAL", etc...)?

Many thanks.

[Using CMake 2.8.0, Win7 64 bits, MSVC 9 SP1 (project is 32 bits)]

Sukender
PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/
___
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] One last try

2010-06-21 Thread Bo Thorsen

Den 21-06-2010 09:02, Gerry Weaver skrev:

[...]
1. Is cmake supposed to support Visual Studio 2008 out of the box?


I have been using cmake and VS2008 for a while without any problems on 
XP, Vista and Windows 7.


There must be something really odd in your setup.

When upgrading to 2008, did you remove the old SDK? VS2008 comes with 
it's own SDK.


Bo Thorsen.
Monty Program AB.

--

MariaDB: MySQL replacement
Community developed. Feature enhanced. Backward compatible.
___
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] Link order of object files

2010-06-21 Thread Mathias Lafeldt
Hi,

is there a way to tell CMake in which order to link in object files?

For example, I got the following executable:

ADD_EXECUTABLE(hello crt0.o hello.c)

Using a disassembler, I can see that hello.c is compiled in before
crt0.o, but I want crt0.o to always be the first.

Also, this gives me the same result:

ADD_EXECUTABLE(hello hello.c crt0.o)

-Mathias
___
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] One last try

2010-06-21 Thread Michael Jackson
What are the problems that you are are having? What errors does cmake
produce? I use cmake with vs2008 every day on win 7 and win xp sp3
without any problems.

-
Mike Jackson  www.bluequartz.net
Principal Software Engineer   mike.jack...@bluequartz.net
BlueQuartz Software   Dayton, Ohio


On Jun 21, 2010, at 3:02, Gerry Weaver  wrote:

> Hello All,
>
> I've been using cmake for many years. I must admit that I have
> always been somewhat bothered by the complexity of it, but it hasn't
> really become an issue until now. When Microsoft Visual Studio 2008
> came out, I upgraded in order to get some new apis I needed. When I
> tried a cmake based build with this new compiler, it failed with
> problems finding sdk libs and various resource files. I fiddled with
> it for a couple of days, but could not get it to work. I also spent
> some time searching the Internet for a solution to my problem with
> no luck. All I could find was some very basic responses regarding
> vsvars32.bat etc. I then punted and used the Borland compiler
> instead. I am now facing the same situation again. I need to use
> Visual Studio 2008 on another project. Unfortunately, I cannot use
> Borland this time because the libs I need will not compile under the
> Borland compiler. I started with a clean machine, executed the
> vsvars32.bat and got the same exact problem I had before. I searched
> the Internet again thinking surely this problem had been resolved,
> but apparently it hasn't. I don't feel very comfortable in investing
> several days hacking up cmake to get this to work. This all leads me
> to the following questions.
>
> 1. Is cmake supposed to support Visual Studio 2008 out of the box?
> 2. If not, is there support for Visual Studio 2010?
> 3. If not, is there a patch or fix for either of the above?
>
> cmake 2.8.1
> msvc 2008
> winxp sp4
> Nmake Makefiles
>
>
> Thanks,
> -G
>
> ___
> 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] How set "Build Name" in CTest/CDash?

2010-06-21 Thread Convey, Christian J CIV NUWC NWPT
I'm using CTest to submit results to CDash.  Can anyone tell me how to specify 
the text that shows up in CDash's "Build Name" column?

The manpage for "ctest" says that I can set the CMAKS_SYSTEM and 
CMAKE_CXX_COMPILER variables, but I'm concerned that doing so may mess up my 
build.

I have a Linux command-line command that yields the text I want to have show up 
in CDash.  I just don't know how to safely get it there.


smime.p7s
Description: S/MIME cryptographic 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] One last try

2010-06-21 Thread Bill Hoffman

On 6/21/2010 3:02 AM, Gerry Weaver wrote:

Hello All,


...

1. Is cmake supposed to support Visual Studio 2008 out of the box?
2. If not, is there support for Visual Studio 2010?
3. If not, is there a patch or fix for either of the above?

cmake 2.8.1
msvc 2008
winxp sp4
Nmake Makefiles



1. Yes, if VS 2008 is installed correctly.

First thing you should try is to build a file WITHOUT CMake:

-foo.cxx
#include 

int main()
{
  std::cout << "hello\n";
  return 0;
}
--

Use this command line:
 cl foo.cxx kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib 
ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib


If that works, then CMake should work when run FROM THAT SAME SHELL.


If that does not work, then you have not correctly installed the SDK and 
compiler.


Are you using the Express or professional version of VS 2008?

If Express, you need to follow these instructions:
http://blogs.msdn.com/b/windowssdk/archive/2008/02/22/using-visual-c-2008-express-with-the-windows-sdk-detailed-version.aspx

Make sure you run CMake and your compiler from a shell that has all the 
environment that cl needs to run.


Please post any errors exactly as you see them and include how you setup 
the environment for the compiler.


-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] One last try

2010-06-21 Thread John Drescher
> 1. Is cmake supposed to support Visual Studio 2008 out of the box?

Yes and it works well. I use this combination every day for the last 2 years.

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] How set "Build Name" in CTest/CDash?

2010-06-21 Thread David Cole
The old-fashioned way of doing this is to set a BUILDNAME variable in the
cmake cache...

In your CMakeLists.txt:
set(BUILDNAME "myBuildName" CACHE STRING "build name variable for CDash")

The new-fashioned way is to set CTEST_BUILD_NAME in your ctest -S script
prior to ctest_configure, ctest_build and ctest_submit...
set(CTEST_BUILD_NAME "myBuildName")

Where were you reading the ctest manpage that talks about setting
CMAKE_SYSTEM and CMAKE_CXX_COMPILER variables?? What version of ctest? That
is completely incorrect, and if it's in the official ctest documentation, we
should fix that and remove the incorrect information. Can you please reply
and tell me how you found this incorrect information...?


HTH,
David


On Mon, Jun 21, 2010 at 7:29 AM, Convey, Christian J CIV NUWC NWPT <
christian.con...@navy.mil> wrote:

> I'm using CTest to submit results to CDash.  Can anyone tell me how to
> specify the text that shows up in CDash's "Build Name" column?
>
> The manpage for "ctest" says that I can set the CMAKS_SYSTEM and
> CMAKE_CXX_COMPILER variables, but I'm concerned that doing so may mess up my
> build.
>
> I have a Linux command-line command that yields the text I want to have
> show up in CDash.  I just don't know how to safely get it there.
>
> ___
> 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] How set "Build Name" in CTest/CDash?

2010-06-21 Thread John Drescher
> The old-fashioned way of doing this is to set a BUILDNAME variable in the
> cmake cache...
>
> In your CMakeLists.txt:
> set(BUILDNAME "myBuildName" CACHE STRING "build name variable for CDash")
>
> The new-fashioned way is to set CTEST_BUILD_NAME in your ctest -S script
> prior to ctest_configure, ctest_build and ctest_submit...
> set(CTEST_BUILD_NAME "myBuildName")
>
> Where were you reading the ctest manpage that talks about setting
> CMAKE_SYSTEM and CMAKE_CXX_COMPILER variables?? What version of ctest? That
> is completely incorrect, and if it's in the official ctest documentation, we
> should fix that and remove the incorrect information. Can you please reply
> and tell me how you found this incorrect information...?
>

How would we do that for the Dashboard Fest since we should not be
messing with the CMakeLists.txt files?

I am a little confused. For my i7 CPU I do:

make clean
 ctest -j8 -D Experimental

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] One last try

2010-06-21 Thread Gerry Weaver
Hello All,


Thank you for your replies. 


The cmake command fails when trying to compile the test file. It says it cannot 
find kernel32.lib. I can compile and link without cmake just fine. Any ideas?


Thanks,
-G 


  _  

From: Bill Hoffman [mailto:bill.hoff...@kitware.com]
To: cmake@cmake.org
Sent: Mon, 21 Jun 2010 08:12:49 -0500
Subject: Re: [CMake] One last try

On 6/21/2010 3:02 AM, Gerry Weaver wrote:
  > Hello All,
  >
  ...
  > 1. Is cmake supposed to support Visual Studio 2008 out of the box?
  > 2. If not, is there support for Visual Studio 2010?
  > 3. If not, is there a patch or fix for either of the above?
  >
  > cmake 2.8.1
  > msvc 2008
  > winxp sp4
  > Nmake Makefiles
  >
  >
  1. Yes, if VS 2008 is installed correctly.
  
  First thing you should try is to build a file WITHOUT CMake:
  
  -foo.cxx
  #include 
  
  int main()
  {
 std::cout << "hello\n";
 return 0;
  }
  --
  
  Use this command line:
cl foo.cxx kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib 
  ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib
  
  If that works, then CMake should work when run FROM THAT SAME SHELL.
  
  
  If that does not work, then you have not correctly installed the SDK and 
  compiler.
  
  Are you using the Express or professional version of VS 2008?
  
  If Express, you need to follow these instructions:
  
http://blogs.msdn.com/b/windowssdk/archive/2008/02/22/using-visual-c-2008-express-with-the-windows-sdk-detailed-version.aspx
  
  Make sure you run CMake and your compiler from a shell that has all the 
  environment that cl needs to run.
  
  Please post any errors exactly as you see them and include how you setup 
  the environment for the compiler.
  
  -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
___
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 set "Build Name" in CTest/CDash?

2010-06-21 Thread Convey, Christian J CIV NUWC NWPT
> The new-fashioned way is to set CTEST_BUILD_NAME in your 
> ctest -S script prior to ctest_configure, ctest_build and 
> ctest_submit...
> set(CTEST_BUILD_NAME "myBuildName")

Can I also do this in my CMakeLists.txt file?  I guess I'm unclear on whether 
or not there aer some things that can *only* be done in the "ctest -S" script.


> 
> Where were you reading the ctest manpage that talks about 
> setting CMAKE_SYSTEM and CMAKE_CXX_COMPILER variables?? What 
> version of ctest? That is completely incorrect, and if it's 
> in the official ctest documentation, we should fix that and 
> remove the incorrect information. Can you please reply and 
> tell me how you found this incorrect information...?

I'm using CMake 2.8.0, which is what Ubuntu 9.10 supplies.


smime.p7s
Description: S/MIME cryptographic 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] One last try

2010-06-21 Thread John Drescher
On Mon, Jun 21, 2010 at 9:59 AM, Gerry Weaver  wrote:
> Hello All,
> Thank you for your replies.
> The cmake command fails when trying to compile the test file. It says it
> cannot find kernel32.lib. I can compile and link without cmake just fine.
> Any ideas?
> Thanks,
> -G

Try running the build and cmake-gui inside a "Visual Studio 2008 Command Prompt"

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] CMake 2.8.2 RC1 <-> Visual Studio Express

2010-06-21 Thread Micha Renner
Am Freitag, den 18.06.2010, 10:46 -0400 schrieb David Cole:


> 
> 
> I am guessing (hopefully you will confirm) that you are using the VS
> Express 2010 version? (As opposed to an earlier version of VS
> Express...?)
Yes, VS Express 2010 only.
> 
> 
> We fixed an issue that we reproduced using another source tree, and
> pushed the fix to CMake 'next' last night.
> 
> 
> Could you try the nightly installer found here:
> http://cmake.org/files/vCVS/cmake-2.8.1.20100617-gd2c75bd-win32-x86.exe
I installed it.
> 
> 
> And let us know if that fixes this issue for you?

Yes, excellent, these fixes work for me, but may not for you.

If you delete the content of the build directory,
run the gui-cmake version,
starts VS Express,
hit the F7-key,
then CMake rerun with the following message:
CMake is re-running because C:\Program Files\CMake 2.8\CMakeFiles
\generate.stamp dependency file is missing.
This happens only, if the contents of build directory is deleted.

As I said in one of my posts last week, I appreciate this, because it
simplifies the search for MS-libs/headers.

Greetings
Micha





___
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] Linking against boost_Test fails

2010-06-21 Thread Oswin Krause
Hello everybody,

I am currently trying to write a cmake script for my testcases. Previously i 
used a command like this:

g++ test.cpp -lboost_test_exec_monitor-mt -L/path/to/lib/ -lshark 
-I/path/to/include

and everything worked fine.
Now i'm using the following macro:

MACRO( SHARK_ADD_TEST SRC NAME)

ADD_EXECUTABLE( ${NAME}
${SRC}
)

SET( LINK_LIBRARIES
${Boost_TEST_EXEC_MONITOR_LIBRARY}
shark
)
TARGET_LINK_LIBRARIES( ${NAME} ${LINK_LIBRARIES} )

ADD_TEST( ${NAME} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Test/${NAME} )
ENDMACRO()
SHARK_ADD_TEST( LinAlg/test.cpp LinAlg_test )

And this creates the following commands:
/usr/bin/c++ -D_CRT_SECURE_NO_WARNINGS -DBOOST_ALL_DYN_LINK -I/path/to/include 
-o /some/path/test.o -c path/to/test/test.cpp

/usr/bin/c++ /some/path/test.o -o /path/to/bin -rdynamic -Wl,-Bstatic 
-lboost_test_exec_monitor-mt 
-Wl,-Bdynamic /path/to/lib/libshark.so.2.3.0 -Wl,-rpath,/path/to/lib

and the error:
undefined reference to 'boost::unit_test::unit_test_main(bool (*)(),int,char**)'

So cmake finds the correct library, but seems to link wrong.
How can i fix that?

Greetings,
Oswin Krause
___
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] Building in stages.

2010-06-21 Thread Magnus Therning
I'm looking for some suggestions on how to tackle a problem with staged
builds.

In trying to convert a project which uses omake to build OCaml files I've
stumbled on the issue that building one sub-part (bar) of the project needs
the result of another sub-part (foo).  The twist is that foo is required
already at the dependency-discovery stage of bar[1].  Is there some clever way
of working around this?

One obvious solution would be to simply skip automatic generation of
dependencies for bar, but that feels a little naughty.  It feels about as
naughty as how the previous build system just worked by ordering[2].

Hopefully there's some better way of achieving this, any suggestions?

/M

[1] For those initiated in OCaml and its tools stack the former sub-part
builds a custom filter for camlp4 which is then used in the latter sub-part.
[2] omake is very similar to make and in this case the build of foo just
happened before bar, and there was no attempt at automatic generation of
dependencies at all.
-- 
Magnus Therning(OpenPGP: 0xAB4DFBA4)
magnus@therning.org  Jabber: magnus@therning.org
http://therning.org/magnus identi.ca|twitter: magthe
___
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] Building in stages.

2010-06-21 Thread Michael Wild

> I'm looking for some suggestions on how to tackle a problem with staged
> builds.
> 
> In trying to convert a project which uses omake to build OCaml files I've
> stumbled on the issue that building one sub-part (bar) of the project needs
> the result of another sub-part (foo).  The twist is that foo is required
> already at the dependency-discovery stage of bar[1].  Is there some clever way
> of working around this?
> 
> One obvious solution would be to simply skip automatic generation of
> dependencies for bar, but that feels a little naughty.  It feels about as
> naughty as how the previous build system just worked by ordering[2].
> 
> Hopefully there's some better way of achieving this, any suggestions?
> 
> /M
> 
> [1] For those initiated in OCaml and its tools stack the former sub-part
> builds a custom filter for camlp4 which is then used in the latter sub-part.
> [2] omake is very similar to make and in this case the build of foo just
> happened before bar, and there was no attempt at automatic generation of
> dependencies at all.

Well, if you need foo to be built before bar, just use add_dependencies(bar 
foo). File-level dependency scanning happens just before bar is built, so if I 
understand your question correctly, you should be fine now...

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


[CMake] ctest meant to be re-entrant?

2010-06-21 Thread Convey, Christian J CIV NUWC NWPT
I'm having trouble getting my mind around how CTest is intended to be used.  
Could someone explain this to me?

When you embed ctest-related statements into a CMakeLists.txt file, and then 
run cmake on that file, you produce a "CTestConfig.cmake" file.  This file is 
eventually executed by "ctest".

But ctest also has the ability to run "cmake".  In the worst-case (in my mind) 
scenario, this ultimately leads to "ctest" causing the rewriting of the very 
"CTestConfig.cmake" file that it's presently executing.

Is this intended?  Or does it lie outside of the intended ways of using ctest?



smime.p7s
Description: S/MIME cryptographic 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] One last try

2010-06-21 Thread Bill Hoffman

On 6/21/2010 9:59 AM, Gerry Weaver wrote:

Hello All,

Thank you for your replies.

The cmake command fails when trying to compile the test file. It says it
cannot find kernel32.lib. I can compile and link without cmake just
fine. Any ideas?



Did you run this exact command line:

  cl foo.cxx kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib
   ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib

Again:

 Are you using the Express or professional version of VS 2008?
>
> If Express, you need to follow these instructions:
> 
http://blogs.msdn.com/b/windowssdk/archive/2008/02/22/using-visual-c-2008-express-with-the-windows-sdk-detailed-version.aspx

>
> Make sure you run CMake and your compiler from a shell that has 
all the

> environment that cl needs to run.
>

-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] Building in stages.

2010-06-21 Thread Magnus Therning
On Mon, Jun 21, 2010 at 16:10, Michael Wild  wrote:
>
>> I'm looking for some suggestions on how to tackle a problem with staged
>> builds.
>>
>> In trying to convert a project which uses omake to build OCaml files I've
>> stumbled on the issue that building one sub-part (bar) of the project needs
>> the result of another sub-part (foo).  The twist is that foo is required
>> already at the dependency-discovery stage of bar[1].  Is there some clever 
>> way
>> of working around this?
>>
>> One obvious solution would be to simply skip automatic generation of
>> dependencies for bar, but that feels a little naughty.  It feels about as
>> naughty as how the previous build system just worked by ordering[2].
>>
>> Hopefully there's some better way of achieving this, any suggestions?
>>
>> /M
>>
>> [1] For those initiated in OCaml and its tools stack the former sub-part
>> builds a custom filter for camlp4 which is then used in the latter sub-part.
>> [2] omake is very similar to make and in this case the build of foo just
>> happened before bar, and there was no attempt at automatic generation of
>> dependencies at all.
>
> Well, if you need foo to be built before bar, just use add_dependencies(bar 
> foo). File-level dependency scanning happens just before bar is built, so if 
> I understand your question correctly, you should be fine now...

No, I need foo to be built before bar is inspected to gather its
dependencies.  And dependencies for both foo and bar are gathered when
calling `cmake` to generate the Makefiles.  This is how my OCaml
support works at the moment.  If you have suggestions for how to move
the dependency generation to compile time (i.e. when calling `make`)
then I'd be very glad to hear it.  Or even better, be pointed to an
example of how to achieve that.

/M

-- 
Magnus Therning(OpenPGP: 0xAB4DFBA4)
magnus@therning.org  Jabber: magnus@therning.org
http://therning.org/magnus identi.ca|twitter: magthe
___
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 meant to be re-entrant?

2010-06-21 Thread David Cole
CTestConfig.cmake should be a source file in your source tree. Nothing
should be writing it automatically.


On Mon, Jun 21, 2010 at 11:21 AM, Convey, Christian J CIV NUWC NWPT <
christian.con...@navy.mil> wrote:

> I'm having trouble getting my mind around how CTest is intended to be used.
>  Could someone explain this to me?
>
> When you embed ctest-related statements into a CMakeLists.txt file, and
> then run cmake on that file, you produce a "CTestConfig.cmake" file.  This
> file is eventually executed by "ctest".
>
> But ctest also has the ability to run "cmake".  In the worst-case (in my
> mind) scenario, this ultimately leads to "ctest" causing the rewriting of
> the very "CTestConfig.cmake" file that it's presently executing.
>
> Is this intended?  Or does it lie outside of the intended ways of using
> ctest?
>
>
> ___
> 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] Building in stages.

2010-06-21 Thread Aeschbacher, Fabrice
I would try following in foo/CmakeLists.txt:

   add_custom_command(TARGET foo
  POST_BUILD
  COMMAND touch bar/CMakeLists.txt
   )

This will force CMake to re-build the makefiles for 'bar' (because its 
CMakeLists.txt has been modified)

And of course, add_dependencies(bar foo)

Hope it helps,
Fabrice Aeschbacher

> -Ursprüngliche Nachricht-
> Von: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] 
> Im Auftrag von Magnus Therning
> Gesendet: Montag, 21. Juni 2010 17:41
> An: Michael Wild
> Cc: Cmake Mailing List
> Betreff: Re: [CMake] Building in stages.
> 
> On Mon, Jun 21, 2010 at 16:10, Michael Wild  wrote:
> >
> >> I'm looking for some suggestions on how to tackle a 
> problem with staged
> >> builds.
> >>
> >> In trying to convert a project which uses omake to build 
> OCaml files I've
> >> stumbled on the issue that building one sub-part (bar) of 
> the project needs
> >> the result of another sub-part (foo).  The twist is that 
> foo is required
> >> already at the dependency-discovery stage of bar[1].  Is 
> there some clever way
> >> of working around this?
> >>
> >> One obvious solution would be to simply skip automatic 
> generation of
> >> dependencies for bar, but that feels a little naughty.  It 
> feels about as
> >> naughty as how the previous build system just worked by 
> ordering[2].
> >>
> >> Hopefully there's some better way of achieving this, any 
> suggestions?
> >>
> >> /M
> >>
> >> [1] For those initiated in OCaml and its tools stack the 
> former sub-part
> >> builds a custom filter for camlp4 which is then used in 
> the latter sub-part.
> >> [2] omake is very similar to make and in this case the 
> build of foo just
> >> happened before bar, and there was no attempt at automatic 
> generation of
> >> dependencies at all.
> >
> > Well, if you need foo to be built before bar, just use 
> add_dependencies(bar foo). File-level dependency scanning 
> happens just before bar is built, so if I understand your 
> question correctly, you should be fine now...
> 
> No, I need foo to be built before bar is inspected to gather its
> dependencies.  And dependencies for both foo and bar are gathered when
> calling `cmake` to generate the Makefiles.  This is how my OCaml
> support works at the moment.  If you have suggestions for how to move
> the dependency generation to compile time (i.e. when calling `make`)
> then I'd be very glad to hear it.  Or even better, be pointed to an
> example of how to achieve that.
> 
> /M
> 
> -- 
> Magnus Therning(OpenPGP: 0xAB4DFBA4)
> magnus@therning.org  Jabber: magnus@therning.org
> http://therning.org/magnus identi.ca|twitter: magthe
> ___
> 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 meant to be re-entrant?

2010-06-21 Thread Convey, Christian J CIV NUWC NWPT
Sorry, that was embarrassing.  Pretend I had said, "CTestTestFile.cmake" 
instead of "CTestConfig.cmake".

> CTestConfig.cmake should be a source file in your source 
> tree. Nothing should be writing it automatically.
> 
> 
> 
> On Mon, Jun 21, 2010 at 11:21 AM, Convey, Christian J CIV 
> NUWC NWPT  wrote:
> 
> 
>   I'm having trouble getting my mind around how CTest is 
> intended to be used.  Could someone explain this to me?
>   
>   When you embed ctest-related statements into a 
> CMakeLists.txt file, and then run cmake on that file, you 
> produce a "CTestConfig.cmake" file.  This file is eventually 
> executed by "ctest".
>   
>   But ctest also has the ability to run "cmake".  In the 
> worst-case (in my mind) scenario, this ultimately leads to 
> "ctest" causing the rewriting of the very "CTestConfig.cmake" 
> file that it's presently executing.
>   
>   Is this intended?  Or does it lie outside of the 
> intended ways of using ctest?
>   
>   
>   ___
>   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
>   
> 
> 
> 


smime.p7s
Description: S/MIME cryptographic 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] [patch] cmake-2.8.1 and png-1.4.2

2010-06-21 Thread James Bigler
On Sat, Jun 19, 2010 at 4:34 PM, Thomas Klausner  wrote:

>
> cmake didn't find the png library at all, since it was renamed
> (again). The attached patch fixes the problem, please include it in
> the next release.
>

Would a wild-card feature for the FIND_XXX functions be useful in your case?

I think I meant to file a feature request bug for this; sometimes I don't
know the exact version of the file I need to locate.

James
___
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 meant to be re-entrant?

2010-06-21 Thread David Cole
On Mon, Jun 21, 2010 at 1:18 PM, Convey, Christian J CIV NUWC NWPT <
christian.con...@navy.mil> wrote:

> Sorry, that was embarrassing.  Pretend I had said, "CTestTestFile.cmake"
> instead of "CTestConfig.cmake".
>

Well, in that case CMake writes the CTestTestFile.cmake files whenever
it configures a build tree. (So, from a ctest -S script, during the
"ctest_configure(...)" call.) The ctest executable will read the
CTestTestFile.cmake files when it needs to execute tests: when run from the
command line to execute tests, or when processing a ctest_test(...) command
in a -S script...

So again: only one writer, at one well-defined time. I don't think there
should be any problems with respect to the CTestTestFile.cmake files. The
confusion arises perhaps because ctest is used as a "simple" test driver and
also as a full configure/build/test/run-a-dashboard driver. The
CTestTestFile.cmake files are used when it is acting as a simple test
driver. You would write a script to be processed with -S, or run a -D
Nightly or -D Experimental dashboard separately: that is not connected to
the CTestTestFiles at all.

I suppose you could probably contrive a case where an executing test
actually re-configures the build tree that it is in, but I'd be surprised if
that happens in practice. If shown to be problematic, and reported with
reasonable steps to reproduce to the CMake bug tracker, we could add code to
detect such pathological cases and fail with an error...


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] ctest meant to be re-entrant?

2010-06-21 Thread Convey, Christian J CIV NUWC NWPT
>   Sorry, that was embarrassing.  Pretend I had said, 
> "CTestTestFile.cmake" instead of "CTestConfig.cmake".
>   
> 
> 
> Well, in that case CMake writes the CTestTestFile.cmake 
> files whenever it configures a build tree. (So, from a ctest 
> -S script, during the "ctest_configure(...)" call.) The ctest 
> executable will read the CTestTestFile.cmake files when it 
> needs to execute tests: when run from the command line to 
> execute tests, or when processing a ctest_test(...) command 
> in a -S script...
> 
> So again: only one writer, at one well-defined time. I don't 
> think there should be any problems with respect to the 
> CTestTestFile.cmake files. The confusion arises perhaps 
> because ctest is used as a "simple" test driver and also as a 
> full configure/build/test/run-a-dashboard driver. The 
> CTestTestFile.cmake files are used when it is acting as a 
> simple test driver. You would write a script to be processed 
> with -S, or run a -D Nightly or -D Experimental dashboard 
> separately: that is not connected to the CTestTestFiles at all.
> 
> I suppose you could probably contrive a case where an 
> executing test actually re-configures the build tree that it 
> is in, but I'd be surprised if that happens in practice. If 
> shown to be problematic, and reported with reasonable steps 
> to reproduce to the CMake bug tracker, we could add code to 
> detect such pathological cases and fail with an error...

Thanks, that does help.  Could you tell me if the following 
approach constent with what you guys intended?

I want some parts of "CTestTestfile.cmake" to be automatically generated from 
the CMakeLists.txt files in my source directory tree.

OTOH, I also want to supply some additional information ctest.  For example, 
'set(CTEST_BUILD_NAME "myBuildName")'.

So I do this:

1. Have a permanent (e.g., non-generated) file 
   "MyCTestScript.cmake" with the following content:

   INCLUDE("CTestTestfile.cmake")
   SET(CTEST_BUILD_NAME "myBuildName")

2. When I want to run tests, I use this command:
   ctest -s MyCTestScript.cmake -D Nightly

- Christian


smime.p7s
Description: S/MIME cryptographic 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] One last try

2010-06-21 Thread Gerry Weaver
Hello All,


I think I have found the issue. When I ran cmake-gui (I never have before), it 
had a dll issue. When I copied the dll from another system, everything started 
working. I'm not sure what happened here as this was a fresh windoze install, 
but it seems to work now. It's odd that only cmake-gui exposed the issue. I'm 
gonna have to consider replacing this system. Who knows what other little 
issues are lurking about. Anyway, running cmake-gui was a good call.


I appreciate everyone's help on this very much. Have a great day!


Thanks,
-G___
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] Variable Propagation

2010-06-21 Thread Alexander Neundorf
On Monday 14 June 2010, Tyler Roscoe wrote:
> On Mon, Jun 14, 2010 at 01:40:38PM +0200, Aeschbacher, Fabrice wrote:
> > > > I need to provide easy adding for source files to the developers,
> > > > So it would be nice to just have a CMakelists.txt in every
> > >
> > > subfolder,
> > >
> > > > which then edits the source-variable.
> > >
> > > Also consider to use properties for such a purpose.
> >
> > Which property do you actually think about?
>
> You can set arbitrary properties (MY_MAGIC_PROPERTY) and query them
> later. I think this is what Michael meant.

... must be a GLOBAL property.

Alex
___
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] Variable Propagation

2010-06-21 Thread Alexander Neundorf
On Sunday 13 June 2010, C. Meissa wrote:
> Hello list,
>
> A varible ${var1} can be accessed in any subdirectory’s
> CMakeLists.txt.
> However, if those files change ${var1} these changes are not
> accessible from the directory above.
>
> Is there any possibility of getting this done, anyway?
> I need to provide easy adding for source files to the developers,
> So it would be nice to just have a CMakelists.txt in every subfolder,
> which then edits the source-variable.

What I did once in such a case was to put files named "SourceFiles.txt" in 
every directory with source files, which just had a set() command for the 
source files, and this file was then include()d by the respective 
CMakeLists.txt.
This way the other developers didn't have to edit the actual CMakeLists.txt, 
but only these files which were *very* simple.

Alex
___
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] Converting a OpenCL program into a C++ header?

2010-06-21 Thread Alexander Neundorf
On Wednesday 16 June 2010, David Cole wrote:
> This script will work for your simple input. It will require extra escaping
> work if you need to embed double quotes or backslashes.

Another idea would be to convert it to something like
const char code[] = {0x5f, 0x5f, 0x6b, 0x65, }

then you don't have to care about the escaping.
Just... I think in cmake it is not possible to access single characters in a 
string maybe except a regexp which matches always the first character and 
remove it afterwards (...probably the slowest way at all to do this)

Or write a tiny C program which does that translation for you and execute it 
via add_custom_command().

Alex
___
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 against boost_Test fails

2010-06-21 Thread Michael Hertling
On 06/21/2010 04:53 PM, Oswin Krause wrote:
> Hello everybody,
> 
> I am currently trying to write a cmake script for my testcases. Previously i 
> used a command like this:
> 
> g++ test.cpp -lboost_test_exec_monitor-mt -L/path/to/lib/ -lshark 
> -I/path/to/include
> 
> and everything worked fine.
> Now i'm using the following macro:
> 
> MACRO( SHARK_ADD_TEST SRC NAME)
> 
> ADD_EXECUTABLE( ${NAME}
> ${SRC}
> )
> 
> SET( LINK_LIBRARIES
> ${Boost_TEST_EXEC_MONITOR_LIBRARY}
> shark
> )
> TARGET_LINK_LIBRARIES( ${NAME} ${LINK_LIBRARIES} )
> 
> ADD_TEST( ${NAME} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Test/${NAME} )
> ENDMACRO()
> SHARK_ADD_TEST( LinAlg/test.cpp LinAlg_test )
> 
> And this creates the following commands:
> /usr/bin/c++ -D_CRT_SECURE_NO_WARNINGS -DBOOST_ALL_DYN_LINK 
> -I/path/to/include -o /some/path/test.o -c path/to/test/test.cpp
> 
> /usr/bin/c++ /some/path/test.o -o /path/to/bin -rdynamic -Wl,-Bstatic 
> -lboost_test_exec_monitor-mt 
> -Wl,-Bdynamic /path/to/lib/libshark.so.2.3.0 -Wl,-rpath,/path/to/lib
> 
> and the error:
> undefined reference to 'boost::unit_test::unit_test_main(bool 
> (*)(),int,char**)'
> 
> So cmake finds the correct library, but seems to link wrong.
> How can i fix that?

Usually, this means you have a reference of your libshark.so.2.3.0 to
libboost_test_exec_monitor-mt.a, but in this case, your manually set up
link line wouldn't work, too, so are you sure that line works as you've
presented it, i.e. with -lboost_test_exec_monitor-mt before -lshark?
Does SET(LINK_LIBRARIES shark ${Boost_TEST_EXEC_MONITOR_LIBRARY}),
i.e. shark-before-boost, work?

Another potential cause for such incidents is the use of different C++
compiler versions, so do you have multiple compilers installed, or do
you have multiple Boost installations, and how does libshark.so.2.3.0
get built?

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] Link order of object files

2010-06-21 Thread Alexander Neundorf
On Monday 21 June 2010, Mathias Lafeldt wrote:
> Hi,
>
> is there a way to tell CMake in which order to link in object files?
>
> For example, I got the following executable:
>
>   ADD_EXECUTABLE(hello crt0.o hello.c)
>
> Using a disassembler, I can see that hello.c is compiled in before
> crt0.o, but I want crt0.o to always be the first.
>
> Also, this gives me the same result:
>
>   ADD_EXECUTABLE(hello hello.c crt0.o)

Is this for some embedded system ?
You may consider putting crt0.o in the CMAKE_C_LINK_EXECUTABLE variable for 
your target.

Alex
___
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] Eclipse Galileo and CDT version 6.0.2

2010-06-21 Thread Alexander Neundorf
On Friday 11 June 2010, Hugh Sorby wrote:
> I am attempting to use Eclipse Galileo with CDT version 6.0.2 on windows
> 7 to do software development on.  But I am unable to build the
> software.  I am getting the following message in the console window in
> Eclipse.

Which version of cmake are you using ?

> Error launching builder (nmake all )
> (Cannot run program "nmake": Launching failed)
>
> Consequently nothing gets built.  Can anyone give me pointers as to what
> might be going wrong.

Hmm, this is when trying to build one of the targets created in the target-tab 
of Eclipse, right ?
These are generated by cmake and usually they should contain the full path to 
the (n)make.

Does nmake itself need to find any special dll's when executed ?
I mean, is the problem that nmake is not found or that nmake doesn't find some 
dlls it needs ?

Alex
___
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] How to copy directory as part of custom target, filtering out .svn dirs?

2010-06-21 Thread Rick Gould
I'm looking to install a directory as part of a custom target, but
exclude all the Subversion .svn directories.

Both of the the following work, but run as part of the "make install"
target, which I don't want:

   install( DIRECTORY ${source_dir}
  DESTINATION ${destination_dir}
  PATTERN .svn EXCLUDE
   )

   file( COPY ${source_dir}
  DESTINATION ${destination_dir}
  PATTERN .svn EXCLUDE
   )


The following would work, if there was a way to exclude .svn dirs as
part of the copy_directory:

   add_custom_command(
  OUTPUT  ${destination_dir}
  COMMAND ${CMAKE_COMMAND} -E copy_directory ${source_dir}
${destination_dir}
   )


Any suggestions?

Thanks very much!

 - Rick Gould

r...@transpireinc.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] Linking against boost_Test fails

2010-06-21 Thread Oswin Krause
>On 06/21/2010 04:53 PM, Oswin Krause wrote:
>> Hello everybody,
>> 
>> I am currently trying to write a cmake script for my testcases. Previously i 
>> used a command like this:
>> 
>> g++ test.cpp -lboost_test_exec_monitor-mt -L/path/to/lib/ -lshark 
>> -I/path/to/include
>> 
>> and everything worked fine.
>> Now i'm using the following macro:
>> 
>> MACRO( SHARK_ADD_TEST SRC NAME)
>> 
>> ADD_EXECUTABLE( ${NAME}
>> ${SRC}
>> )
>> 
>> SET( LINK_LIBRARIES
>> ${Boost_TEST_EXEC_MONITOR_LIBRARY}
>> shark
>> )
>> TARGET_LINK_LIBRARIES( ${NAME} ${LINK_LIBRARIES} )
>> 
>> ADD_TEST( ${NAME} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Test/${NAME} )
>> ENDMACRO()
>> SHARK_ADD_TEST( LinAlg/test.cpp LinAlg_test )
>> 
>> And this creates the following commands:
>> /usr/bin/c++ -D_CRT_SECURE_NO_WARNINGS -DBOOST_ALL_DYN_LINK 
>> -I/path/to/include -o /some/path/test.o -c path/to/test/test.cpp
>> 
>> /usr/bin/c++ /some/path/test.o -o /path/to/bin -rdynamic -Wl,-Bstatic 
>> -lboost_test_exec_monitor-mt 
>> -Wl,-Bdynamic /path/to/lib/libshark.so.2.3.0 -Wl,-rpath,/path/to/lib
>> 
>> and the error:
>> undefined reference to 'boost::unit_test::unit_test_main(bool 
>> (*)(),int,char**)'
>> 
>> So cmake finds the correct library, but seems to link wrong.
>> How can i fix that?
>
>Usually, this means you have a reference of your libshark.so.2.3.0 to
>libboost_test_exec_monitor-mt.a, but in this case, your manually set up
>link line wouldn't work, too, so are you sure that line works as you've
>presented it, i.e. with -lboost_test_exec_monitor-mt before -lshark?
Yes, it is exactly this:
g++ cblnsrch.cpp -lboost_test_exec_monitor-mt 
-L/home/oswin/Projekte/Shark/shark-project/branches/SharkReworkBoostRng/Shark/lib/
 -lshark 
-I/home/oswin/Projekte/Shark/shark-project/branches/SharkReworkBoostRng/Shark/include/

But there is  currently no dependency between shark and boost, so the order 
shouldn't make a difference.

>Does SET(LINK_LIBRARIES shark ${Boost_TEST_EXEC_MONITOR_LIBRARY}),
>i.e. shark-before-boost, work?
Same result, unfortunately.

>
>Another potential cause for such incidents is the use of different C++
>compiler versions, so do you have multiple compilers installed, or do
>you have multiple Boost installations, and how does libshark.so.2.3.0
>get built?
I'm building the tests with the same cmake Script as i'm currently trying to 
build the Tests.
I checked the gcc versions. My gcc was quite old, 4.4.1 and boost was build 
with 4.4.3. But updating gcc to 4.4.5 didn't help either.
And both are now the newest version of my distribution. 
>
>Regards,
>
>Michael
Thanks for your tips.

Regards,
Oswin
___
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 meant to be re-entrant?

2010-06-21 Thread Convey, Christian J CIV NUWC NWPT
> David is right; it's confusing because ctest can be used in 
> several different ways. I think it's actually much worse than 
> he says, because as far as I can tell, ctest can be used in 
> four completely different and mutually incompatible ways, 
> each with their own idiosyncrasies. To make things worse, two 
> of the ways are actually invoked with the same arguments!

Thanks, actually I'm really glad you wrote all that [snipped] stuff.  I was 
starting to think I was being uniquely moronic for having trouble figuring out 
ctest.  You confirmed that it really is pretty complicated in its current 
incarnation.  My self-respect is now partially restored.

- Christian


smime.p7s
Description: S/MIME cryptographic 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] ctest meant to be re-entrant?

2010-06-21 Thread Chris Hillery
On Mon, Jun 21, 2010 at 10:53 AM, Convey, Christian J CIV NUWC NWPT <
christian.con...@navy.mil> wrote:

> Thanks, that does help.  Could you tell me if the following
> approach constent with what you guys intended?
>
> I want some parts of "CTestTestfile.cmake" to be automatically generated
> from the CMakeLists.txt files in my source directory tree.
>
> OTOH, I also want to supply some additional information ctest.  For
> example, 'set(CTEST_BUILD_NAME "myBuildName")'.
>
> So I do this:
>
> 1. Have a permanent (e.g., non-generated) file
>   "MyCTestScript.cmake" with the following content:
>
>   INCLUDE("CTestTestfile.cmake")
>   SET(CTEST_BUILD_NAME "myBuildName")
>
> 2. When I want to run tests, I use this command:
>   ctest -s MyCTestScript.cmake -D Nightly
>
>
I don't think that looks right. CTestTestfile.cmake is an internal,
generated file; I can't think of any circumstance where you'd want to be
including it directly. It is used *by* ctest to determine what tests to run,
but it is not a "ctest script".

I also don't think (although I'm less sure) that you can use both -S and -D
on the command line at the same time. They're exclusive options.

David is right; it's confusing because ctest can be used in several
different ways. I think it's actually much worse than he says, because as
far as I can tell, ctest can be used in four completely different and
mutually incompatible ways, each with their own idiosyncrasies. To make
things worse, two of the ways are actually invoked with the same arguments!

1. "ctest" by itself (when run from a binary directory) serves as a simple
test harness. It executes test cases previously configured by cmake and
reports on the results.

2. "ctest -D" serves as an "automatic dashboard". The term "dashboard",
IMHO, is a terrible one, but what it means is that it will perform a
pre-programmed set of operations, chosen from the set of Update, Configure,
Build, Test, Coverage, and Submit (upload results to a dashboard). The set
of operations it performs, and some details about how they are performed, is
determined by the parameter to -D: Experimental, Continuous, Nightly. You
have some amount of control over which steps get run using the -T option.

3. "ctest -S" can run a simple CTest script, which is basically a
"semi-automatic dashboard". In this kind of script (sometimes called
"old-style ctest script", you can set up some variables to modify how the
dashboard process is run. This is, again IMHO, a badly thought-out feature,
because it still does a lot of things automatically and the variables which
you can set to modify the behaviour are quirky and poorly-documented. It
really is in no meaningful sense a "script".

4. Finally, "ctest -S" can also run a "new-style CTest script". In this kind
of script, you have complete control over what happens - you don't even have
to "run a dashboard", but can do pretty much anything you want in whatever
order you want. The magic which makes a script a "new-style CTest script" is
that it uses the functions ctest_start(), ctest_configure(), etc.


Anyway, that was probably a lot more than you wanted to know at this time,
but hopefully it will serve some value in future. Meanwhile, I suspect
there's probably a straightforward way to do what you actually want to do,
I'm just afraid I don't know what it is that you want to do. :)

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] ctest meant to be re-entrant?

2010-06-21 Thread Chris Hillery
On Mon, Jun 21, 2010 at 4:47 PM, Convey, Christian J CIV NUWC NWPT <
christian.con...@navy.mil> wrote:

> > David is right; it's confusing because ctest can be used in
> > several different ways. I think it's actually much worse than
> > he says, because as far as I can tell, ctest can be used in
> > four completely different and mutually incompatible ways,
> > each with their own idiosyncrasies. To make things worse, two
> > of the ways are actually invoked with the same arguments!
>
> Thanks, actually I'm really glad you wrote all that [snipped] stuff.  I was
> starting to think I was being uniquely moronic for having trouble figuring
> out ctest.  You confirmed that it really is pretty complicated in its
> current incarnation.  My self-respect is now partially restored.
>
> - Christian
>

Nope, you're not unique. :) CTest, and CMake too, do a lot of really neat
things and they do a lot of them really well. At the same time, it's
extremely clear that many of their facilities accreted over time as they
were needed, not with any overarching design goal in mind. The barrier to
entry for newcovers thus unfortunately grows ever taller.

But, back to the original subject, if you can re-state what your goal is a
little bit, hopefully we can figure out a way to get you there.

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] ctest meant to be re-entrant?

2010-06-21 Thread Convey, Christian J CIV NUWC NWPT
> But, back to the original subject, if you can re-state what 
> your goal is a little bit, hopefully we can figure out a way 
> to get you there.

Thanks very much.  It's maybe more than can/should be done using "ctest".  That 
is, some shell scripting might be in order as well...


I have a CDash server set up.  Every night, shortly after midnight, I want a 
bunch of build machines, running various operating systems, to build and test 
the software, and report their results to CDash.  

My project consists of two, somewhat-related bodies of source code: MOOS and 
IVP.  Each has its own CMake-based build system.  Each comes with a shell 
script that invokes "cmake" with some options, and then "make".  The options 
supplied to cmake like CMAKE_BUILD_TYPE, CMAKE_CXX_FLAGS_RELEASE, and some 
application-specific CMake variables.  

If possible, I'd like to ensure that when ctest invokes cmake, the CMake 
variables mentioned above end up with the same values as they would have if the 
shell scripts mentioned above had been used to kick of cmake.  This is a 
relatively low-priority requirement, but it would be nice.

To date I've been ignoring MOOS with regards to CTest.  I do have to build MOOS 
prior to building IVP, but I wanted to keep things simple for now and just 
focus on ctest'ing IVP.

Since MOOS and IVP are in separate source trees and are built at separate 
times, I have no expectation that their building / testing results can end up 
in the same CDash dashboard.  But it would be awfully nice if they did, because 
we really see them as two parts of the same product.  It's only an accident of 
nature that they're not part of the very same CMake build tree.

Furthermore, I want a shell command that I've designed to decide, for each 
build, what appears in CDash's "Build Name" column.  I want this because 
"Linux-c++" doesn't sufficiently differentiate the various build platforms I'm 
using.

If possible, I'd like the CDash report to include a mention of how the 
sourcecode checkout went.  If the sourcecode checkout fails, I'd like CDash to 
show that, rather than just having no report from the client that had the 
problem.

I want a fresh checkout of the source code each time I do this.  Merely 
updating it isn't clean enough.  Also, I'm using svn.

I'd like to continue specifying my tests by having "ADD_TEST(...)" calls 
sprinkled throughout my project's CMakeLists.txt files.




smime.p7s
Description: S/MIME cryptographic 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] ctest meant to be re-entrant?

2010-06-21 Thread Chris Hillery
>
> Thanks very much.  It's maybe more than can/should be done using "ctest".
>  That is, some shell scripting might be in order as well...
>

Well, I can tell you that all of what you want and more are completely
possible using CMake/CTest alone, because I'm doing everything you list
below already. :)

I'm going to slightly re-order some of your requests below, just FYI.

I have a CDash server set up.  Every night, shortly after midnight, I want a
> bunch of build machines, running various operating systems, to build and
> test the software, and report their results to CDash.
>
>
Yep, I'm doing this, with the added excitement that the various OS and
test-suite configurations are brought up on Amazon Elastic Compute Cloud
virtual machines. (Automating that was not as easy as I would have liked, I
can tell you.)


If possible, I'd like to ensure that when ctest invokes cmake, the CMake
> variables mentioned above end up with the same values as they would have if
> the shell scripts mentioned above had been used to kick of cmake.  This is a
> relatively low-priority requirement, but it would be nice.
>

What I think you need to accomplish all of what you want is to create a
"new-style" ctest script. When used in this way, ctest really is a full
scripting language, with the added benefits of being fully cross-platform
and integrated with cmake.

IMHO, this is amongst the very best features of cmake/ctest. It's
unfortunately also one of the least well-documented. The best documentation
I'm aware of at the moment is this page:

  http://www.cmake.org/Wiki/CTest:Using_CTEST_and_CDASH_without_CMAKE

which is not somewhere it would ever occur to you to look because you ARE
using CMake, but there it is. If you ignore the stuff about
CTestTestfile.cmake (which cmake will generate for you) and the callouts to
execute_process(), it covers most of what you need to know.

To start with, create a baseline ctest script, which explicitly does the
same steps that ctest -D does implicitly. It will look something like this:

set (CTEST_SOURCE_DIRECTORY "/path/to/sourcecode")
set (CTEST_BINARY_DIRECTORY "${CTEST_SOURCE_DIRECTORY}/build")
ctest_start (Nightly)
ctest_update (SOURCE "${CTEST_SOURCE_DIRECTORY}")
ctest_configure (BUILD "${CTEST_BINARY_DIRECTORY}")
ctest_build(BUILD "${CTEST_BINARY_DIRECTORY}")
ctest_test(BUILD "${CTEST_BINARY_DIRECTORY}")
ctest_submit ()

(Note: this depends on the source code already having been checked out from
svn. The URL I listed above has some instructions about configuring it to do
the initial checkout automatically, but that's something to add a bit later
when the basics are working.)


My project consists of two, somewhat-related bodies of source code: MOOS and
> IVP.  Each has its own CMake-based build system.  Each comes with a shell
> script that invokes "cmake" with some options, and then "make".  The options
> supplied to cmake like CMAKE_BUILD_TYPE, CMAKE_CXX_FLAGS_RELEASE, and some
> application-specific CMake variables.
>
>
You should be able to specify those variables in your ctest script, before
any of the ctest_*() commands are used. If the flags and variables are
different in various configurations, then I'd suggest the following: First,
create simple .cmake files with a complete set of variables in it. For
instance, create Debug-linux.cmake with

 set (CMAKE_BUILD_TYPE "Debug")
 set (CMAKE_CXX_FLAGS_DEBUG "...whatever...")

Put all of those .cmake files in a subdirectory next to your ctest script
called "conf", and then put the following at the top of your ctest script:

include ("${CTEST_SCRIPT_DIRECTORY}/conf/${CTEST_SCRIPT_ARG}")

Now, to run the "Debug-linux" configuration, you can invoke your script
(from cron or whatever) as

  ctest -S /path/to/script.cmake,Debug-linux

(Aside: this is the only way I know to pass variables to a ctest script; -D
doesn't work because it's used for Dashboards. Basically, whatever you put
after a comma in the -S argument to ctest will be made available to the
ctest script as CTEST_SCRIPT_ARG. It's ugly, but it gets the job done. Oh,
and CTEST_SCRIPT_DIRECTORY is set to the directory of the ctest script
itself.)


>
> To date I've been ignoring MOOS with regards to CTest.  I do have to build
> MOOS prior to building IVP, but I wanted to keep things simple for now and
> just focus on ctest'ing IVP.
>
> Since MOOS and IVP are in separate source trees and are built at separate
> times, I have no expectation that their building / testing results can end
> up in the same CDash dashboard.  But it would be awfully nice if they did,
> because we really see them as two parts of the same product.  It's only an
> accident of nature that they're not part of the very same CMake build tree.
>

There's no reason that two different products can't submit to the same CDash
project. Just specify the same CDash URL in your CTestConfig.cmake.

When you've gotten things working the way you want, you may want to read
this:

  CDash subprojects... 

[CMake] Searching the mailing list archives

2010-06-21 Thread Philip Boltt




Hi,
 
Is there a way to search the entire mailing list archive?  The archive
link (http://www.cmake.org/pipermail/cmake/) goes to a page that seems
to require going into each month individually and searching the thread
subjects?

Thanks,
Phil


___
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] Searching the mailing list archives

2010-06-21 Thread Michael Hertling
On 06/22/2010 05:51 AM, Philip Boltt wrote:
> Hi,
> 
> Is there a way to search the entire mailing list archive? The archive link 
> (http://www.cmake.org/pipermail/cmake/) goes to a page that seems to require 
> going into each month individually and searching the thread subjects?



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