Re: [CMake] Fwd: setting environment variable through cmake

2009-02-17 Thread Bill Hoffman

Bill Hoffman wrote:

Philip Lowman wrote:


I've reopened this feature request as a bug because
1.) using ctest does not work
2.) the ENVIRONMENT test property is not documented

Discovered both of these issues tonight after looking into Ankit's 
request and vaguely recalling this being implemented in CVS.


http://public.kitware.com/Bug/view.php?id=7885



I have closed the bug.  This is a new feature, and it will be in 2.8 
when that comes out.




Too hasty...   Sorry I did not read the bug report fully.  We will get 
the docs into CVS CMake, and I suspect you are running the wrong ctest.


-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] open source project for CMake ports?

2009-02-17 Thread Bill Hoffman

Philip Lowman wrote:



For the first cut I think starting out with keeping the CMakified 
sources in the project would be fine.  Many people are never going to 
want anything more complicated than this and we know that this will at 
least work for now.


CMake can already untar with -E mode.  Adding download support wouldn't 
be too bad.  Not sure how you would handle patching though.  A nicer 
solution than above would be storing the original tarball + patch in the 
CM of your project and then having CMake untar + apply it at configure 
time.  Then you could optionally add download support on top of that for 
anyone that wants the ability of their project to properly to build to 
depend on some server out there in the cloud (not me).




In CVS CMake the file command can download files already (file 
DOWNLOAD).  We are working on some projects that will need to do things 
like this at Kitware.  There is also a bug here:


http://public.kitware.com/Bug/view.php?id=8471

It somewhat relates to this issue.

-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] open source project for CMake ports?

2009-02-17 Thread Bill Hoffman

Patrick Spendrin wrote:


Does this sound interesting?

Yes.
As I am maintaining patches for some libraries and working for some 
others, it would be nice to have such a unified system to keep doubled 
work amount low.

This has some more points:
We would not have to maintain our patches in our own sources anymore, 
they can easily be used  taken by everybody else too, without searching 
to much.
As it would be of great use for us, I would rather want to start it 
today than tomorrow.
I can try to order the patches we do maintain so they can be integrated 
later on.


--
Philip Lowman

regards,
Patrick

p.s.: you made my day ;-)





Also, it would be really great if we setup a dashboard for this project. 
 I am thinking it could all be checked out and built on a variety of 
compilers/OS's nightly.


-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] open source project for CMake ports?

2009-02-17 Thread Bill Hoffman

Aaron Turner wrote:

Trying to get up to speed on this thread- apologies if I missed this.

Long story short, as an OSS developer and new Cmake user, I'm less
interested in getting libfoo building with Cmake and a lot more
interested in CMake modules for detecting and using libfoo in my own
project.  In reality, these are very much interrelated, but let me
explain

A lot of the things I take for granted in Autotools requires me to
roll my own in Cmake; which when you have a number of dependencies is
daunting when you consider all the issues with different platforms 
library versions.  I think this is one of the biggest roadblocks for
people to switch to Cmake- knowing that they're leaving behind years
of tribal knowledge which has been created in Autoconf scripts.

If there was an equivalent of the Autoconf Macro Archive
(http://autoconf-archive.cryp.to/) for Cmake, which was a collection
of common tests I think that would help a great deal.  Obviously,
Cmake already includes some of these sorts of tests for GUI toolkits
and libraries of that nature, but obviously there are a lot of obvious
holes in the list (gmp, pcre, (win)pcap, etc).  Also there are a
number of system capability tests missing like checking for strictly
aligned memory.

I'm currently having to write modules for a number of these cases and
it's a lot of work.  Honestly, it is more work then just porting my
code from Autotools to Cmake because I'm already an expert on my code
and how it compiles- trying to become an expert on these other
libraries and systems is a lot more effort.

Honestly, I think in the long run, improving the existing standard
library of Cmake modules to allow developers to concentrate on how to
build their own code rather then figure out how to link to various
libraries and write portability tests will win grow the Cmake user
base much faster.

That is really a separate issue.  The Modules directory in CMake is 
addressing that, and I think there is a google code project that has 
some CMake find stuff as well.  The problem this is addressing is an 
easy way to build some libraries that maybe difficult to currently build 
 on windows.  I think that was at the start of the thread.  For linux 
and other Unix like platforms ./configure; make; make install, then run 
cmake and have it find the installed stuff works great.  For windows 
this requires cygwin, and lots of work.  If the projects had cmake files 
the build on windows would be much easier, and by using add_subdirectory 
the projects are easy to build.


But a http://autoconf-archive.cryp.to/ type archive for CMake modules 
would also be a good idea.


-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] open source project for CMake ports?

2009-02-17 Thread Bill Hoffman

BRM wrote:

I read through this thread, and I think there may be a better route -

Instead of trying to create all kinds of patches, etc; why not make a 
simple tool to convert an autotool project to CMake and vice-versa? 
Perhaps call it 'autotool2cmake'?


This way, the process becomes simpler:

1) Download source
2) Run tool to convert to CMake (or vice versa)
3) Compile on



Sounds good, but I don't think it would be possible to write a 
translator that worked.  A tool might be able to get 90% of the projects 
95% of the way there, but I don't think you could have a tool that 
worked 100% of the way from an arbitrary autotools project to a cmake 
project.  BTW, this discussion has been on this list before... :)


But, hey, if you can prove me wrong and create the perfect translator, I 
would be happy to use/promote it... :)


-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] open source project for CMake ports?

2009-02-17 Thread Bill Hoffman

Eric Noulard wrote:

2009/2/16 Bill Hoffman bill.hoff...@kitware.com:

Philip Lowman wrote:

A tertiary goal would be convincing the 3rd party dependencies to switch
to CMake for their native build systems.


I don't really like the propaganda idea :-)

Particularly for Open Source projects.

Open Source is about choice and openess.


Of course they would have a choice, we just want to make it an easy one.


I don't want to contribute to a voluntary CMake conversion.
However I'll be glad (as usual) to help anyone requesting for help with CMake.


Not quite sure what you are trying to say here???


Does this sound interesting?


I think it might be more interesting to start a campaign to push the cmake
files into those projects.


If someone propose the cmake files to the project it's different, it's a
potential project contribution :-)
That is what we are talking about here.  If we had a set of cmake files 
for various projects, it would be that much easier for a project to pick 
up cmake.



Why shouldn't jpg,tiff,zlib, and friends not ship with good cmake files.


Because may be currently they don't need it?

They do, they just do not know it yet. :)  If it was easy to build those 
packages or find them prebuilt on windows and other systems except for 
Linux distros that include them, we would not be having this conversation.

I guess if something like what you suggest was
created, it might push the developers of those projects to accept the CMake
files to avoid the partial fork in the project...


I'm not so sure that a project woul'd be forked because its build system
is not cmake, even if valuable cmake user do fork because they need
a cmake-ified version of the project.

I am pretty sure it would be a mini-fork of sorts.  There will be minor 
fixes for warnings and other issues found by using a new set of compilers.

My 2 cents about freedom.

No one is talking about taking away freedom here.  We are just talking 
about a strategy that will make it much easier to build software cross 
platform.   For any of us to devote time to this effort the potential up 
side should be worked out.  I see them as this:


1.  Provide an easy way to incorporate some common libraries into CMake 
based projects.

2.  Increase the usage and user base of CMake.
3.  If the cmake build system is accepted upstream, then that is one 
less package that this group would have to maintain.


We are talking about freedom here.  The freedom to build software with 
the compiler, OS, and tool chain of your choice.  :)


-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] 64bit linking on linux

2009-02-18 Thread Bill Hoffman

Birju Prajapati wrote:
I’ve figured it out. I added the following lines into the root 
CMakeLists.txt file:


 


SET(CMAKE_CXX_FLAGS -m64)

SET(CMAKE_C_FLAGS -m64)

SET(CMAKE_EXE_LINKER_FLAGS -m64)

SET(CMAKE_MODULE_LINKER_FLAGS -m64)

SET(CMAKE_SHARED_LINKER_FLAGS -m64)

 


That is not the preferable way to do this.  As it hard codes flags into 
the CMake file.  The way I would do it is:


export CXXFLAGS=-m64
export CFLAGS=-m64
export LDFLAGS=-m64

cmake ../myproject

If those environment variables are set BEFORE you run cmake, then cmake 
will put them into the cache correctly.


-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] warning safe linker search path

2009-02-18 Thread Bill Hoffman

John Biddiscombe wrote:

Brad

OK. I'm using 2.6.2 I'll let you know if the problem continues with 
2.6.3 or later (won't try it right away because I don't want to force a 
rebuild of anything just now - but soon)




Changing from 2.6.2 to 2.6.3 should not trigger a full rebuild... 
However, if it does, I will accept no blame...  :)


-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] cmake is reruning on rebuild

2009-02-18 Thread Bill Hoffman

David Cole wrote:
Just use Build Solution. Rebuild Solution causes *all* build steps 
everywhere to re-run, even when nothing has changed, including the ones 
that re-run cmake if a CMakeLists.txt file changes.


If you want to start over entirely (effective Rebuild Solution) then 
wipe your binary tree entirely, re-run CMake to generate a new solution 
file and open that solution and do Build Solution.




This might be an issue:
add_subdirectory(../A ${CMAKE_BINARY_DIR})

That really should be:

add_subdirectory(../A A_build)

I have seen an issue where cmake writes two conflicting build files into 
that directory.   ${CMAKE_BINARY_DIR} will automatically be added to 
A_build anyway.



-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] Creating a library

2009-02-18 Thread Bill Hoffman

David Doria wrote:

If I have many executables in the same project (ie same CMakeLists.txt
file), it seems like I shouldn't have to do this:

set(Sources File1.cpp File1.cpp )

ADD_EXECUTABLE(Test1 Test1.cpp ${Sources})

ADD_EXECUTABLE(Test2 Test2.cpp ${Sources})

because it is compiling File1 and File2 twice when that is unnecessary.

So I tried to do this:

ADD_LIBRARY(MyLibs ${Sources})

ADD_EXECUTABLE(Test1 Test1.cpp)
TARGET_LINK_LIBRARIES(Test1 ${MyLibs})

ADD_EXECUTABLE(Test2 Test2.cpp)
TARGET_LINK_LIBRARIES(Test2 ${MyLibs})

But I get a whole bunch of linker errors - Undefined reference to ...

Have I done something wrong / how would I do this?


This should fix your problem:

TARGET_LINK_LIBRARIES(Test2 MyLibs)

-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] 64bit linking on linux

2009-02-18 Thread Bill Hoffman

Aaron Turner wrote:




That is not the preferable way to do this.  As it hard codes flags into the
CMake file.  The way I would do it is:

export CXXFLAGS=-m64
export CFLAGS=-m64
export LDFLAGS=-m64

cmake ../myproject

If those environment variables are set BEFORE you run cmake, then cmake will
put them into the cache correctly.


Couldn't you use the check_c_source_runs() macro to test if your
system supports the -m64 flag?  That way you wouldn't need to require
the user to specify it (always fraught with peril).


You could if you always wanted a 64 bit app.  It is really up to the 
project.


-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] CMake: use new curl

2009-02-19 Thread Bill Hoffman

Steven Van Ingelgem wrote:

Hi all,


How can I (on windows) do the following:

cmake .. -DCMAKE_USE_NEW_CURL=1

It always results in an error (upon compilation)?
Scanning dependencies of target cmcurl


The new curl is currently untested.  So, to avoid the error, don't try 
to use it.


-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] Generator for Visual Studio 2008 with Intel C++ 11.0?

2009-02-19 Thread Bill Hoffman

jessepe...@gmail.com wrote:
  The real solution is to create a new sub-class of the visual studio 
generator for the intel compiler, or maybe it is just a flag on the 
existing generator.  Calling ICProjConvert seems like a bad idea, and I 
would not accept a generator based on that solution into CMake.


Fair enough. I won't spend much time getting this stuff working well, 
and you wouldn't want any of my lousy code anyways. But for a temporary 
hack that runs this the ICProjConvert automatically at the end of using 
the Visual Studio generator, how would I hook this into my cmakelists?




I don't think there is a good way to do this from the cmakelists...

You could do it as an outside .bat file that runs cmake, then 
ICProjConvert perhaps...


-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] Setting MemoryCheckCommand in extended Ctest scripts

2009-02-22 Thread Bill Hoffman

Bartlett, Roscoe A wrote:

Hello,
 
I am trying to get memory checking to work in an extended Ctest script 
that calls ctest_memcheck(...).  However, when I do I get the error message:
 
 
 
SetCTestConfiguration:BuildDirectory:/home/rabartl/PROJECTS/dashboards/Trilinos.base/SERIAL_DEBUG/BUILD

SetCTestConfiguration:SourceDirectory:/home/rabartl/PROJECTS/dashboards/Trilinos.base/SERIAL_DEBUG/Trilinos
Memory check project 
/home/rabartl/PROJECTS/dashboards/Trilinos.base/SERIAL_DEBUG/BUILD
Memory checker (MemoryCheckCommand) not set, or cannot find the 
specified program.
 
 
 
I have set the cache variable MEMORYCHECK_COMMAND as shown by:
 
 
$ grep ^MEMORYCHECK_COMMAND:FILEPATH CMakeCache.txt

MEMORYCHECK_COMMAND:FILEPATH=/usr/bin/valgrind
 
 
I also tried setting this variable in the Ctest script itself.
 
How can I set this command?
 

Here is an example of a working script that does memory checking:

http://www.cdash.org/CDash/viewNotes.php?buildid=276858

-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


[CMake] CMake 2.6.3 available for download

2009-02-23 Thread Bill Hoffman

On behalf of myself, Ken, Brad, Dave, Alex and the rest of the
CMake team, we are pleased to announce that CMake 2.6.3 is
available for download at:

  http://www.cmake.org/cmake/resources/software.html

The documentation for 2.6.3 can be found here:

  http://www.cmake.org/cmake/help/documentation.html

If you have any problems or find any bugs, please report them at
www.cmake.org/Bug.

A full list of changes for the 2.6 release tree can be found here:

  http://www.cmake.org/files/v2.6/CMakeChangeLog-2.6.3

Some notable changes are:

- Add parenthetical expressions to if
- Improve scoping of policies (see cmake_policy and CMP0011)
- Teach find_package more config file locations
- Many improved Find scripts in Modules
- Added an unset command
- Qt cmake-gui is the primary GUI for windows, deprecate CMakeSetup
- Better reporting when nmake compiler environment is not correct
- lots of bug fixes


Thanks, 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] CMake's Xcode generator seems to ignore the CMAKE_CXX_COMPILER variable

2009-02-24 Thread Bill Hoffman

Stephan Aiche wrote:

It was an empty directory. Also inspecting the CMakeCache.txt shows

//C++ compiler
CMAKE_CXX_COMPILER:FILEPATH=/usr/bin/g++-4.2

For me it seems, that the generator is ignoring this variable while 
generating the Xcode project files


Stephan



That will not work with Xcode projects.  I am not sure how you tell 
Xcode to use a different compiler.  Any Xcode experts out there?


-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] CMake 2.6-3.app and version numbers in .app name

2009-02-24 Thread Bill Hoffman

Sean McBride wrote:

Hi all,

Back in early April 2008 we debated whether CMake's .app should be named
simply CMake.app or something with the version number, like CMake
2.6-3.app.

I just updated from 2.6.2 to 2.6.3, and went to rebuild my VTK.  It now says:

/bin/sh: /Applications/CMake 2.6-2.app/Contents/bin/cmake: No such file
or directory

Indeed this path appears in my CMakeCache.txt.  Not sure why.  I always
use CMake via my symlinks in /usr/local/bin.

I don't know if the 2.6.3 installer got rid of 2.6.2 or I did (I
forget), but I wouldn't be surprised if this happens to others.

I just tried configuring a fresh VTK binary folder like this:

mkdir test
/usr/local/bin/cmake ../VTK

And the resulting CMakeCache.txt does not contain /usr/local/bin/cmake
but rather /Applications/CMake 2.6-3.app/Contents/bin/cmake (the
destination of my symlink).

I think this is a good argument in favour of naming the thing simply
CMake.app.



This just means that you can have multiple versions of CMake on the same 
machine.   You removed the cmake that built your VTK, you need to re-run 
the new cmake on your VTK, and all should be well.


cd old-vtk-build
/usr/local/bin/cmake ../VTK

Assuming /usr/local/bin/cmake is the new cmake, then you should be all set.

-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] using two different compilers together

2009-02-25 Thread Bill Hoffman

There is a FindCuda.cmake here, that I have looked at:

http://www.sci.utah.edu/~abe/FindCuda.html

I am thinking of adding it to CMake, he uses custom_commands for Cuda.


-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] setting default pathnames for CMake

2009-02-25 Thread Bill Hoffman

scott mc wrote:

I've compiled CMake for Haiku but it's insisting on putting some
things into /usr/local which Haiku does not have and does not even
allow.  Haiku uses /boot/common instead, so for most ports I've done
with autotools we simply use ./configure --prefix=/boot/common, how is
this done in CMake?
-scottmc



cmake -DCMAKE_INSTALL_PREFIX=/boot/common
should work.

If you are building CMake itself, you can pass --prefix=/boot/common to 
the bootstrap script.



-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] Adding extensions to AUX_SOURCE_DIRECTORY

2009-02-26 Thread Bill Hoffman

Reisinger, Thomas Karl wrote:

Hello,
 
AUX_SOURCE_DIRECTORY by default searches for the following extensions - 
 .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp .hxx .in .txx 
Because CMake works case sensitive I need to ADD another extension 
.CPP to the command AUX_SOURCE_DIRECTORY.
 


You should use file(GLOB ...) instead.  However, that said it is much 
better to explicitly list the sources so that cmake can re-run correctly 
when new files are added, or files are removed.


-Bil
___
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] Memory checking MPI programs with valgrind?

2009-02-26 Thread Bill Hoffman

Bartlett, Roscoe A wrote:



Does anyone know how to get valgrind to not search for errors in the parent but 
only in the children?



No way to do that, but you can create a suppression file.  If you add 
--gen-suppressions=all to the valgrind command line it will create 
entries for the suppression file directly.


-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] Technique for generating projects that depend on generated sources

2009-02-26 Thread Bill Hoffman

Steve Huston wrote:

I'm working on a project that involves generating a large chunk of the
sources from separate definitions. The set of generated source files
is not known before it is generated.

The approach I've tried so far (and I'm very new to cmake) is to
define a custom_command that does the source generation, then run
cmake over again to regenerate the project files.

I tried this out with Microsoft Visual Studio... When I tried a build
from inside Visual Studio the command to generate the sources happened
like I want, but when it tried to re-run cmake to regenerate the
project with the now-known set of generated sources, an error was
thrown because cmake couldn't update VS macros while VS is running.

So close, yet so far... ;-)

Is there a common pattern for how to address this type of situation?



Look at the FAQ:

http://www.cmake.org/Wiki/CMake_FAQ#How_do_I_generate_an_executable.2C_then_use_the_executable_to_generate_a_file.3F

-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] ADD_TEST(...) doesn't output any tests into CTestTestfile.cmake (cmake 2.6-patch 0)

2009-02-27 Thread Bill Hoffman

Pavel Shevaev wrote:

Folks, any idea why this can be happening?

I have the following lines in my CMakeLists.txt:

...
ENABLE_TESTING()
INCLUDE(CTest)
ADD_TEST(AllTests {$project_SOURCE_DIR}/scripts/runtests)
...

I also have properly configured CTestConfig.cmake in the same
directory with CMakeLists.txt, however cd build  cmake ..  make
test says No test were found!!!

What's really weird is the fact tests ARE run in case I have no
ADD_SUBDIRECTORY commands in the CMakeLists.txt. I was simply
experimenting with the minimal working CMakeLists.txt which uses
ADD_TEST by commenting out different portions of it and discovered
this strange behavior.


Can you create a complete but small example that shows the problem?
___
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] ADD_TEST(...) doesn't output any tests into CTestTestfile.cmake (cmake 2.6-patch 0)

2009-02-27 Thread Bill Hoffman

Pavel Shevaev wrote:

Can you create a complete but small example that shows the problem?


Ok, I tried to extract the minimal non-working example from my CMakeLists.txt.

foo/CMakeLists.txt:
==
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
project(foo)

enable_testing()
include(CTest)
add_test(test test)

add_subdirectory(${foo_SOURCE_DIR}/../shared/lib/boost ${foo_BINARY_DIR})
==

The problem is in the add_subdirectory call.  You can not specify 
${foo_BINARY_DIR} as a directory as it is already in use.  We are 
working on a fix that will report this as an error.   Basically what 
happens is the test file gets written correctly, then overwritten with 
nothing from the shared/lib/boost build directory that is told to go 
into the same directory.


So,  this should fix the problem:

add_subdirectory(${foo_SOURCE_DIR}/../shared/lib/boost boost_lib)

-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


[CMake] CMake article

2009-02-28 Thread Bill Hoffman
I am writing an article for the Kitware Source 
(http://www.kitware.com/products/thesource.html ) about how CMake aides 
in innovation and collaboration.  If you have stories about how CMake 
has helped your project/research achieve its goals, I would be 
interested to hear them.


Thanks in advance.

-Bill


--
Bill Hoffman
Kitware, Inc.
28 Corporate Drive
Clifton Park, NY 12065
bill.hoff...@kitware.com
http://www.kitware.com
518-371-3971 (phone and fax)
___
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] Technique for generating projects that depend on generated sources

2009-03-01 Thread Bill Hoffman
I had another idea.  About how many generated files are there, and how 
big are they? It they are smallish, you could generate a single source 
file that includes the generated files.


generated.cxx
#include gen1.cxx
#include gen2.cxx
#include gen3.cxx
...

Then you could have a custom command generate gen1-N.cxx first, and then 
 generate generated.cxx last, and only compile generated.cxx.


-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] shared lib on mac

2009-03-02 Thread Bill Hoffman

Alexander Neundorf wrote:

On Monday 02 March 2009, Nicolas Slythe (Intern) wrote:

SET(TARGET_SOURCE
./utils/utils.cxx
./test/test.cxx
./test/test1.cxx
)

ADD_DEFINITIONS (
-DK_NODLL
-DK_DISABLE_UI
)

ADD_LIBRARY  (
 test
 SHARED
${TARGET_SOURCE}
)


I don't have a mac here, but here on my Linux machine this works.
Did you try this on a clean build tree ?
Which version of cmake ?
Makefile generator or Xcode ?
Does the -DK_NODLL maybe cause some strange things ?



What is the output of make VERBOSE=1?

-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] firefox logo

2009-03-03 Thread Bill Hoffman

Mathieu Malaterre wrote:

Hi there,

  Why is the firefox logo redistributed within cmake:


No idea!

That file does not seem to be referenced by the build or any of the 
tests, so I have removed it.


$ cvs commit -m ENH: remove unused file CPack.background.png.in
Committer: Bill Hoffman bill.hoff...@kitware.com
/cvsroot/CMake/CMake/Modules/CPack.background.png.in,v  -- 
CPack.background.png.in

new revision: delete; previous revision: 1.1



-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] ccmake gets all squirrelly over which C++ compiler to use.

2009-03-03 Thread Bill Hoffman

Mathieu Malaterre wrote:

On Tue, Mar 3, 2009 at 4:20 PM, kent williams nkwmailingli...@gmail.com wrote:

Lather, Rinse, Repeat. After 2 or 3 go-arounds, CCMake is happy and
lets you generate your build files.

And if I recall correctly, earlier versions (2.3? 2.4?) did not act this way.


Yup, this behavior appears exactly when 2.6.0 was released.
Because this can be reproduce only by manual process, it may have gone
unnoticed in the cmake regression testing...

OK, so to address changing a compiler from ccmake, a very common 
complaint on the list.  I put something in that would detect a change in 
compilers from the ccmake application.  If one is detected, the cache is 
removed allowing for the new compiler to be used.  Unfortunately, this 
conflicted with some overly paranoid stuff in the VTK/ITK CMakeLists.txt 
files that forces a compiler change.   In hind site that was a bad idea, 
and there is already a way to disable it.


http://public.kitware.com/Bug/view.php?id=7745

So, if you run cmake -DCMAKE_OVERRIDE_COMPILER_MISMATCH=TRUE, or add 
that variable to your cache, then the problem will go away...


-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] function vs macro

2009-03-03 Thread Bill Hoffman

Michael Jackson wrote:

The subtle difference is this line from the macro help section:

Note that the parameters to a macro and values such as ARGN are not 
variables in the usual CMake sense. They are string replacements much 
like the c preprocessor would do with a macro. If you want true CMake 
variables you should look at the function command.



I should update this page to include functions and macros:
http://www.cmake.org/Wiki/CMake/Language_Syntax

The big difference is that functions have actual scope.   I guess that 
is missing from here:


http://www.cmake.org/cmake/help/cmake2.6docs.html#command:function

The scope issue is covered here:

http://www.cmake.org/cmake/help/cmake2.6docs.html#command:set

-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] Concern with 2.6.3

2009-03-04 Thread Bill Hoffman

Robert Dailey wrote:

Hi,

I noticed after switching to version 2.6.3 that header files (with HPP 
extension) are marked as Exclude from build in Visual Studio 2008. Is 
this behavior by design? If so, why?



You don't want to compile .hpp files do you?

-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] Concern with 2.6.3

2009-03-04 Thread Bill Hoffman

Robert Dailey wrote:
But by default visual studio does not compile HPP or H files. I've 
*never* had this problem in any version of visual studio starting from 
version 6.


So, what is the problem?  CMake marks all files that should not be 
compiled as do not compile.   Is this causing trouble?


-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] bug in ctest (2.6.3)?

2009-03-04 Thread Bill Hoffman

Clemens Arth wrote:
Well, it's on you to decide, but I'd still suggest that Bill's 
workaround also goes into the cvs for the next release to make 
everything more bullet-proof...




I have already done the commit with the fix.  For now, I would suggest 
just letting it do something for the trigger.


-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] ADD_TEST(...) doesn't output any tests into CTestTestfile.cmake (cmake 2.6-patch 0)

2009-03-04 Thread Bill Hoffman

Pavel Shevaev wrote:

On Wed, Mar 4, 2009 at 7:22 PM, David Cole david.c...@kitware.com wrote:

Did you call ENABLE_TESTING before any ADD_TEST calls in your
CMakeLists.txt?


Yes :(


Please create a full working test case that shows this problem.

-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] Overlook fing uses cmake as build system

2009-03-04 Thread Bill Hoffman

Daniele Galdi wrote:

Dear CMake developers,

I'm sending you this email to thank you all for your precious and always 
prompt support in using this amazing build system.

We just developed and released a free tool, built using cmake.

We put a link to your site in our technology section:
http://www.over-look.org/site/index.php/documentation/fing-technology 
http://www.over-look.com/site/index.php/documentation/fing-technology


Thank you again for such a great build system.



Please add your project here:

http://www.cmake.org/Wiki/CMake_Projects

Also, if you could send a response to me about this email (CMake article):

http://www.cmake.org/pipermail/cmake/2009-February/027410.html

it would be much appreciated.

Thanks.

-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] ccmake gets all squirrelly over which C++ compiler to use.

2009-03-05 Thread Bill Hoffman

kent williams wrote:

So the problem with CCMake forgetting valid user input stems from the
entire CMakeCache.txt file getting deleted if there's a compiler
mismatch?




Yes, that is what happens.  The use case that this was supposed to 
address was this:


ccmake ../source
- oops, I did not want that commpiler
- I change CMAKE_C_COMPILER and CMAKE_CXX_COMPILER
- I hit configure again, the cache is wiped except for the new 
CMAKE_C_COMPILER and CMAKE_CXX_COMPILER that you just picked



The problem happens with vtk/itk force compiler stuff:

ccmake ../source
- configure
- tell it where vtk is, vtk changes the compiler
- my code things the user changed the compiler
- everything is wiped except for the C and CXX compilers

VTK/ITK should not change 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] Setting default make options for Makefiles generator

2009-03-06 Thread Bill Hoffman

Adolfo Rodríguez wrote:
If none of the developers sees any important issue with this proposal, 
I'll submit a feature request based on what has been discussed in the 
current thread.


Thanks all,



I am not sure I like the idea.  It is too make specific.  The makefiles 
that cmake generates should work with any make.  How the developer runs 
the make is not really up to cmake, but rather up to the developer.


-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] slight problem with CTest documentation

2009-03-06 Thread Bill Hoffman

Philip Lowman wrote:
The CTest documentation online appears like it wasn't generated from the 
2.6.3 source release.  Just noticed this by accident tonight and wanted 
to mention it.



http://www.cmake.org/cmake/help/ctest2.6docs.html#command:ctest_update

* *|ctest_submit|*: Submits the repository.

ctest_submit([RETURN_VALUE res] [PARTS ...] [FILES ...])

  Submits the test results for the project. By default all available
  parts are submitted. The PARTS option lists a subset of parts to
  be submitted. The FILES option explicitly lists specific files to
  be submitted. Each individual file must exist at the time of the
  call.




Thanks!

oops!   I ran a cvs cmake for that by mistake!  Should be all better now.


-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] Documentation bug(?) in CheckC(XX)SourceCompiles

2009-03-06 Thread Bill Hoffman

Marcel Loose wrote:

After further inspection, I think my observation holds true for all
Check*.cmake files in the Modules directory, not just the
CheckC(XX)SourceCompiles files.



It is a cache variable so that the test is not run over and over each 
time CMake is run.  unset is in cmake 2.6.3.


-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] Common binary dir and failed local headers dependencies

2009-03-07 Thread Bill Hoffman

Wojciech Migda wrote:

Hi all,

I have a build system with several subtargets residing in respective
subfolders. What is important - I'm using common binary directory for
all targets. The command I use is:

ADD_SUBDIRECTORY( nth_subfolder common_binary_dir )



Each directory must be unique.  There is a fix for this in CVS CMake, if 
you do this:



ADD_SUBDIRECTORY( a_subfolder common_binary_dir )

ADD_SUBDIRECTORY( b_subfolder common_binary_dir )

It will be an error.  Each sub-dir must be unique in the binary tree.


-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] Common binary dir and failed local headers dependencies

2009-03-07 Thread Bill Hoffman

Wojciech Migda wrote:

Hi again,

this workaround seems to do a trick:

in cmDependsC::WriteDependencies I've added a local variable to store
path to the source file being scanned for dependencies:

std::string root_dir =
cmSystemTools::GetFilenamePath(this-LocalGenerator-Convert(src,
  cmLocalGenerator::HOME_OUTPUT,
  cmLocalGenerator::MAKEFILE));

later in the function I've replaced

if((*i) == .)
  {
tempPathStr += current.FileName;

with

if((*i) == .)
  {
tempPathStr += root_dir + / + current.FileName;

Could anyone from the cmake dev team evaluate this proposal ?



There are other things that will break because of this.  Things like 
percent done.  The build directories were designed with the thought that 
they should be unique.


Try LIBRARY_OUTPUT_PATH to place the libraries, that is how it should be 
done.


-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] enable_testing() disables add_executable(test ...)

2009-03-08 Thread Bill Hoffman

Silvio Frischknecht wrote:
If I enable_testing() executables or libraries called test don't build 
anymore.


here's a simple example:

CMakeLists.txt:

cmake_minimum_required(VERSION 2.6)
project(FooBar)
enable_testing()
add_executable(test test.c)
add_test(baz test)

If this is not going to be changed please at least write it into the doc. I 
mean it's not so far fetched to call your test exectable test.





This is because we create a target called test that runs the tests


Please create a bug for this, it should at least warn about the issue...

-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] CMake and VPATH

2009-03-09 Thread Bill Hoffman

laur...@marzu.org wrote:

Hello all,

 

I've just began trying to port my project from autoconf to CMake and 
I've got a question.


My project use 'vpath' variable in order to locate source file from 
different directory according to argument pass to autoconf.


Typically, my C++ source file may be from src/libxml2 or src/xerces-c++ 
or any other directory depending on XML parser used.


I've look up around a little a came on a message saying CMake have no 
replacement for VPATH.


So, my question is:

- How to use CMake in such case ?

No need for VPATH in CMAke, it always builds out of source.  In the 
CMakeLists.txt file there are several variables that can give you 
locations of files.


PROJECTNAME_SOURCE_DIR
PROJECTNAME_BIANRY_DIR
(where PROJECTNAME is the name used in the this command: 
project(PROJECTNAME)


CMAKE_CURRENT_SOURCE_DIR
CMAKE_CURRENT_BINARY_DIR

-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] Concern with 2.6.3

2009-03-09 Thread Bill Hoffman

Pau Garcia i Quiles wrote:


Yes, I'm using QT4_WRAP_CPP (with plans to move to automoc), but that
right-click, compile to run moc is useful  (no need to close the
solution or reload projects) and it's what VC++ developers are used
to.

With CMake, you can still right click and compile, it will run the 
custom command.  You just need to find the output file in VS.


-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] Concern with 2.6.3

2009-03-09 Thread Bill Hoffman

Pau Garcia i Quiles wrote:

On Mon, Mar 9, 2009 at 4:24 PM, Bill Hoffman bill.hoff...@kitware.com wrote:

Pau Garcia i Quiles wrote:


Yes, I'm using QT4_WRAP_CPP (with plans to move to automoc), but that
right-click, compile to run moc is useful  (no need to close the
solution or reload projects) and it's what VC++ developers are used
to.


With CMake, you can still right click and compile, it will run the custom
command.  You just need to find the output file in VS.


I guess you mean finding the moc_blah.cxx file in the CMake Rules
filter in VC++. Yes, that works.

Yes, that is what I mean.


What does not work is what I am doing: I'm listing the .h files as
source files so that they show in the VC++ project. Now, given that
header files are marked as excluded from build, VC++ disables
right-click-and-compile for those header files.
The .h file is not compiled, so that would not work anyway in a CMake 
generated project. If the .h file where the input to a custom command 
then it would work.  That is how the VTK wrappers work.  Each .h file is 
compiled by a custom command into a .cxx file.


By the way, is there any way to set an internal global variable in a
VC++ project? Currently, CMake-generated Qt projects may show a wrong
version in the property browser if the default (in the registry) Qt
version is not the same as the Qt version you told in CMake (i. e. the
qmake). What's required is adding something like this in the .vcproj :

Globals
...
Global
Name=QtVersion
Value=4.4.3
/

(where the Qt version would be what FindQt4.cmake has found)

Would something like SET_TARGET_PROPERTIES ( thetarget PROPERTIES
VS_GLOBAL property value ) be accepted if I provide a patch?


Sure, there are already some examples of this:
  (VS_KEYWORD, cmProperty::TARGET,
 Visual Studio project keyword.,
 Can be set to change the visual studio keyword, for example 
 QT integration works better if this is set to Qt4VSv1.0. );
  cm-DefineProperty
(VS_SCC_PROVIDER, cmProperty::TARGET,
 Visual Studio Source Code Control Provider.,
 Can be set to change the visual studio source code control 
 provider property.);
  cm-DefineProperty
(VS_SCC_LOCALPATH, cmProperty::TARGET,
 Visual Studio Source Code Control Provider.,
 Can be set to change the visual studio source code control 
 local path property.);
  cm-DefineProperty
(VS_SCC_PROJECTNAME, cmProperty::TARGET,
 Visual Studio Source Code Control Project.,
 Can be set to change the visual studio source code control 
 project name property.);


-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] Concern with 2.6.3

2009-03-09 Thread Bill Hoffman

Pau Garcia i Quiles wrote:

What does not work is what I am doing: I'm listing the .h files as
source files so that they show in the VC++ project. Now, given that
header files are marked as excluded from build, VC++ disables
right-click-and-compile for those header files.

The .h file is not compiled, so that would not work anyway in a CMake
generated project. If the .h file where the input to a custom command then
it would work.  That is how the VTK wrappers work.  Each .h file is
compiled by a custom command into a .cxx file.


Is it possible to mark each .h file as the entry point to the
corresponding (already-generated) CMake rule, so that compile is
available and runs moc on that .h?



Should be, I have not looked into the moc generation stuff recently, but 
that is how it works in VTK with the wrapper generation.


In the test CustomCommand in CMake this is done:

ADD_CUSTOM_COMMAND(
  OUTPUT ${PROJECT_BINARY_DIR}/wrapped.c 
${PROJECT_BINARY_DIR}/wrapped_help.c

  DEPENDS wrapper
  MAIN_DEPENDENCY ${PROJECT_SOURCE_DIR}/wrapped.h
  COMMAND ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/wrapper
  ${PROJECT_BINARY_DIR}/wrapped.c ${PROJECT_BINARY_DIR}/wrapped_help.c
  ${CMAKE_CFG_INTDIR} # this argument tests passing of the configuration
  VERBATIM # passing of configuration should work in this mode
  )

I just verified and I can right click on wrapped.h and compile it to run 
the generator.   The MAIN_DEPENDENCY is doing that.  That said, 
FindQt4.cmake seems to already be using MAIN_DEPENDENCY, so it should be 
working...


-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] Memory cleanup of variables

2009-03-10 Thread Bill Hoffman

Naram Qashat wrote:
I have a CMake project that I have been testing with various verisons of 
CMake 2.4.x and 2.6.x to make sure it works as far back as 2.4.0, due to 
not knowing what version of CMake our users will be using since a lot of 
them use shells. In some instances, I have to read lines from a file 
using a specific regular expression.  With CMake 2.6.x, this works fine 
using the file(STRINGS) command.  With CMake 2.4.x, though (I haven't 
checked what versions specifically), after reading in a lot of files, I 
notice that a memory exhausted error comes up. I'm wondering when 
CMake cleans up the memory it uses, and if there is a way around this 
problem.  I would prefer not to force our uses to use CMake 2.6.x if 
their shell provider won't provide them something newer.


There may have been leaks in 2.4.X, not really much we can do about that 
now   What does the your cmake code look like that causes the leak?



-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] Memory cleanup of variables

2009-03-11 Thread Bill Hoffman

Naram Qashat wrote:

Bill Hoffman wrote:

Naram Qashat wrote:
I have a CMake project that I have been testing with various verisons 
of CMake 2.4.x and 2.6.x to make sure it works as far back as 2.4.0, 
due to not knowing what version of CMake our users will be using 
since a lot of them use shells. In some instances, I have to read 
lines from a file using a specific regular expression.  With CMake 
2.6.x, this works fine using the file(STRINGS) command.  With CMake 
2.4.x, though (I haven't checked what versions specifically), after 
reading in a lot of files, I notice that a memory exhausted error 
comes up. I'm wondering when CMake cleans up the memory it uses, and 
if there is a way around this problem.  I would prefer not to force 
our uses to use CMake 2.6.x if their shell provider won't provide 
them something newer.


There may have been leaks in 2.4.X, not really much we can do about 
that now   What does the your cmake code look like that causes the 
leak?



-Bill


I believe it is within this macro of mine:

macro(read_from_file FILE REGEX STRINGS)
  if(CMAKE26_OR_BETTER)
# For CMake 2.6.x or better, we can just use the STRINGS sub-command 
to get the lines that match the given regular expression (if one is 
given, otherwise get all lines)

if(REGEX STREQUAL )
  file(STRINGS ${FILE} RESULT)
else(REGEX STREQUAL )
  file(STRINGS ${FILE} RESULT REGEX ${REGEX})
endif(REGEX STREQUAL )
  else(CMAKE26_OR_BETTER)
# For CMake 2.4.x, we need to do this manually, firstly we read the 
file in

file(READ ${FILE} ALL_STRINGS)
# Next we replace all newlines with semicolons
string(REGEX REPLACE \n ; ALL_STRINGS ${ALL_STRINGS})
if(REGEX STREQUAL )
  # For no regular expression, just set the result to all the lines
  set(RESULT ${ALL_STRINGS})
else(REGEX STREQUAL )
  # Clear the result list
  set(RESULT)
  # Iterate through all the lines of the file
  foreach(STRING ${ALL_STRINGS})
# Check for a match against the given regular expression
string(REGEX MATCH ${REGEX} STRING_MATCH ${STRING})
# If we had a match, append the match to the list
if(STRING_MATCH)
  append_to_list(RESULT ${STRING})
endif(STRING_MATCH)
  endforeach(STRING)
endif(REGEX STREQUAL )
  endif(CMAKE26_OR_BETTER)
  # Set the given STRINGS variable to the result
  set(${STRINGS} ${RESULT})
endmacro(read_from_file)

I had done this so I could call the macro and have it work with either 
2.6.x or 2.4.x.


The only thing I can think of is to call a new cmake process in the loop 
that does the string match, that way the leak will be contained in that 
process.


execute_process(COMMAND ${CMAKE_COMMAND} -DFILE=${FILE}-P 
myscript.cmake OUTPUT_VARIABLE OUT)


myscript.cmake
 file(READ ${FILE} ALL_STRINGS)
...
  message(${RESULT})

-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] What's the difference between option and variable of type bool

2009-03-11 Thread Bill Hoffman

Marcel Loose wrote:

Hi all,

I feel rather stupid, but I fail to see whether there's any difference
between a CMake option (which is stored in the cache as a variable of
type bool) and a CMake variable of type bool that's being cached.
Both can be modified in a GUI like ccmake.

Is there any reason to prefer the former over the latter?



There is no difference, option is a bit shorter to write, and maybe more 
descriptive.


-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] Memory cleanup of variables

2009-03-11 Thread Bill Hoffman

Naram Qashat wrote:


myscript.cmake
 file(READ ${FILE} ALL_STRINGS)
...
  message(${RESULT})

-Bill


Thanks, that worked very well.  The only problems I had, though, were 
that the quotes were passed to the new invocation of CMake and that I 
had to use ERROR_VARIABLE instead of OUTPUT_VARIABLE, otherwise it works 
fine.




Great, glad it works for you.  At some point 2.X will be in the past... :)

-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] Memory cleanup of variables

2009-03-11 Thread Bill Hoffman

Alexander Neundorf wrote:

On Wednesday 11 March 2009, Bill Hoffman wrote:
...

Great, glad it works for you.  At some point 2.X will be in the past... :)


Oh, plans for cmake 3.0 ?



oops, 2.4.X.

-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] Parallel builds and Eclipse CDT4 generator

2009-03-12 Thread Bill Hoffman

Alexander Neundorf wrote:


I'm using CMake 2.6.2 and Eclipse CDT5 (not CDT4, could this be an issue?)


I don't think so.
We could add some special variable, like
CMAKE_MAKEFILE_PROJECT_FLAGS or CMAKE_MAKEFILE_PARALLELITY, and use this in 
the makefile-based generators to set the -jx parameter for make.
But then again, this shouldn't be hardcoded in the CMakeLists.txt, so it could 
only be a cache variable.
Or should cmake try to determine automatically how many cores there are and 
add -jx automatically ? E.g. using sysconf(_SC_NPROCESSORS_ONLN) ?
This could also be disabled by default and enabled e.g. via an option like 
CMAKE_AUTOMATIC_PARALLEL_MAKE_INVOCATION or something like this.




This sounds like an Eclipse issue...  Does this work:

http://dev.eclipse.org/newslists/news.eclipse.tools.cdt/msg15742.html

How is this done with non-cmake based Eclipse projects?

-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] Header files excluded from build in Visual Studio

2009-03-12 Thread Bill Hoffman

Claus Höfele wrote:

Hi everyone,

I've recently switched to cmake to generate Visual Studio project
files for a project of mine and it's working great so far.

One issue that bugs me is that header files end up being disabled in
Visual Studio (Excluded From Build property is set for the header
files). This prevents Visual Studio from syntax checking these files,
which is quite a bummer for me because I have a lot of inline code in
my header files.

Setting the property HEADER_FILE_ONLY to false doesn't work because
the code in cmSourceFile::CheckExtension() forces this property to
true for headers files. The generator for Visual Studio then
automatically disables the file when it writes the project file.

For Visual Studio, this behaviour doesn't make much sense because
header files are not compiled anyway. At the very minimum, I should be
able to override this setting.

I wonder if there's a workaround for this problem without resorting to
building my own cmake executable.



Well, looks like you found the reason that this fix needs fixing!

Sadly it does require a rebuild of CMake, there is no way to fix this 
without changing the c++ source code.


-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] Header files excluded from build in Visual Studio

2009-03-13 Thread Bill Hoffman

Claus Höfele wrote:

Thanks for the quick replies.

I'm using cmake 2.6.3 + Visual Studio 8 2005 SP1

Playing around further with the file properties in Visual Studio, it
looks like VS only checks the syntax of a file if the Tool property is
set to C/C++ Compiler Tool. However, this setting will cause the
header file to be compiled, which is obviously not what you want.

So the setting for a header file should be:
1.) Excluded From Build: No
2.) Tool: Custom Build Tool

2.) is already done, 1.) is not.

For my purposes, it was enough to change cmSourceFile::CheckExtension() like so:

  // Look for header files.
  if ...
  else
{
// This is a known header file extension.  The source cannot be compiled.
if(!this-GetProperty(HEADER_FILE_ONLY))
  {
  this-SetProperty(HEADER_FILE_ONLY, 1);
  }
}

This allows me to override the HEADER_FILE_ONLY setting to false in my
CMakeLists.txt and produces the project files I want.

Would be great if a similar fix would make it into the next release.



What is the default if you have VS create the project?  BTW, this all 
came from this bug fix:

http://public.kitware.com/Bug/view.php?id=7845

I am not sure you want to make that false in your file, as the makefile 
generator may then try and compile it.  CMake should handle a .h file 
without having to change anything.


-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] 1 tricky question, 1 bug report

2009-03-13 Thread Bill Hoffman

Denis Scherbakov wrote:

Dear CMake list subscripers,




I have a project with verious ADD_LIBRARY/ADD_EXECUTABLE targets in

different subdirectories. Some of these targets depend on mico corba,
some don't. As well as some depend on libxml2, some don't.


We have developers working on sub-projects, which do not require mico


nor libxml2. How to check for required dependencies, when user types
gmake Projectname. Because only then I know if mico and libxml2 are
required or not.

I don't understand the question here?   At gmake time why do they need 
to know anything about mico or libxml2?





And what is the difference between MACRO and FUNCTION?
A function has scope and handles the arguments differently.  A macro is 
more like a c++ macro and just replaces the body of the code where it is 
called.



The following Fortran code cannot be compiled with CMake, because CMake looks for module called 
name, which of course, does not exist. If I replace Module with _Module_ 
the code compiles.
=forbug.f
CLine 1  (Output)   ; Module name


...


Try CMake 2.6.3, I am pretty sure we fixed the fortran comment module issue.

-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] CMake 2.6.3 - Fix set cache FORCE and -D command line to work together

2009-03-13 Thread Bill Hoffman

Andreas Schneider wrote:

Hi,

what means

- Fix set cache FORCE and -D command line to work together

I've recognized, that -DFOO=something doesn't overwrite cache settings anymore 
which are set to FORCE. Is this true?


If yes, then the documentation should be updated. -D states:

This option may be used to specify a setting that takes priority over 
the
project's default value.



Force is not a default value, force is force.

-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] 1 tricky question, 1 bug report

2009-03-13 Thread Bill Hoffman

Denis Scherbakov wrote:

Eric,

Your solution requires a developer to know too much about the
project,

which is not always true and basically to answer a full-scale
questionnaire before compilation. What if it is a new developer? What if
it is not a developer, but a user who expects everything to compile
automatically?


My question is simple:

What is the way to get some code executed not during

cmake-compilation, but when a user types gmake something and it
becomes clear which dependencies are needed.

What you can do is something like this:

IF ( LIBXML2_FOUND )
  # add executables and sub_directories that use libxml2 in here
ELSE()
   MESSAGE(STATUS libxml2 was not found, X, Y, and Z will not be built)
ENDIF ()


If you have a FATAL_ERROR, nothing will get built.

-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] VS2005 all headers are excluded

2009-03-13 Thread Bill Hoffman

Hicham Mouline wrote:

Hello,

cmake 2.6.3.
There has been a number of modifications which have caused all headers in the 
generated project files .vcproj to be excluded frm build
(the red minus sign next to the file in Solution explorer)

I have searched from inside VStudio the string HEADER_ONLY (ignoring case) in 
all solution *cmake*.* files, nothing.

1 of the CMakeLists.txt looks like this
ADD_CUSTOM_TARGET(...
SOURCES . ... . 
)


I don't believe there is a VStudio-wide option to exclude headers from builds.




as you see, ExcludedFromBuild=true is set to true for some reason.
any clues,
regards,


So, I wish you all had tried the RC candidates  :)

This problem came from this bug fix:
http://public.kitware.com/Bug/view.php?id=7845

Is this causing issues with the building of your project? Or is it just 
ugly to look at?


This is about the third post on this issue...

-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] VS2005 all headers are excluded

2009-03-14 Thread Bill Hoffman

Hicham Mouline wrote:

-Original Message-
From: John Drescher [mailto:dresche...@gmail.com] 
Sent: 13 March 2009 21:25

To: Bill Hoffman
Cc: Hicham Mouline; cmake@cmake.org
Subject: Re: [CMake] VS2005 all headers are excluded


Is this causing issues with the building of your project? Or is it just

ugly

to look at?

Bill,
I am not the OP but I use cmake 2.6.3 since it was released with
vs2005 but for me I can not see any difference besides the ugly symbol
in the solution explorer.


Yes, just the ugly symbol.
Any workaround?



Nope.  Will have to wait for the next version...

-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] Endless loop in cmake-2.6.2 on AIX with -DCMAKE_Fortran_Compiler=...

2009-03-16 Thread Bill Hoffman

Joachim Geiger wrote:

Hello,
this is more or less to document a bug in the cmake version 2.6.2 seen
on AIX version 5.3 when using the option to redefine the fortran
compiler. For example:
11:13 ../cmake-2.6.2-AIX-powerpc/bin/cmake ../test_project
-DCMAKE_Fortran_COMPILER=f95


What if you do this:

export FC=f95
./cmake-2.6.2-AIX-powerpc/bin/cmake ../test_project


-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] Endless loop in cmake-2.6.2 on AIX with -DCMAKE_Fortran_Compiler=...

2009-03-16 Thread Bill Hoffman

Bill Hoffman wrote:

Joachim Geiger wrote:

Hello,
this is more or less to document a bug in the cmake version 2.6.2 seen
on AIX version 5.3 when using the option to redefine the fortran
compiler. For example:
11:13 ../cmake-2.6.2-AIX-powerpc/bin/cmake ../test_project
-DCMAKE_Fortran_COMPILER=f95


What if you do this:

export FC=f95
./cmake-2.6.2-AIX-powerpc/bin/cmake ../test_project



Also, I am pretty sure this was fixed in 2.6.3.

-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] Progress reporting in CMake

2009-03-17 Thread Bill Hoffman

Denis Scherbakov wrote:

I see progress jumping even on freshly CMake prepared, but never compiled tree.

So is this a bug or a feature?



The progress is an approximation at best.  It should always betting 
bigger, and it should not go over 100%.   Working with make there really 
is not a better way to do it.   When the first configure is run, CMake 
has really no idea how much stuff is in the project, so it just keeps 
heading towards 100 until it is done.   After that it basically just 
reports on the number of directories processed.   There is no global 
count of all the rules that need to be run in make, or a way to get that 
information.



-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] automatically re-generating makefiles

2009-03-17 Thread Bill Hoffman

Matthew Woehlke wrote:


Makefile : cmake_check_build_system


Shouldn't this rather be:
Makefile: list of CMakeLists.txt, etc
cmake_check_build_system
?

...in which case, the only thing that should get checked is if the 
CMakeLists.txt are newer than the Makefile. So in most cases this should 
be fast.


We need to run cmake_check_build_system first because make can not 
handle missing depend .h files.   The check build system step makes sure 
the current set of depends won't kill make.   It is also useful for 
getting around some other make limitations that I can not remember right 
now.



-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] automatically re-generating makefiles

2009-03-17 Thread Bill Hoffman

Matthew Woehlke wrote:

Bill Hoffman wrote:

Matthew Woehlke wrote:

Makefile : cmake_check_build_system


Shouldn't this rather be:
Makefile: list of CMakeLists.txt, etc
cmake_check_build_system
?

...in which case, the only thing that should get checked is if the 
CMakeLists.txt are newer than the Makefile. So in most cases this 
should be fast.


We need to run cmake_check_build_system first because make can not 
handle missing depend .h files.


I'm not saying to stop doing anything that is currently done.

AFAICT, right now the Makefile itself does not have any dependencies; it 
seems that adding 'Makefile: build system files' with the rule from 
cmake_check_build_system would fix the original problem. So the question 
is if running cmake_check_build_system twice in a row can either be 
eliminated or kept reasonable.


I still don't get the original problem???   We used to have Makefile: 
build system files.  It was removed when that work was pushed into 
cmake_check_build_system.


-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] Feature request question

2009-03-17 Thread Bill Hoffman

Steven Wilson wrote:
Following the FAQ 
(http://www.cmake.org/Wiki/CMake_FAQ#I_want_a_new_feature_in_CMake._What_should_I_do.3F) 
 I have submitted a couple feature requests(8725, 8743) to the cmake 
bugs database along with source patches implementing the features.   I 
haven't yet received any feedback yet on either of these issues.   I am 
not in a hurry for a response, however I do want to check to make sure 
that I have submitted these requests appropriately.   Is the FAQ 
regarding feature requests up to date, and what kind of time frame 
should I expect for responses to requests?




Just busy...  Lots of feature requests in the bug tracker...   Can you 
post the ones that you are interested in?


-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] How best to capture the current Date/Time

2009-03-20 Thread Bill Hoffman

Michael Jackson wrote:


On Mar 20, 2009, at 5:30 AM, Eric Noulard wrote:


2009/3/20 Philip Lowman phi...@yhbt.com:

On Thu, Mar 19, 2009 at 11:18 PM, Michael Jackson
mike.jack...@bluequartz.net wrote:


I am trying to find a nice portable solution for generating version
strings based on the date (seems reasonable). I even have my own c++ 
code
that can generate the proper string for me. The problem that I can 
not seem
to get my head around is that I need to compile and run the program 
at cmake

time which probably isn't really going to happen, at least easily.
 So. what is everyone else doing for this?

My main goal is to automate the generation of cmake code like the
following:

set ( ${${Project_Name}_VERSION} 2009.03.10)

so that I can later use it for OS X bundle building.

On Unix systems I can easily spawn a date command to get what I 
need but

what to do on windows?


I use 'date' on unix and nothing but a nodate string on windows :-(



Ugly, but apparently possible with batch file scripting!
http://www.tech-recipes.com/rx/956/windows-batch-file-bat-to-get-current-date-in-mmdd-format/ 



Another option is you could write a small program which uses 
localtime() and
other posix functions to get you the format that you want and then 
use the

output from the program via a CHECK_C_SOURCE_COMPILES configure test.


may be the same idea, use TRY_RUN with your home made portable source
to get your string at CMake time.

another solution would be to try to find some script language installed
(perl, python, ...) then EXECUTE_PROCESS with appropriate pieces of code
for getting the date you want.

I think it would be worth a feature request for cmake -E date format
the how to get date is popping again and again.

--
Erk



That was the ticket. The try_run is working as best as I would expect it 
to. I plan to wrap that code in a CMake variable so that I can trigger 
the try_run when I need to increment the version string.


After all of this I'll probably put in a feature request for this 
functionality to be a part of CMake. Actually, if we could just get the 
following variables set by CMake it would be great:


CMAKE_CURRENT_YEAR
CMAKE_CURRENT_MONTH
CMAKE_CURRENT_DAY
CMAKE_CURRENT_HOUR
CMAKE_CURRENT_MINUTE
CMAKE_CURRENT_SECOND

I don't think you could do this as a set of variables.  It would be 
better as some sort of command.  file(GETDATE result) or something.


-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] How best to capture the current Date/Time

2009-03-20 Thread Bill Hoffman

Michael Jackson wrote:

I don't think you could do this as a set of variables.  It would be 
better as some sort of command.  file(GETDATE result) or something.


-Bill


Well, I could but I am really interested in _why_ I would _not_ want to? 
Besides the obvious that the variables would basically change every time 
that cmake ran which might have some unwanted side effects.




That would be the problem.  The would be variables that would change 
with ever access, it would be very special code to handle that.  A 
command that returns the date is very easy and normal to implement.


-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] CMake and multiple Microsoft compilers on windows

2009-03-20 Thread Bill Hoffman

John Drescher wrote:

Makes sense. So then I should be opening cmake-gui from the compiler's
command prompt instead of the shortcut on the desktop. Not a big deal
I am one to use the command prompt all the time windows or linux..


I'm not very familar with cmake-gui but I don't see another option.


Thanks. You got me to thinking...

When I think of it, there is a second option for me. This is to setup
the environment variables to default to VS2005 since I build all my
CMake projects under windows with that version. The rest of the
compilers except 2008 are for application support for software I wrote
under MFC years ago. When you run the IDE for each of these it does
not use the environment variables anyways and my old non cmake build
process (my own batch files / installer generator) for these directly
sets up the environment for each application projects.



If you use the IDE generators for CMake, you do not need to modify the 
environment at all.  It is only when using nmake or make, that you need 
an environment that is setup to run the compiler.   If you do want to 
use nmake, VS 2003 and above have command prompts that can be found in 
the Visual Studio Tools menu of the Start menu.   Just run the one you 
want, then run cmake-gui from the command line:  c:\Program Files\CMake 
2.6\bin\cmake-gui.


-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] CMake and multiple Microsoft compilers on windows

2009-03-20 Thread Bill Hoffman

John Drescher wrote:

On Fri, Mar 20, 2009 at 3:49 PM, John Drescher dresche...@gmail.com wrote:

If you use the IDE generators for CMake, you do not need to modify the
environment at all.  It is only when using nmake or make, that you need an
environment that is setup to run the compiler.   If you do want to use
nmake, VS 2003 and above have command prompts that can be found in the
Visual Studio Tools menu of the Start menu.   Just run the one you want,
then run cmake-gui from the command line:  c:\Program Files\CMake
2.6\bin\cmake-gui.


But then with this setup cmake-2.6.3 is scanning my vc6 headers and
libs to generate vc2005 projects.



This has not caused me any problems but I am unsure if checks like
partial template specification are being used or is this part of cmake
not really used if I use the .sln and vcproj that cmake generates?



You lost me...  Why is anything scanning the incorrect headers


-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] CMake and multiple Microsoft compilers on windows

2009-03-20 Thread Bill Hoffman

John Drescher wrote:

But then with this setup cmake-2.6.3 is scanning my vc6 headers and
libs to generate vc2005 projects.


This has not caused me any problems but I am unsure if checks like
partial template specification are being used or is this part of cmake
not really used if I use the .sln and vcproj that cmake generates?


You lost me...  Why is anything scanning the incorrect headers


When I run cmake-gui from the link on my desktop and select vc2005 as
the compiler for the project it shows me in the debug output window of
cmake-gui that it is using VC6 as the compiler and doing tests for crt
functionality, templates and stl ... All of this appears to be done on
the VC6 libraries and headers and not the vs2005 ones.



If you select Visual Studio 8 2005 as a generator, it should not use 
VC6.   Please make sure you start with an empty binary directory, with 
no CmakeCache.txt file.


-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] CMake and multiple Microsoft compilers on windows

2009-03-20 Thread Bill Hoffman

John Drescher wrote:

On Fri, Mar 20, 2009 at 5:42 PM, John Drescher dresche...@gmail.com wrote:

If you select Visual Studio 8 2005 as a generator, it should not use VC6.
  Please make sure you start with an empty binary directory, with no
CmakeCache.txt file.


I just created a new build tree selected vs2005 and it still used the
vc6 compiler:


Attached is a screen shot. The folder X:/temp/Test did not exist
before I ran cmake.

OK, I am pretty sure (99.9%) it is not actually using that compiler for 
the tests.  The CMAKE_CXX_COMPILER value is not actually used by the 
visual studio IDE projects.  However, that does seem to be some 
disturbing output  I need to change the platform files so that the 
cl full path is not searched for.  Please create a bug report.


If you want to prove it to yourself you can run cmake with 
--debug-trycompile and look at the projects it is using for trycompiles.




-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] CMake used by Boost?

2009-03-21 Thread Bill Hoffman

Bill Lorensen wrote:

I don't use boost, but a quick google search found this:

https://svn.boost.org/trac/boost/wiki/CMakeConfigAndBuild



Here is another wiki about the Boost CMake work:

https://svn.boost.org/trac/boost/wiki/CMake

Currently, there are cmakelists.txt files in the trunk svn for Boost. 
Brad King and I will be speaking about CMake at Boost Con this spring.


-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] CMake used by Boost?

2009-03-21 Thread Bill Hoffman

Vladimir Prus wrote:

On Saturday 21 March 2009 22:28:43 Piotr Dobrogost wrote:

Hi

On the following page
http://www.cmake.org/cmake/help/documentation.html
one can read the following statement
In addition many other popular open source projects use CMake such as
VTK, ITK, ParaView, VXL, SecondLife and Boost.

Does Boost really use CMake and not Boost.Build as a build system?


The official way to build C++ Boost is using Boost.Build. The CMake setup
for C++ Boost is experimental, and clearly say so if you try to use it.
It is not decided that it will become official way to build C++ Boost.

Therefore, that page is at very least inaccurate. I would like to request
CMake developers fix that page.



Gotcha, will do.

-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] CMake used by Boost?

2009-03-21 Thread Bill Hoffman

Bill Hoffman wrote:

Vladimir Prus wrote:




Therefore, that page is at very least inaccurate. I would like to request
CMake developers fix that page.



Gotcha, will do.



Done:

http://www.cmake.org/cmake/help/documentation.html

Sorry for any confusion.

-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] How to generate preprocessed file?

2009-03-23 Thread Bill Hoffman

Marcel Loose wrote:

Hi all,

I was trying to figure out how to generate a preprocessed file. By
browsing the CMake modules and by printing all CMake variables I
discovered CMAKE_LANG_CREATE_PREPROCESSED_SOURCE variables. That
suggests that there is support for generating preprocessed files. 


However, there's no mention of these variables in the documentation, or
the FAQ or the Wiki. How should I tell CMake to add rules to my Unix
Makefiles for generating preprocessed (.i) files?



Just run make foo.i in the directory of the target that contains foo.c. 
 If you run make help in any directory it will list these types of targets.


-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] WinCE Support

2009-03-23 Thread Bill Hoffman

Andreas Pokorny wrote:

Hi,

Any news from the WinCE Support front?

There are four patch tickets in mantis:
http://cmake.org/Bug/view.php?id=7919
http://cmake.org/Bug/view.php?id=8486
http://cmake.org/Bug/view.php?id=8102
http://cmake.org/Bug/view.php?id=7434



Are there any tests included in these patches?  Can you run a nightly 
dashboard that runs them?


-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] WinCE Support

2009-03-23 Thread Bill Hoffman

Clemens Arth wrote:

Bill Hoffman wrote:

Andreas Pokorny wrote:

Hi,

Any news from the WinCE Support front?

There are four patch tickets in mantis:
http://cmake.org/Bug/view.php?id=7919
http://cmake.org/Bug/view.php?id=8486
http://cmake.org/Bug/view.php?id=8102
http://cmake.org/Bug/view.php?id=7434



Are there any tests included in these patches?  Can you run a nightly 
dashboard that runs them?



Hi,

as fas as my patch (8102) is concerned I have not written any tests yet. 
If you could suggest what type of tests you would consider to be 
appropriate I'll try to add them.




Basically, something that runs the new code.  Compile a WinCE project, 
and somehow verify that it compiled it correctly.


-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] WinCE Support

2009-03-23 Thread Bill Hoffman

Andreas Pokorny wrote:

Hello,

2009/3/23 Bill Hoffman bill.hoff...@kitware.com:
[..]

Basically, something that runs the new code.  Compile a WinCE project, and
somehow verify that it compiled it correctly.


So we need a couple of source files that pull in at least some basic
API headers.. and
a script file to run cmake and trigger the build?
( To execute the test you would need the non-free version of vs2005 or newer
and at least one CE SDK installed - and maybe have some env vars set)



See the Tests directory in CMake source to see how to setup a test. 
Basically, it is just a fully independent CMake project.  We run ctest 
--build-and-test to compile it.


-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] CTest: Toggling BUILD_TESTING triggers a project recompile

2009-03-23 Thread Bill Hoffman

Adolfo Rodríguez wrote:

Hi,

I have a project that uses CTest. I'm using the auto-generated 
BUILD_TESTING variable to enable/disable the test-related parts of my 
build tree. What strikes me as unusual is that when I build my project 
with  BUILD_TESTING set to ON (hence all test executables are built), 
and then toggle BUILD_TESTING to OFF, the subsequent call to make 
rebuilds all my project from scratch. I would expecting the build to do 
nothing, since all other targets have suffered no changes. Is this 
behavior intentional?




Does it change a -D flags that gest sent to all of your files?

-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] CTest: Toggling BUILD_TESTING triggers a project recompile

2009-03-23 Thread Bill Hoffman

Adolfo Rodríguez wrote:
I'm not setting any -D flags that depend on BUILD_TESTING. I only use 
the variable to guard entering the subdirectories where tests are generated:


if(BUILD_TESTING)
  add_subdirectory(test)
endif(BUILD_TESTING)

I am working in a project that adds a test subfolder to each folder 
where a target is generated. Could this be it? However, no source files 
(or its associated flags) are being changed. I'm just preventing CMake 
from entering the test dirs.




Try make VERBOSE=1 more make -d to figure out why it is rebuilding.  It 
should not.


-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] CTest passing arguments to test executables?

2009-03-24 Thread Bill Hoffman

Alastair Rankine wrote:

Hi,

I must be blind but I can't see a way for CTest to pass a command line
argument to a test executable?

I've tried using

--test-command testExe myargs

... but this causes it to not find the executable.

Any help appreciated, thanks.



Just put --test-command last and then have the args follow:

--test-commnad testExe myag1 myarg2 ...

-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


[CMake] 2.6.4 RC 1

2009-03-24 Thread Bill Hoffman
Mostly to fix the issue with Visual Studio and header files that was 
introduced with CMake 2.6.3, I am working on 2.6.4.   I have a release 
candidate that can be found here:


http://www.cmake.org/files/v2.6
Specifically, the windows one with the visual studio fix is here:
http://www.cmake.org/files/v2.6/cmake-2.6.4-RC-1-win32-x86.exe

Other changes in RC 1 are as follows:

Changes in CMake 2.6.4 RC 1
- Add some better documentation about RPATH variables
- No longer mark header files as HEADER_FILE_ONLY automatically,
  this gets rid of the ugly red marks in Visual Stuido
- Fix man-page preformatted text paragraphing
- Teach file(REMOVE) how to use relative paths
- Gracefully handle broken version symlinks
- Fix ASM source file extension default list
- Pass shared library export symbol in DEFINES
- Enforce unique binary directories
- Fix cmake-mode.el indentation cursor motion
- Simplify reverse cmLocalGenerator::Convert
- More robust decision to suppress implicit include dirs
- Fix Fortran implicit dependency include path (and test it)
- Clarify docs of old *_OUTPUT_PATH vars
- Fix svn update logic for modified files
- Add get_filename_component(... REALPATH)
- Work around broken GetLongPathName case


Thanks

-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] CMake, XCode, and Fortran support?

2009-03-24 Thread Bill Hoffman

Bartlett, Roscoe A wrote:

Hello,
 
Does anyone know if the XCode generator for CMake support Fortran as a 
compiler?  We have a Trilinos developer that tried to use CMake to 
generate an XCode project but it does not know how to handle the Fortran 
files.
 


Xcode itself does not support Fortran.  There is some third party 
plugin, but I think there are some issues.


Here is a previous thread about this:
http://www.cmake.org/pipermail/cmake/2008-October/024609.html

Here is a bug report:
http://public.kitware.com/Bug/view.php?id=7591

I think with Fortran right now, you are going to have to use makefiles, 
and not Xcode projects.


-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] 2.6.4 RC 1

2009-03-24 Thread Bill Hoffman

Robert Dailey wrote:

What exactly does this mean:

- Enforce unique binary directories


Does this mean instead of all executables going inside bin/debug, that 
they go inside of something like bin/project_name/debug (For the debug 
configuration, it would be likewise for release)?


No, it means that
add_subdirectory(foo bar)
add_subdirectory(bar bar)

Will now produce an error at CMake time, instead of just really weird 
things at build time (bad progress, files not built, lots of other 
really bad stuff).


-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] CMAKE_CURRENT_LIST_FILE in CMake 2.6.3

2009-03-24 Thread Bill Hoffman

KSpam wrote:
My build system relies heavily on CMAKE_CURRENT_LIST_FILE.  For instance, I 
typically get a variable for the directory containing the current list file 
as follows:


get_filename_component(scriptDir ${CMAKE_CURRENT_LIST_FILE} PATH)

This has worked in prior versions of CMake; however, it does  not work in 
CMake 2.6.3 (apparently, CMAKE_CURRENT_LIST_FILE is empty).  Is this a bug, 
or is it by design?




Should work.  Do you have a small example that shows this issue?

-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] set_property on sources causing extra files to be rebuilt

2009-03-24 Thread Bill Hoffman

Daniel Nelson wrote:



So it sounds like the only way to fix this would be to write a separate 
flags.make file for every object file that has compile/define flags set?  I opened 
this as issue 8787 in the bug tracker.


We tried that, it was way to slow with all those files. Especially on 
Windows.


-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] ifort link with -static-intel

2009-03-25 Thread Bill Hoffman

Benne, Kyle wrote:

Hello All,

I have been experimenting with CMake to compile a large Fortran

project with the Intel Fortran compiler ifort. I am having trouble
getting the executable to link with the static intel libraries, because
CMake is adding the linker flag i_dynamic and it is overriding my
--static-intel option.


I believe the i_dynamic flag is coming from

SET(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS -i_dynamic) in the
Linux-Intel-Fortran module. In fact when I set
CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS to an empty string in my
CMakeLists file, everything works as I expect. I have one ADD_EXECUTABLE
statement in my project. There are no libraries so why am I getting the
i_dynamic flag?


I think that flag is used so that the executable can link to shared 
libraries.  It maybe the wrong flag.  What is missing is a feature in 
CMake to ask for a static executable.  Right now, you have to do hacks 
like what you are doing to create static only executables.   Feel free 
to create a feature request for static linked executables.


-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] file(READ) issue?

2009-03-25 Thread Bill Hoffman

Steven Van Ingelgem wrote:

What I did (and solved the issue) is:
file(READ zconf.in.h ZCONF_H)
STRING(REPLACE HAVE_STD_HEADERS_H ${HAVE_STD_HEADERS_H} ${ZCONF_H})
file(WRITE zconf.test ${ZCONF_H})

Especially the quotes around the variable are important as otherwise 
CMake think it's an array and not a string... I think :)




You do know about configure_file right?

-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] message() text shows up as RED in cmake-gui

2009-03-26 Thread Bill Hoffman

Robert Dailey wrote:
It's been my understanding that calling message() without STATUS, 
WARNING, or ERROR was a STATUS by default. Considering that when I use 
both WARNING and ERROR the output looks different. Dialogs will appear 
and such. Are message() and message( STATUS ) not identical? If not, 
what are the differences? Why are they different?


There has been no change here in 2.6.3, message has been doing the same 
thing since 2.2...



This is better documented in CVS HEAD of CMake:


 message
   Display a message to the user.

 message([STATUS|WARNING|AUTHOR_WARNING|FATAL_ERROR|SEND_ERROR]
 message to display ...)

   The optional keyword determines the type of message:

 (none) = Important information
 STATUS = Incidental information
 WARNING= CMake Warning, continue processing
 AUTHOR_WARNING = CMake Warning (dev), continue processing
 SEND_ERROR = CMake Error, continue but skip generation
 FATAL_ERROR= CMake Error, stop all processing

 The CMake command-line tool displays STATUS messages on stdout and all
other message types on stderr. The CMake GUI displays all messages in
its log area. The interactive dialogs (ccmake and CMakeSetup) show
STATUS messages one at a time on a status line and other messages in
interactive pop-up boxes.

CMake Warning and Error message text displays using a simple markup
language. Non-indented text is formatted in line-wrapped paragraphs
delimited by newlines. Indented text is considered pre-formatted.


-Bill

--
Bill Hoffman
Kitware, Inc.
28 Corporate Drive
Clifton Park, NY 12065
bill.hoff...@kitware.com
http://www.kitware.com
518-371-3971 (phone and fax)
___
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] [Fwd: Re: building within msys/mingw]

2009-03-28 Thread Bill Hoffman

Kenneth Boyd wrote:

Apologies for not replying to the list.  Forwarding:

 Original Message 
Subject: Re: [CMake] building within msys/mingw
Date: Fri, 27 Mar 2009 22:07:37 -0500
From: Kenneth Boyd zaim...@zaimoni.com
To: Jason Addison jraddi...@gmail.com
References: 
4ae645d30903271932r6f76d398r5faf5dc619c7f...@mail.gmail.com




Jason Addison wrote:

I'm having trouble running bootstrap. I have mingw and msys installed.
As much as possible, I have installed everything as recommended. (I'm
trying to build and install cmake in order to build Open Scene Graph.)


Did I miss some key documentation? Everything that I was building in
mingw/msys was working as expected until I got to cmake.
  
No.  Cf. http://public.kitware.com/Bug/view.php?id=7870 for how I 
bypassed this enough to allow forcing MingW32 to work (with both 
bootstrapped and prebuilt Windows binaries).

Kenneth



I just updated the bug.   Bootstrap should not be required with msys or 
mingw.  You should be able to use the windows binary for cmake to 
bootstrap cmake.   We do this with dashboards each night, and all tests 
pass.  So, the binary CMake for windows should work just fine with a 
standard mingw install.


-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] Need help with GLOB expression

2009-03-29 Thread Bill Hoffman

James Bigler wrote:

Ah, yes.  I also was getting globbing expressions and regular
expressions mixed up.


From the docs (and experimentation), it looks like CMake only supports

*, ?, and [], but not {} which would be required to do what we want:

file(GLOB_RECURSE sources *.{h,cpp})



CMake uses a simple conversion from glob to regex, the code for that can 
be found here:


http://public.kitware.com/cgi-bin/viewcvs.cgi/Source/kwsys/Glob.cxx?revision=1.16root=CMakeview=markup

It does a simple glob with *,?, and [], and that is about it.

The best thing to do would be to try using a glob expression from a bash 
shell and ls.  For example, the first one you gave does not work 
.[hi]pp.  It was added to cmake to give simple globs like *.c *.cxx *.h, 
etc.


-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] Need help with GLOB expression

2009-03-29 Thread Bill Hoffman

Robert Dailey wrote:



But it does work! I've tested it several times with much success! I'm 
not sure what you're saying about *.c, *.cxx, and *.h. Could you 
explain? Also, I won't have access to a bash shell on Windows. I'd 
rather CMake just work instead of trying to find silly workarounds like 
this.


I'll put in the feature request for {} and at some point in the future 
it can be addressed. 
Can someone point me to a definition of what glob is supposed to have in 
it?  It seems to vary from php glob, perl glob, various different shell 
globs, etc.  I can not seem to find a definitive answer as to what a 
glob function is supposed to do, other than it is something shy of a 
regular expression.  The CMake one seems to do about the same as a bash 
shell as far as I can tell.



-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] Need help with GLOB expression

2009-03-29 Thread Bill Hoffman

Philip Lowman wrote:


I'll put in the feature request for {} and at some point in the
future it can be addressed.

Can someone point me to a definition of what glob is supposed to
have in it?  It seems to vary from php glob, perl glob, various
different shell globs, etc.  I can not seem to find a definitive
answer as to what a glob function is supposed to do, other than it
is something shy of a regular expression.  The CMake one seems to do
about the same as a bash shell as far as I can tell.


Here is bash's glob support
http://www.faqs.org/docs/abs/HTML/globbingref.html

MS-Dos and Windows are limited to '*' and '?'

Not sure about everyone else.  If CMake can support all of what Bash 
supports that probably would be above and beyond the call of duty.




So, I see no mention of {} in bash?

-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


[CMake] autoheader

2009-03-30 Thread Bill Hoffman
I have seen several requests for an autoheader type function to be added 
to CMake.  I have never used autoheader, but I gather it takes a list of 
variables and generates a config.h.in file automatically.  Does anyone 
on the list have experience with autoheader?   If so, what would a nice 
CMake api for something like this look like?


Thanks.

-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] autoheader

2009-03-30 Thread Bill Hoffman

Hendrik Sattler wrote:

Zitat von Bill Hoffman bill.hoff...@kitware.com:


I have seen several requests for an autoheader type function to be
added to CMake.  I have never used autoheader, but I gather it takes a
list of variables and generates a config.h.in file automatically.  Does
anyone on the list have experience with autoheader?   If so, what would
a nice CMake api for something like this look like?


Well, autoheader just takes the result of certain tests and prepares a 
file that is usable e.g. with configure_file(  @ONLY ). Usually, 
that contains much more than anyone needs or wants.
It addresses the problem of not having to keep to distinct lists of 
variables to replace (avoiding typos) but limits itself to a strict format.


A cmake-equalvalent could be a configure_file()-like function that takes 
a list of variables or mark variables and use all of them. There is no 
point in emulating the actual autoheader behaviour as that has the same 
problem as the configure script itself: an automatically created (and 
thus non-source) file in the source tree.
You can even make it better than autoheader and emit a file with 
#define/#undef for C and something with const variables for C++ (type 
safety) and something else for other supported languages. That would 
make it more complex but definitely better.




So, what would the API be?  I am thinking something that you just give a 
list of variables and a file name.


set(VARS HAS_A HAS_B HAS_C)
set(STRING_VARS STRING_A STRING_B)
cmake_autoheader(CMAKEDEFINE_VARS ${VARS}
 STRING_VARS ${STRING_VARS}
 HEADER config.h.in)


This would create:
config.h.in
#cmakedefine HAS_A
#cmakedefine HAS_B
#cmakedefine HAS_C
#define STRING_A @STRING_A@
#define STRING_B @STRING_B@


I think you could do this pretty easily in a function, and a command 
would not be needed.   Anyway, does the API look good?


-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] Need help with GLOB expression

2009-03-30 Thread Bill Hoffman

Robert Dailey wrote:

Just like regex, I don't believe there is an official standard for 
glob expressions. I think what you should do is implement the common 
intersection set of functionality just like everyone else does. You're 
trying to find the right way to do it when a right way has not been 
officially defined as far as I know.
I am thinking the right thing might be document what it does right now. 
 CMake GLOB does *,?, and [].   Then add a regular expression interface 
as well for more complicated things.  Of course if someone has a tested 
working patch for glob that adds {}, that might change things.


-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] Proper way to define a list

2009-03-30 Thread Bill Hoffman

Alexander Neundorf wrote:

On Monday 30 March 2009, Robert Dailey wrote:

Hi,
What's the proper way to define a list? Suppose I have 3 words: Foo, Bar,
and Baz. I want these 3 strings to be in a list called Stuff. Would I do
this:

set( Stuff Foo;Bar;Baz )

Is this correct? 


Yes, this is identical to
set( Stuff Foo;Bar;Baz )
and also to 
set( Stuff  Foo Bar Baz )




Actually set(var a;b;c) with the double quotes will create a string 
with literal ;'s in it...


-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] autoheader

2009-03-31 Thread Bill Hoffman

Marcel Loose wrote:

Hi Bill,

Wouldn't it be better if CMake kept track of these variables internally.
I mean, usually the HAS_X variables are the result of calls to
check_include_file() and check_function_exists(). The Autotools handle
this under the hood.
CMake might keep a list of these variables, possibly one per check_*()
function. Or is there a reason to let the user handle this explicitly by
specifying the list of HAS_X variables in the call to
cmake_autoheader()?



check_include_file does not even have to be used, there are lots of ways 
to come up with variables that might be useful in a configured header 
file. I don't really like magic behind the scene lists getting created. 
Someone could just use a macro for check_include_file that appends to a 
list if they wanted.


-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] autoheader

2009-03-31 Thread Bill Hoffman

James Bigler wrote:




If this feature comes to fruition, I would like the ability to specify 
which flags make it into what header.  In one project I worked on all 
our configuration defines were in a single header.  This caused 
extremely long recompiles if something happened to change the one 
autoheader.  We eventually broke it into multiple files, and got 
targeted recompiles.


I also like the idea of not having to have a configure.h.in 
http://configure.h.in file like Hendrik Sattler suggested (put these 
variables in this header here).



Do you have an API suggestion?   What should this look like?

-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] autoheader

2009-03-31 Thread Bill Hoffman

BRM wrote:

How about:


# Each variable can have a registered filter name - packages/programs/libraries 
would use their name
cmake_autoheader_add_variable(has_some_other_package, filter_name)
# user controls what the output file is
# User can generate a C #define method (default method if no language is 
specified)
cmake_autoheader(C, path/to/cmake/autoheader_output.h [filter_name_list])
#User can generate a C++ const methods
cmake_autoheader(CXX, path/to/cmake/autoheader_output.hpp [filter_name_list])

- if filter name list is not provided, all entries are entered into the header 
file
- if filter is list is provided:
 - if name listed and is preceeded by an exclamation (!) then that name is 
not entered
 - if name is listed then it is entered
 - if name is not listed, then it is not entered

Likely it would be good to have a parameter that would specify the default 
behavior of the filter list - enter or not enter - for names not listed.
I think a default of 'not enter' would be good if the list is being provided, 
and this could be overridden and then the list becomes a 'not enter' list.

So:

# package defines its own automatically
find_package(some package)
   if (some_package_found)
   - cmake_autoheader_add_variable(has_some_package, some_package)
...
# user can add it too
cmake_autoheader_add_variable(has_some_other_package, some_other_package)

# user controls what the output file is
# User can generate a C #define method (default method if no language is 
specified)
cmake_autoheader(C, path/to/cmake/autoheader_output.h some_other_package)
#User can generate a C++ const methods
cmake_autoheader(CXX, path/to/cmake/autoheader_output.hpp some_package)


just another 2 cents...


I am not sure where things would be stored in this API?  Seems to global

Maybe the autoheader should be some sort of target...

cmake_add_autoheader(C /path/to/cmake/autoheader_output.h)
cmake_add_autoheader_variable(/path/to/cmake/autoheader_output.h VAR)


-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


<    2   3   4   5   6   7   8   9   10   11   >