[CMake] cmake and stow: differing installation and runtime locations

2010-09-30 Thread Christoph Groth
Dear cmake experts,

I like to use GNU stow to install self-compiled packages on my system.
For this to work best, I have to be able to specify during package
configuration a different runtime location (the directory prefix the
package will "think" it is installed to) and installation location (the
directory prefix which will be actually used for installation).

This way I can install all the package files under the prefix
$HOME/stow/package-name and then tell stow to make symlinks to the
runtime location (prefix $HOME).

This procedure allows easy removal and replacement of packages.

I was not able to find out how to specify different installation and
runtime locations with cmake.  Any hints are warmly appreciated.

Thanks
Christoph

___
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 stow: differing installation and runtime locations

2010-09-30 Thread Michael Wild

On 30. Sep, 2010, at 10:51 , Christoph Groth wrote:

> Dear cmake experts,
> 
> I like to use GNU stow to install self-compiled packages on my system.
> For this to work best, I have to be able to specify during package
> configuration a different runtime location (the directory prefix the
> package will "think" it is installed to) and installation location (the
> directory prefix which will be actually used for installation).
> 
> This way I can install all the package files under the prefix
> $HOME/stow/package-name and then tell stow to make symlinks to the
> runtime location (prefix $HOME).
> 
> This procedure allows easy removal and replacement of packages.
> 
> I was not able to find out how to specify different installation and
> runtime locations with cmake.  Any hints are warmly appreciated.
> 
> Thanks
> Christoph

Why must your program know anything about the $HOME prefix? After all, it's 
only symlinked there...

Michael

--
There is always a well-known solution to every human problem -- neat, 
plausible, and wrong.
H. L. Mencken



PGP.sig
Description: This is a digitally signed message part
___
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] Overriding intel default compiler flags

2010-09-30 Thread Marcel Loose
On Wed, 2010-09-29 at 18:16 +0200, pellegrini wrote:
> Hello everybody,
> 
> I come back with a question I asked yesterday but that I surely 
> misformulated. In the meantime I turned around
> the problem all the day but still without any results ...
> 
> I would like to build my project using ifort fortran compiler with a
set 
> of compiler flags different from the
> ones set by default by cmake in the "Windows-ifort.cmake" file of the 
> distribution.
> 
> I was advised on the list to not introduce any specific compiler flags

> declaration in my CMakeLists.txt and to
> introduce in my Src directory a Compiler/Intel-Fortran.cmake file 
> storing the following compiler flags I would like to be
> the default ones:
> 
> SET(CMAKE_BUILD_TYPE_INIT Release)
> SET(CMAKE_Fortran_FLAGS_INIT "")
> SET(CMAKE_Fortran_FLAGS_DEBUG_INIT "/debug:full /check /traceback 
> /nologo")
> SET(CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "/O2 /nologo
/Qvec-report0")
> SET(CMAKE_Fortran_FLAGS_RELEASE_INIT "/O2 /nologo /Qvec-report0")
> SET(CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "/O2 /nologo
/traceback 
> /debug:full")
> 
>  Now my CMakeLists.txt file starts with:
> 
> cmake_minimum_required(VERSION 2.6.2)
> set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR})
> project(my_library Fortran)
> 
> Problem:
> in doing so, cmake actually parses my Intel-Fortran.cmake file but all

> the variables stored in there are subsequently replaced by the
> values stored in "Windows-ifort.cmake" during the "project" call. This

> does not happen when using the G95 to build my project because none
> of these variables are set in the Windows-G95-Fortran.cmake file (and 
> its dependancies).
> 
> Is that a known bug for intel fortran compiler ? Would you see any 
> work-around or should I introduce in the CMakeLists a conditional for
intel
> compiler breaking in that special case one of the cmake programming 
> rules ? !
> 
> thanks for your help
> 
> Eric
> 
> 
> 
Hi Eric,

It seems that both files are being included somehow; the latter
clobbering variables that were set in the former. I'm not an expert on
the compiler initialisation stuff and lots of things have changed
between 2.6 and 2.8. Which brings me to the following: your setting the
minimum required version to 2.6.2, however the Modules/Compiler
directory was introduced in 2.8. I'm not sure which version you're
actually using, but I assume you'll need 2.8 or higher for this to work.

Best regards,
Marcel Loose.


___
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 stow: differing installation and runtime locations

2010-09-30 Thread Christoph Groth
Michael Wild  writes:

> On 30. Sep, 2010, at 10:51 , Christoph Groth wrote:
>
>> I was not able to find out how to specify different installation and
>> runtime locations with cmake.
>
> Why must your program know anything about the $HOME prefix? After all,
> it's only symlinked there.

Some packages (e.g. ALPS http://alps.comp-phys.org/) write or even
compile-in the installation path into some of the installed files, for
the package to know where it is installed.

Christoph

___
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 specify -fpic ?

2010-09-30 Thread David Aldrich
Hi Michael

Thanks for your reply.

> The only difference between -fpic and -fPIC is that the latter has no limit
> on the size of the global offsets table and this is only relevant for the
> m68k, PowerPC and SPARC architectures (according to the GCC manual page). 

Yes, we aren't using those architectures.

> Are you using -fvisibility=hidden somewhere?

No.

> Is this option the only difference of the link commands?

Actually, the shared library linker commands are similar but the executable 
linker commands are quite different.

CMake:

/usr/bin/c++ -O3 -DNDEBUG -Wall -m64 -o myProj -rdynamic Kernel/libKernel.a 
-lpython2.4

Manual make:

g++ -o myProj -ldl -Wl,-whole-archive,-export-dynamic ../Kernel/libKernel.a  
-lboost_python-mt -lpython2.4 -Wl,--no-whole-archive

I will have to analyse these flags. Any thoughts on the use of 
-whole-archive/--no-whole-archive here please?

BR

David


___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] cmake and stow: differing installation and runtime locations

2010-09-30 Thread Michael Wild

On 30. Sep, 2010, at 11:11 , Christoph Groth wrote:

> Michael Wild  writes:
> 
>> On 30. Sep, 2010, at 10:51 , Christoph Groth wrote:
>> 
>>> I was not able to find out how to specify different installation and
>>> runtime locations with cmake.
>> 
>> Why must your program know anything about the $HOME prefix? After all,
>> it's only symlinked there.
> 
> Some packages (e.g. ALPS http://alps.comp-phys.org/) write or even
> compile-in the installation path into some of the installed files, for
> the package to know where it is installed.
> 
> Christoph

Yes, and that installation path should be $HOME/stow/package-name. After all, 
that's where all the real files are. This way, you can even run the executables 
even if they are not currently symlinked.

If you can't live with that, use

cmake -DCMAKE_INSTALL_PREFIX=$HOME /path/to/source
make
make install DESTDIR=$HOME/stow/package-name

Michael

--
There is always a well-known solution to every human problem -- neat, 
plausible, and wrong.
H. L. Mencken



PGP.sig
Description: This is a digitally signed message part
___
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 specify -fpic ?

2010-09-30 Thread Marcel Loose
On Thu, 2010-09-30 at 10:15 +0100, David Aldrich wrote:
> Hi Michael
> 
> Thanks for your reply.
> 
> > The only difference between -fpic and -fPIC is that the latter has
no limit
> > on the size of the global offsets table and this is only relevant
for the
> > m68k, PowerPC and SPARC architectures (according to the GCC manual
page). 
> 
> Yes, we aren't using those architectures.
> 
> > Are you using -fvisibility=hidden somewhere?
> 
> No.
> 
> > Is this option the only difference of the link commands?
> 
> Actually, the shared library linker commands are similar but the
executable linker commands are quite different.
> 
> CMake:
> 
> /usr/bin/c++ -O3 -DNDEBUG -Wall -m64 -o myProj -rdynamic
Kernel/libKernel.a -lpython2.4
> 
> Manual make:
> 
> g++ -o myProj -ldl -Wl,-whole-archive,-export-dynamic
../Kernel/libKernel.a  -lboost_python-mt -lpython2.4
-Wl,--no-whole-archive
> 
> I will have to analyse these flags. Any thoughts on the use of
-whole-archive/--no-whole-archive here please?
> 
> BR
> 
> David

See this yesterday's mail:
http://www.mail-archive.com/cmake@cmake.org/msg31781.html

HTH,
Marcel Loose.


___
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 specify -fpic ?

2010-09-30 Thread Michael Wild

On 30. Sep, 2010, at 11:15 , David Aldrich wrote:

> Hi Michael
> 
> Thanks for your reply.
> 
>> The only difference between -fpic and -fPIC is that the latter has no limit
>> on the size of the global offsets table and this is only relevant for the
>> m68k, PowerPC and SPARC architectures (according to the GCC manual page). 
> 
> Yes, we aren't using those architectures.
> 
>> Are you using -fvisibility=hidden somewhere?
> 
> No.
> 
>> Is this option the only difference of the link commands?
> 
> Actually, the shared library linker commands are similar but the executable 
> linker commands are quite different.
> 
> CMake:
> 
> /usr/bin/c++ -O3 -DNDEBUG -Wall -m64 -o myProj -rdynamic Kernel/libKernel.a 
> -lpython2.4
> 
> Manual make:
> 
> g++ -o myProj -ldl -Wl,-whole-archive,-export-dynamic ../Kernel/libKernel.a  
> -lboost_python-mt -lpython2.4 -Wl,--no-whole-archive
> 
> I will have to analyse these flags. Any thoughts on the use of 
> -whole-archive/--no-whole-archive here please?
> 
> BR
> 
> David

For one, you are missing -ldl. Add ${CMAKE_DL_LIBS} to your 
target_link_libraries call. The -whole-archive flag is pretty useless with 
executables (unless, you plan to use it as a library too, but that is 
outlandish). --export-dynamic may be also necessary, if your dlopen'ed 
libraries use symbols in your executable.

Michael

--
There is always a well-known solution to every human problem -- neat, 
plausible, and wrong.
H. L. Mencken



PGP.sig
Description: This is a digitally signed message part
___
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 specify -fpic ?

2010-09-30 Thread David Aldrich
Hi Michael
 
> For one, you are missing -ldl. Add ${CMAKE_DL_LIBS} to your
> target_link_libraries call. 

Thanks for pointing that out. It's in there now:

/usr/bin/c++ -O3 -DNDEBUG -Wall -m64 -o myProj -rdynamic Kernel/libKernel.a 
-ldl -lpython2.4

> --export-dynamic may be also necessary, if your dlopen'ed
> libraries use symbols in your executable.

I tried adding:

SET(CMAKE_EXE_EXPORTS_CXX_FLAG "-Wl,--export-dynamic")

But that made no difference to the link command. Am I doing the right thing?

David
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] CMake

2010-09-30 Thread Nicola Brisotto
Hi,
I use cmake with qt projects for desktop application. Recently I've been 
started developing for symbian.
I've found a generator for carbide but I use Qt Creator.
I would like to generate Makefile like qmake does and then build the project 
with the Symbian toolchain.
Qmake has also the support for build a sis package with the "smart installer" 
embedded, for signing app, etc. 
Can I do these tasks with cmake?


Last year at Qt dev days in Munich there was rumors about a collaboration 
between kitware and Qt Software to improve the integration between cmake and qt:
http://labs.qt.nokia.com/2009/10/12/to-make-or-not-to-make-qmake-and-beyond/
http://labs.qt.nokia.com/2009/10/14/to-make-or-not-to-make-qmake-and-beyond-redux/
Any News?

Best regards,
Nicola Brisotto
vcard







___
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 specify -fpic ?

2010-09-30 Thread David Aldrich
Hi

> I tried adding:
> 
> SET(CMAKE_EXE_EXPORTS_CXX_FLAG "-Wl,--export-dynamic")
> 
> But that made no difference to the link command. Am I doing the right thing?

Fixed this by doing:

SET(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")
...
SET_TARGET_PROPERTIES(zodiac PROPERTIES ENABLE_EXPORTS ON)

I now have:

/usr/bin/c++   -O3 -DNDEBUG -Wall -m64  -Wl,--export-dynamic   -o myProj  
Kernel/libKernel.a -ldl -lpython2.4

But I still have the shared library load error.

So now I need to try implementing -whole-archive/--no-whole-archive to see if 
that makes a difference.

Any hints how to do this please?

David

___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] How to specify -fpic ?

2010-09-30 Thread David Aldrich
Hi

Ok, by following the link to the wiki suggested by Michael Loose, I used:

target_link_libraries( myProj -Wl,-whole-archive Kernel -Wl,-no-whole-archive)

This has fixed my problem. The executable links and runs correctly.

My link command is now:

/usr/bin/c++   -O3 -DNDEBUG -Wall -m64  -Wl,--export-dynamic   -o myProj 
-Wl,-whole-archive Kernel/libKernel.a -Wl,-no-whole-archive -ldl -lpython2.4

I don't need portability so I think this is ok.

Michael Wild wrote:

> The -whole-archive flag is pretty useless with executables 
> (unless, you plan to use it as a library too, but that is 
> outlandish). --export-dynamic may be also necessary, if 
> your dlopen'ed libraries use symbols in your executable.

So my concern is now: am I being 'outlandish' ?  The dlopen'ed libraries do use 
functions in libKernel.a that is linked to the executable. Is this outlandish? 
Is there a better way?

Thanks for your help so far.

Best regards 

David 
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] How to specify -fpic ?

2010-09-30 Thread Michael Wild

On 30. Sep, 2010, at 13:05 , David Aldrich wrote:

> Hi
> 
> Ok, by following the link to the wiki suggested by Michael Loose, I used:
> 
> target_link_libraries( myProj -Wl,-whole-archive Kernel -Wl,-no-whole-archive)
> 
> This has fixed my problem. The executable links and runs correctly.
> 
> My link command is now:
> 
> /usr/bin/c++   -O3 -DNDEBUG -Wall -m64  -Wl,--export-dynamic   -o myProj 
> -Wl,-whole-archive Kernel/libKernel.a -Wl,-no-whole-archive -ldl -lpython2.4
> 
> I don't need portability so I think this is ok.
> 
> Michael Wild wrote:
> 
>> The -whole-archive flag is pretty useless with executables 
>> (unless, you plan to use it as a library too, but that is 
>> outlandish). --export-dynamic may be also necessary, if 
>> your dlopen'ed libraries use symbols in your executable.
> 
> So my concern is now: am I being 'outlandish' ?  The dlopen'ed libraries do 
> use functions in libKernel.a that is linked to the executable. Is this 
> outlandish? Is there a better way?

The "outlandish" referred to using an executable also as a library, so you're 
fine :-) But I think I found the reason for why you need this -whole-archive 
flag: Since your executable doesn't use all of the functions in the Kernel 
library, the linker throws them away. This results in your dlopen'ed functions 
to fail.

So, the options are:

- use -whole-archive as you do now
- make the Kernel library shared
- link the dlopen'ed libraries against Kernel

Michael




PGP.sig
Description: This is a digitally signed message part
___
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 specify -fpic ?

2010-09-30 Thread David Aldrich
Hi Michael

> So, the options are:
> 
> - use -whole-archive as you do now
> - make the Kernel library shared
> - link the dlopen'ed libraries against Kernel

Thanks very much - I understand. I think I will keep the -whole-archive method.

However, now I'm worried about how I link in the Python library:

/usr/bin/c++ -O3 -DNDEBUG -Wall -m64 -o myProj -rdynamic -Wl,-whole-archive 
Kernel/libKernel.a -Wl,-no-whole-archive -ldl -lpython2.4

The dlopen'ed libraries may use the Python library. I guess I could include it 
in the -whole-archive part, but perhaps it would be better to link each shared 
library against Python. Would you agree?

Sorry that I am now off topic w.r.t cmake.

By the way, I think I am pretty much there with changing our build system from 
manually coded makefiles to cmake. I like cmake!  Thanks for all your help in 
getting there.  The support on this list is excellent.

Best regards 

David 

> -Original Message-
> From: Michael Wild [mailto:them...@gmail.com]
> Sent: 30 September 2010 12:20
> To: David Aldrich
> Cc: cmake@cmake.org
> Subject: Re: [CMake] How to specify -fpic ?
> 
> 
> On 30. Sep, 2010, at 13:05 , David Aldrich wrote:
> 
> > Hi
> >
> > Ok, by following the link to the wiki suggested by Michael Loose, I used:
> >
> > target_link_libraries( myProj -Wl,-whole-archive Kernel
> > -Wl,-no-whole-archive)
> >
> > This has fixed my problem. The executable links and runs correctly.
> >
> > My link command is now:
> >
> > /usr/bin/c++   -O3 -DNDEBUG -Wall -m64  -Wl,--export-dynamic   -o myProj -
> Wl,-whole-archive Kernel/libKernel.a -Wl,-no-whole-archive -ldl -lpython2.4
> >
> > I don't need portability so I think this is ok.
> >
> > Michael Wild wrote:
> >
> >> The -whole-archive flag is pretty useless with executables (unless,
> >> you plan to use it as a library too, but that is outlandish).
> >> --export-dynamic may be also necessary, if your dlopen'ed libraries
> >> use symbols in your executable.
> >
> > So my concern is now: am I being 'outlandish' ?  The dlopen'ed libraries do
> use functions in libKernel.a that is linked to the executable. Is this
> outlandish? Is there a better way?
> 
> The "outlandish" referred to using an executable also as a library, so you're
> fine :-) But I think I found the reason for why you need this -whole-archive
> flag: Since your executable doesn't use all of the functions in the Kernel
> library, the linker throws them away. This results in your dlopen'ed
> functions to fail.
> 
> So, the options are:
> 
> - use -whole-archive as you do now
> - make the Kernel library shared
> - link the dlopen'ed libraries against Kernel
> 
> Michael
> 

___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] How to specify -fpic ?

2010-09-30 Thread Michael Wild
On 30. Sep, 2010, at 13:30 , David Aldrich wrote:

> Hi Michael
> 
>> So, the options are:
>> 
>> - use -whole-archive as you do now
>> - make the Kernel library shared
>> - link the dlopen'ed libraries against Kernel
> 
> Thanks very much - I understand. I think I will keep the -whole-archive 
> method.
> 
> However, now I'm worried about how I link in the Python library:
> 
> /usr/bin/c++ -O3 -DNDEBUG -Wall -m64 -o myProj -rdynamic -Wl,-whole-archive 
> Kernel/libKernel.a -Wl,-no-whole-archive -ldl -lpython2.4
> 
> The dlopen'ed libraries may use the Python library. I guess I could include 
> it in the -whole-archive part, but perhaps it would be better to link each 
> shared library against Python. Would you agree?
> 

Unless the python library is static (which it AFAIK almost never is) you should 
be safe.

> Sorry that I am now off topic w.r.t cmake.
> 
> By the way, I think I am pretty much there with changing our build system 
> from manually coded makefiles to cmake. I like cmake!  Thanks for all your 
> help in getting there.  The support on this list is excellent.

;-) well, CMake does have its quirks and dark corners, but in general I find it 
to be much preferable over anything else I've ever seen so far...

Michael

> 
> Best regards 
> 
> David 
> 
>> -Original Message-
>> From: Michael Wild [mailto:them...@gmail.com]
>> Sent: 30 September 2010 12:20
>> To: David Aldrich
>> Cc: cmake@cmake.org
>> Subject: Re: [CMake] How to specify -fpic ?
>> 
>> 
>> On 30. Sep, 2010, at 13:05 , David Aldrich wrote:
>> 
>>> Hi
>>> 
>>> Ok, by following the link to the wiki suggested by Michael Loose, I used:
>>> 
>>> target_link_libraries( myProj -Wl,-whole-archive Kernel
>>> -Wl,-no-whole-archive)
>>> 
>>> This has fixed my problem. The executable links and runs correctly.
>>> 
>>> My link command is now:
>>> 
>>> /usr/bin/c++   -O3 -DNDEBUG -Wall -m64  -Wl,--export-dynamic   -o myProj -
>> Wl,-whole-archive Kernel/libKernel.a -Wl,-no-whole-archive -ldl -lpython2.4
>>> 
>>> I don't need portability so I think this is ok.
>>> 
>>> Michael Wild wrote:
>>> 
 The -whole-archive flag is pretty useless with executables (unless,
 you plan to use it as a library too, but that is outlandish).
 --export-dynamic may be also necessary, if your dlopen'ed libraries
 use symbols in your executable.
>>> 
>>> So my concern is now: am I being 'outlandish' ?  The dlopen'ed libraries do
>> use functions in libKernel.a that is linked to the executable. Is this
>> outlandish? Is there a better way?
>> 
>> The "outlandish" referred to using an executable also as a library, so you're
>> fine :-) But I think I found the reason for why you need this -whole-archive
>> flag: Since your executable doesn't use all of the functions in the Kernel
>> library, the linker throws them away. This results in your dlopen'ed
>> functions to fail.
>> 
>> So, the options are:
>> 
>> - use -whole-archive as you do now
>> - make the Kernel library shared
>> - link the dlopen'ed libraries against Kernel
>> 
>> Michael
>> 
> 

--
There is always a well-known solution to every human problem -- neat, 
plausible, and wrong.
H. L. Mencken



PGP.sig
Description: This is a digitally signed message part
___
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 specify -fpic ?

2010-09-30 Thread Marcel Loose
On Thu, 2010-09-30 at 12:30 +0100, David Aldrich wrote:
> Hi Michael
> 
> > So, the options are:
> > 
> > - use -whole-archive as you do now
> > - make the Kernel library shared
> > - link the dlopen'ed libraries against Kernel
> 
> Thanks very much - I understand. I think I will keep the
-whole-archive method.
> 
> However, now I'm worried about how I link in the Python library:
> 
> /usr/bin/c++ -O3 -DNDEBUG -Wall -m64 -o myProj -rdynamic
-Wl,-whole-archive Kernel/libKernel.a -Wl,-no-whole-archive -ldl
-lpython2.4
> 
> The dlopen'ed libraries may use the Python library. I guess I could
include it in the -whole-archive part, but perhaps it would be better to
link each shared library against Python. Would you agree?
> 
> Sorry that I am now off topic w.r.t cmake.
> 
> By the way, I think I am pretty much there with changing our build
system from manually coded makefiles to cmake. I like cmake!  Thanks for
all your help in getting there.  The support on this list is excellent.
> 
> Best regards 
> 
> David 
> 
Hi David,

Considering all the hassle you have to go through. Why don't you build a
shared libKernel.so library and let the runtime loader fix all the
issues you're now trying to solve compile/link time?

Best regards,
Marcel Loose.

___
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] Visual Studio 2010 generator and custom command

2010-09-30 Thread elizabeta petreska
This works. Thanks. Save me from a lot of trouble.

On Wed, Sep 29, 2010 at 11:07 PM, Bill Hoffman wrote:

> On 9/29/2010 11:02 AM, elizabeta petreska wrote:
>
>> This is the link to bug report
>> http://www.paraview.org/Bug/view.php?id=11274
>>
>>
> OK, I have fixed the issue in CMake next.
>
> To get around the problem you can use MAIN_DEPENDENCY like this:
>
>
> ADD_CUSTOM_COMMAND(
>  OUTPUT "${PROJECT_BINARY_DIR}/$(ConfigurationName)/generated.txt"
>  COMMAND ${CMAKE_COMMAND} -E copy
>  "${PROJECT_SOURCE_DIR}/myfile.txt"
>  "${PROJECT_BINARY_DIR}/$(ConfigurationName)/generated.txt"
>  DEPENDS "${PROJECT_SOURCE_DIR}/myfile.txt"
>  MAIN_DEPENDENCY "${PROJECT_SOURCE_DIR}/myfile.txt"
>
>  )
>
> -Bill
> ___
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] CMake

2010-09-30 Thread John Drescher
> I use cmake with qt projects for desktop application. Recently I've been
> started developing for symbian.
> I've found a generator for carbide but I use Qt Creator.
> I would like to generate Makefile like qmake does and then build the project
> with the Symbian toolchain.
> Qmake has also the support for build a sis package with the "smart
> installer" embedded, for signing app, etc.
> Can I do these tasks with cmake?
>
> Last year at Qt dev days in Munich there was rumors about a collaboration
> between kitware and Qt Software to improve the integration between cmake and
> qt:
> http://labs.qt.nokia.com/2009/10/12/to-make-or-not-to-make-qmake-and-beyond/
> http://labs.qt.nokia.com/2009/10/14/to-make-or-not-to-make-qmake-and-beyond-redux/
> Any News?

Recent versions of Qtcreator support using cmake directly but I don't
think that is what you are looking for.

John
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] CMakeDetermineVSServicePack.cmake support for vs2010

2010-09-30 Thread Philip Lowman
Aaron,

Thanks for posting.  Could you open a new bug report and attach your patch
to it?

On Wed, Sep 29, 2010 at 9:33 PM,  wrote:

>  *Hi all.  I noticed that CMakeDetermineVSServicePack.cmake only supports
> vs2005, vs2005 sp1, vs2008, vs2008 sp1.  I wanted to use it for vs2010.*
>
> * *
>
> *I looked for a bug but the only one I found was the one that resulted in
> the scripts creation: http://public.kitware.com/Bug/view.php?id=8803*
>
> * *
>
> *I have a patch to fix it: (also attached)*
>
> * *
>
>  CMakeDetermineVSServicePack.cmake   2010-06-28 09:42:36.0
> -0500*
>
> *--- CMakeDetermineVSServicePackWith2010.cmake   2010-09-29
> 20:26:20.530212900 -0500*
>
> *
>
>  47,52 *
>
> *--- 47,54 *
>
> * set(_version "vc90")*
>
> * elseif(${_cl_version} VERSION_EQUAL "15.00.30729.01")*
>
> * set(_version "vc90sp1")*
>
> *+elseif(${_cl_version} VERSION_EQUAL "16.00.30319.01")*
>
> *+set(_version "vc100")*
>
> * else()*
>
> * set(_version "")*
>
> * endif()*
>
> * *
>
> *Should I open a new bug for this and add a patch to it, or reopen the old
> bug (feature request) with this patch?*
>
> * *
>
> *Thanks!*
>
> * *
>
> *--aaron*
>
> * *
>
> *Aaron Meadows*
> Software Engineer
>
> *Thomson Reuters*
>
> Phone: 314.468.3530
> Mobile: 636.541.6139
> aaron.mead...@thomsonreuters.com
> thomsonreuters.com
>
>
>
> This email was sent to you by Thomson Reuters, the global news and
> information company.
> Any views expressed in this message are those of the individual sender,
> except where the sender specifically states them to be the views of Thomson
> Reuters.
>
> ___
> 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
>



-- 
Philip Lowman
___
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] Re-configuration, ExternalProjects, etc.

2010-09-30 Thread Cliff Yapp
On 09/30/2010 01:50 AM, Michael Wild wrote:
>
>> 2.  Because ExternalProject_Add does a full build and install prior to
>> building other targets (which I think is fine) I sometimes put myself
>> in the annoying position of building the whole system, then realizing
>> I forgot to clean an old build out of the install directory prior to
>> performing the build.  Then I do the classic rm -rf to clear it, only
>> to realize I just wiped out all of my ExternalProject install results.
>> This wouldn't be a problem, except I can't find a way to get the
>> build logic to check that the external projects are installed when
>> make install is run and re-do the install if necessary - they think
>> they're done because all steps were completed.  Admittedly this is a
>> minor annoyance, but if there is a way to avoid having to re-do  the
>> whole thing because I messed up clearing out the install directory
>> ahead of time I would be grateful :-)
>> 
> Don't install external projects directly into CMAKE_INSTALL_PREFIX, that's a 
> recipe for disaster (after all, someone might want to use DESTDIR when doing 
> a "make install"!) Instead install somewhere inside CMAKE_BINARY_DIR and then 
> use the standard CMake facilities to install exactly what your project 
> requires to run into CMAKE_INSTALL_PREFIX, e.g. using the BundleUtilities. In 
> my project I have a some macros and functions which handle all of this for 
> me, see here: 
> http://freefoam.git.sourceforge.net/git/gitweb.cgi?p=freefoam/freefoam;f=CMake/FOAMThirdPartyUtilities.cmake;hb=pu
>  (start with the foam_thirdparty_option function).
>   

Hmm, that's a very interesting approach - I hadn't thought of that. 
Three concerns.  One, it ends up creating build and install logic
specific to the external library that has to be maintained each time the
external lib is updated, which is a maintainance burden.  I guess this
might be worked around by copying the install dir wholesale...  Two,
what happens if the library has some awareness of its install location
and is not relocatable?  Can CMake work its RPATH magic on the third
party libraries somehow? Three, FOAMThirdPartyUtilities.cmake is GPL and
BRL-CAD has to stay LGPL-or-freer... - any chance it could be
re-licensed under the same terms as CMake?  (Just the one file
obviously, not all of FOAM...)


>> 3.  I'm in the process of writing CMake macros to replace things like
>> AC_HEADER_STDC, AC_HEADER_DIRENT, etc. - is there already a macro
>> package that defines CMAKE_HEADER_STDC and friends to replace these
>> common autoconf macros?
>> 
> No. Using AC_HEADER_STDC is no longer required, there is virtually no 
> system/compiler which doesn't fulfill that one (the Autoconf manual says 
> "This macro is obsolescent, as current systems have conforming header files. 
> New programs need not use this macro.") The same goes for AC_HEADER_DIRENT. 
> Most of these standard macros can be safely skipped...
>   

Hmm, that's a point - I'll have to ask our project lead about it.

Cheers, and thanks!
CY
___
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

2010-09-30 Thread Pau Garcia i Quiles
On Thu, Sep 30, 2010 at 12:43 PM, Nicola Brisotto
 wrote:
> Hi,
> I use cmake with qt projects for desktop application. Recently I've been
> started developing for symbian.
> I've found a generator for carbide but I use Qt Creator.
> I would like to generate Makefile like qmake does and then build the project
> with the Symbian toolchain.
> Qmake has also the support for build a sis package with the "smart
> installer" embedded, for signing app, etc.
> Can I do these tasks with cmake?

Is it possible? Yes, it is. How good is support for it, especially
with QtCreator? I have no idea. Take a look at:

http://www.paraview.org/Wiki/CMake_Cross_Compiling
http://www.itk.org/Wiki/Symbian_Carbide_Generator

Support for Maemo (Nokia N900) and Meego (replacement for Maemo) is
much better. The Kolab Consortium has ported KDEPIM to Maemo and
Windows CE and they are using CMake and cross-compiling:

http://steveire.wordpress.com/2010/04/30/kdepim-on-mobile-whats-going-on/
http://ftp.kolab.org/local/maemo/README.html

-- 
Pau Garcia i Quiles
http://www.elpauer.org
(Due to my workload, I may need 10 days to answer)
___
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, JOM and multiple top-level targets

2010-09-30 Thread Óscar Fuentes
Bill Hoffman 
writes:

> On 9/24/2010 1:03 PM, Óscar Fuentes wrote:
>> JOM does a nice work compiling multiple files of the same top-level
>> product (.exe, .dll etc) but for some reason it doesn't build multiple
>> top-level targets in parallel. Here I have a project that generates
>> several independent dlls, each based on one or two source files. JOM
>> wont build DLL_N+1 until DLL_N is finished. This means that only one cpu
>> core is working for a long part of the build.
>>
>> Is this a limitation of JOM or an oversight of CMake?
>>
>
> This is a job limitation.

What this means?

___
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, JOM and multiple top-level targets

2010-09-30 Thread Bill Hoffman

On 9/30/2010 10:03 AM, Óscar Fuentes wrote:


Is this a limitation of JOM or an oversight of CMake?



This is a job limitation.


What this means?


It means my spell checker turned jom into job... :)

This is a limitation of jom, I know the maintainer of jom said he wanted 
to work on this as a feature, but I don't think he has done it yet...


-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, JOM and multiple top-level targets

2010-09-30 Thread Óscar Fuentes
Bill Hoffman 
writes:

[snip]

> This is a limitation of jom, I know the maintainer of jom said he
> wanted to work on this as a feature, but I don't think he has done it
> yet...

Thanks Bill.

I'll open a bug report on the Qt bug tracker just to let him know that
someone cares about that feature.

___
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] CMakeDetermineVSServicePack.cmake support for vs2010

2010-09-30 Thread aaron.meadows
Done.  Issue number 11279.
[http://public.kitware.com/Bug/view.php?id=11279]

 

I also noted that the script could be improved by calling the compiler
with the '/?' switch and parsing it's output instead of parsing the
output from try_compile'ing a simple c file it writes.  That would make
it quite a bit faster.

 

Aaron C. Meadows 



From: philiplow...@gmail.com [mailto:philiplow...@gmail.com] On Behalf
Of Philip Lowman
Sent: Thursday, September 30, 2010 7:25 AM
To: Meadows, Aaron C.
Cc: cmake@cmake.org
Subject: Re: [CMake] CMakeDetermineVSServicePack.cmake support for
vs2010

 

Aaron,

 

Thanks for posting.  Could you open a new bug report and attach your
patch to it?

 

On Wed, Sep 29, 2010 at 9:33 PM, 
wrote:

Hi all.  I noticed that CMakeDetermineVSServicePack.cmake only supports
vs2005, vs2005 sp1, vs2008, vs2008 sp1.  I wanted to use it for vs2010.

 

I looked for a bug but the only one I found was the one that resulted in
the scripts creation: http://public.kitware.com/Bug/view.php?id=8803

 

I have a patch to fix it: (also attached)

 

*** CMakeDetermineVSServicePack.cmake   2010-06-28 09:42:36.0
-0500

--- CMakeDetermineVSServicePackWith2010.cmake   2010-09-29
20:26:20.530212900 -0500

***

*** 47,52 

--- 47,54 

 set(_version "vc90")

 elseif(${_cl_version} VERSION_EQUAL "15.00.30729.01")

 set(_version "vc90sp1")

+elseif(${_cl_version} VERSION_EQUAL "16.00.30319.01")

+set(_version "vc100")

 else()

 set(_version "")

 endif()

 

Should I open a new bug for this and add a patch to it, or reopen the
old bug (feature request) with this patch?

 

Thanks!

 

--aaron

 

Aaron Meadows
Software Engineer

Thomson Reuters

Phone: 314.468.3530
Mobile: 636.541.6139
aaron.mead...@thomsonreuters.com
thomsonreuters.com

 


This email was sent to you by Thomson Reuters, the global news and
information company.
Any views expressed in this message are those of the individual sender,
except where the sender specifically states them to be the views of
Thomson Reuters. 


___
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




-- 
Philip Lowman



This email was sent to you by Thomson Reuters, the global news and information 
company.
Any views expressed in this message are those of the individual sender, except 
where the sender specifically states them to be the views of Thomson Reuters.

___
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 and non-default compile options

2010-09-30 Thread Ross, Thomas
Hi,

until recently I was pretty sure that CMake uses default compiler /
linker options that you usually get when setting up a VisualStudio
project by hand.

I was proven wrong after our latest code changes killed the compiler
with 'compiler is out of heap space' error messages. The problem, as the
explanation for that error message suggest, is the '/Zm1000' compiler
option CMake forces. Removing that option from the compile flags fixed
the problem.

Another option in this category is the linker flag '/STACK:1000'
that CMake forces.

We now use string replace to get rid of these options, that IMHO
shouldn't be there in the first place.

Even the biggest projects we currently build on VS2005+2008 don't need
any of these options.

So the question is, why does CMake force these flags? Is this some old
behaviour that was once necessary in older VisualStudio versions?

Regards,
Thomas




Rheinmetall Defence Electronics GmbH
Brüggeweg 54 - D-28309 Bremen - Tel +49 421 457-01 - Fax +49 421 457-2900 - 
Sitz der Gesellschaft: Bremen - Register: Amtsgericht Bremen, HRB 9659
Commerzbank AG, Bremen (BLZ 290 400 90) 102213600
Aufsichtsratsvorsitzender: Heinz Dresia - Geschäftsführung: Luitjen Ennenga, 
Dr. Michael Greth, Georg Morawitz, Ulrich Sasse - www.rheinmetall-defence.com




___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

[CMake] file COPY/INSTALL doesn't overwrite existing files?

2010-09-30 Thread Guillaume Duhamel
Hi,

I'm trying to use "file(COPY ..." during the build of one of my project.
The documentation says that files get overwritten according to their
timestamps, but it seems they just never get overwritten.

For instance, with this CMakeLists :

===
project(test)
cmake_minimum_required(VERSION 2.8)
file(INSTALL dir DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
file(INSTALL bar.txt DESTINATION ${test_BINARY_DIR}/dir)
===

and those steps :

$ mkdir build && cd build && cmake .. && make
$ echo "something new" >> ../bar.txt
$ make

bar.txt doesn't get overwritten after the second make.

Is there anything I'm doing wrong or do I have to detect existing files
and remove them before the copy?

Guillaume
___
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

2010-09-30 Thread Nicola Brisotto
I use Qt creator with cmake for desktop application and it work well. It has 
support for out of source build, it populate the project browser with you 
source and header, etc
My main issue is not a full Qt Creator integration. My first need is build with 
cmake from console.

Currently Qt support 2 toolchain: abdl and raptor.



I



> http://www.paraview.org/Wiki/CMake_Cross_Compiling

After reading Wiley - "Porting to the Symbian Platform Open Mobile Development 
in C and C++", chapter 2.5.2 and 2.5.3 and some tutorial I understand that abdl 
uses 3 kind of file:
1) one bdl.inf 
2) one or more *.mpp file
3) optionally a pkg file

You process these files with a tool named 'bldmake' and will obtain a batch 
file ('ABLD.BAT') and some makefiles that will build the application for you.

This tool exists mainly because a Symbian application is usually built for many 
platforms: 
the emulator, using a Microsoft X86 compiler, 
as well as the real device using a gcc-derived ARM compiler. 

The bldmake saves you from writing specially crafted makefiles for these 
compilers and make utilities; also it allows for building many targets with 
just a single command.
From the bld.inf, type:
 > bldmake bldfiles
Of course, you must have the PATH set correctly for the installation of the SDK 
you are using. This command will look for the bld.inf, process it and the 
related *.mmp, then generate a BATCH file named ABLD.BAT. Now you have all you 
need to build your applications. Simply type:
 > abld build
This will build your application in all the available flavors.
Note that the target files are stored in a very deep directory structure, and 
you are building both in debug and release versions for WINS (windows), ARM4 
(plain arm), ARMI (speed optimized arm), THUMB (size optimized ARM)! 
But you can choose to build for only one target, and since it take less time, 
you usually build ONLY for one version of one target. For example, to build for 
the emulator only in the debug version, or for the device, optimized for size, 
in release version, you type:
 > abld build wins udeb
 > abld buind thumb urel
Building for Windows is enough to start the emulator and run the application in 
the emulated environment. Application files are compiled and placed straight 
where the emulator can run it: no need to copy them in the right location. 

But for real devices, you have to pack everything in a .sis file for 
installation, send it to the phone and install the application. You are 
required to write a .pkg file to describe the installer, and then create it 
with:
 > makesis file.pkg

this is a small example:
Here is a simple example of a bld.inf file:

PRJ_PLATFORMS
DEFAULT 
PRJ_EXPORTS 
..\inc\SoundTouch.h 
..\inc\FIFOSamplePipe.h 
..\inc\FIFOSampleBuffer.h 
..\inc\STTypes.h 
PRJ_MMPFILES 
SoundTouch.mmp

This specifies that the project should generate makefiles for the default 
platforms (currently WINSCW, ARMV5 and GCCE), export four header files and 
build a single component which is specified in SoundTouch.mmp. The 
corresponding MMP file looks like this:

TARGET SoundTouch.dll
TARGETTYPE   dll
UID   0x108D 0x0839739D
CAPABILITY None
USERINCLUDE ..\inc
SYSTEMINCLUDE \epoc32\include \epoc32\include\stdapis
SYSTEMINCLUDE \epoc32\include\stdapis\sys 
SYSTEMINCLUDE \epoc32\include\stdapis\stlport 
SOURCEPATH ..\src 
SOURCE SoundTouch.cpp AAFilter.cpp
SOURCEFIFOSampleBuffer.cpp FIRFilter.cpp
SOURCERateTransposer.cpp TDStretch.cpp
LIBRARYeuser.lib
LIBRARYlibc.lib libm.lib libstdcpp.lib

Do we need a custom generator to recreate this process with cmake?


> http://www.itk.org/Wiki/Symbian_Carbide_Generator
I'm not sure but this generator produce a project for carbide so I need carbide 
to build a project. Is it right?

Now there is alternative tool chains called Raptor that claim to be compatible 
with the bld/mmp interface. When take a look at will advice.

___
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 specify -fpic ?

2010-09-30 Thread David Aldrich
Hi Marcel

> Considering all the hassle you have to go through. Why don't you build a
> shared libKernel.so library and let the runtime loader fix all the
> issues you're now trying to solve compile/link time?

Thanks for your suggestion. I'm not sure how that would work out. At start-up 
the runtime linker would only need to resolve issues between main.cpp, 
libKernel.so and libPython.so. Later I will dlopen some more libraries that 
need libKernel. Would the runtime linker handle that?

BR

David
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Re-configuration, ExternalProjects, etc.

2010-09-30 Thread Michael Wild

On 30. Sep, 2010, at 15:24 , Cliff Yapp wrote:

> On 09/30/2010 01:50 AM, Michael Wild wrote:
>> 
>>> 2.  Because ExternalProject_Add does a full build and install prior to
>>> building other targets (which I think is fine) I sometimes put myself
>>> in the annoying position of building the whole system, then realizing
>>> I forgot to clean an old build out of the install directory prior to
>>> performing the build.  Then I do the classic rm -rf to clear it, only
>>> to realize I just wiped out all of my ExternalProject install results.
>>> This wouldn't be a problem, except I can't find a way to get the
>>> build logic to check that the external projects are installed when
>>> make install is run and re-do the install if necessary - they think
>>> they're done because all steps were completed.  Admittedly this is a
>>> minor annoyance, but if there is a way to avoid having to re-do  the
>>> whole thing because I messed up clearing out the install directory
>>> ahead of time I would be grateful :-)
>>> 
>> Don't install external projects directly into CMAKE_INSTALL_PREFIX, that's a 
>> recipe for disaster (after all, someone might want to use DESTDIR when doing 
>> a "make install"!) Instead install somewhere inside CMAKE_BINARY_DIR and 
>> then use the standard CMake facilities to install exactly what your project 
>> requires to run into CMAKE_INSTALL_PREFIX, e.g. using the BundleUtilities. 
>> In my project I have a some macros and functions which handle all of this 
>> for me, see here: 
>> http://freefoam.git.sourceforge.net/git/gitweb.cgi?p=freefoam/freefoam;f=CMake/FOAMThirdPartyUtilities.cmake;hb=pu
>>  (start with the foam_thirdparty_option function).
>> 
> 
> Hmm, that's a very interesting approach - I hadn't thought of that. 
> Three concerns.  One, it ends up creating build and install logic
> specific to the external library that has to be maintained each time the
> external lib is updated, which is a maintainance burden.

But with your current setup the following will fail:

cmake -DCMAKE_INSTALL_PREFIX=/usr /path/to/source
make # BOOM - tries to install into /usr where you're not allowed to write
make install DESTDIR=/path/to/destdir # BOOM - the external stuff is not in 
DESTDIR 

About the maintenance, I wouldn't worry too much. If you update the external 
library, you're probably going to change a lot more than just the CMake code...

> I guess this
> might be worked around by copying the install dir wholesale...  Two,
> what happens if the library has some awareness of its install location
> and is not relocatable?  Can CMake work its RPATH magic on the third
> party libraries somehow?

If you're external libraries are shared objects, BundleUtilities takes care of 
everything, even adjusting the RPATH (or install_name on Mac). Only sad thing 
is that the documentation of that very useful and powerful module is currently 
utterly lacking..

> Three, FOAMThirdPartyUtilities.cmake is GPL and
> BRL-CAD has to stay LGPL-or-freer... - any chance it could be
> re-licensed under the same terms as CMake?  (Just the one file
> obviously, not all of FOAM...)
> 

You'd need a bit more than just that single file (some functions are in 
FOAMUtilites.cmake). If you want to, I don't see any problem with you copying 
CMake-code from the FreeFOAM project. It's all been written by me, so go ahead. 
The only thing I ask you to do is to rename the functions, macros, variables 
and properties (mainly removing the FOAM and foam prefixes) and if you don't 
rework the stuff significantly include a comment attributing me and FreeFOAM 
(e.g. "inspired by ..."). If you simply use my code as an inspiration on how to 
approach things, don't bother with that ;-)

> 
>>> 3.  I'm in the process of writing CMake macros to replace things like
>>> AC_HEADER_STDC, AC_HEADER_DIRENT, etc. - is there already a macro
>>> package that defines CMAKE_HEADER_STDC and friends to replace these
>>> common autoconf macros?
>>> 
>> No. Using AC_HEADER_STDC is no longer required, there is virtually no 
>> system/compiler which doesn't fulfill that one (the Autoconf manual says 
>> "This macro is obsolescent, as current systems have conforming header files. 
>> New programs need not use this macro.") The same goes for AC_HEADER_DIRENT. 
>> Most of these standard macros can be safely skipped...
>> 
> 
> Hmm, that's a point - I'll have to ask our project lead about it.

Otherwise it's pretty simple to emulate those checks with the CheckIncludeFiles 
module.

> 
> Cheers, and thanks!
> CY


Cheers

Michael

--
There is always a well-known solution to every human problem -- neat, 
plausible, and wrong.
H. L. Mencken



PGP.sig
Description: This is a digitally signed message part
___
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

Re: [CMake] How to specify -fpic ?

2010-09-30 Thread Michael Wild

On 30. Sep, 2010, at 18:10 , David Aldrich wrote:

> Hi Marcel
> 
>> Considering all the hassle you have to go through. Why don't you build a
>> shared libKernel.so library and let the runtime loader fix all the
>> issues you're now trying to solve compile/link time?
> 
> Thanks for your suggestion. I'm not sure how that would work out. At start-up 
> the runtime linker would only need to resolve issues between main.cpp, 
> libKernel.so and libPython.so. Later I will dlopen some more libraries that 
> need libKernel. Would the runtime linker handle that?
> 
> BR
> 
> David



yes, because shared when a shared library is created, ALL symbols get included 
(provided they are exported, which is the default on *NIX systems).

Michael

--
There is always a well-known solution to every human problem -- neat, 
plausible, and wrong.
H. L. Mencken



PGP.sig
Description: This is a digitally signed message part
___
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] undefining preprocessor macros

2010-09-30 Thread Steven Wilson
Using set_target_properties() we can set the COMPILE_DEFINITIONS target
property to easily define preprocessor macros for our build.   Is there a
mechanism to undefine preprocessor macros (equivalent to -U for many Unix
compilers or /U for Microsoft's compilers)?

Thanks,

Steve
___
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] undefining preprocessor macros

2010-09-30 Thread Ryan Pavlik
 Either add it to your COMPILE_FLAGS, or create/configure a header file 
with #undef lines.


Ryan

On 09/30/2010 01:18 PM, Steven Wilson wrote:
Using set_target_properties() we can set the COMPILE_DEFINITIONS 
target property to easily define preprocessor macros for our build.   
Is there a mechanism to undefine preprocessor macros (equivalent to -U 
for many Unix compilers or /U for Microsoft's compilers)?


Thanks,

Steve


___
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


--
Ryan Pavlik
HCI Graduate Student
Virtual Reality Applications Center
Iowa State University

Member, ACM and ACM SIGCHI
Member, ASME

http://academic.cleardefinition.com

___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] Re-configuration, ExternalProjects, etc.

2010-09-30 Thread Pau Garcia i Quiles
On Wed, Sep 29, 2010 at 8:09 PM, Clifford Yapp  wrote:
> After working for a while at converting a project to CMake, I would
> like to ask a question/suggest a feature for CMake.
>
> The project I am working on (BRL-CAD) includes various external
> libraries that it relies on on a subdirectory, with a variety of
> options for enabling and disabling use of the local and system copies.
>  One of my biggest challenges when expressing our build logic in CMake
> was supporting the ability to "turn on" and "turn off" these third
> party builds cleanly and robustly.  I have (more or less) managed to
> get this working with macros (although I have yet to set it up for
> MSVC - gulp), but I have a few quirks I'd like to ask for opinions on:
>
> 1. CMake has an extremely annoying habit of looking for libraries in
> the CMAKE_INSTALL_PREFIX directory after it is defined and picking up
> old versions of libraries from previous make install results in those
> directories.  In order to get it not to do this I literally had to
> force CMAKE_INSTALL_PREFIX to be empty in the Cache file, which
> doesn't feel right.  I'd MUCH rather set some option that tells CMake
> to not look for anything in the CMAKE_INSTALL_PREFIX directory (which
> for BRL-CAD is often different from system paths) with any of it's
> Find* commands. If this is supported I have yet to spot the option -
> can anyone enlighten me?  Am I making some obvious mistake?  It seems
> like a problem people would have had to solve before this, but maybe
> I'm doing something wrong.

Have you tried to set CMAKE_FIND_ROOT_PATH? It works for all the find_* commands

  find_library(

name | NAMES name1 [name2 ...]
[HINTS path1 [path2 ... ENV var]]
[PATHS path1 [path2 ... ENV var]]
[PATH_SUFFIXES suffix1 [suffix2 ...]]
[DOC "cache documentation string"]
[NO_DEFAULT_PATH]
[NO_CMAKE_ENVIRONMENT_PATH]
[NO_CMAKE_PATH]
[NO_SYSTEM_ENVIRONMENT_PATH]
[NO_CMAKE_SYSTEM_PATH]
[CMAKE_FIND_ROOT_PATH_BOTH |
 ONLY_CMAKE_FIND_ROOT_PATH |
 NO_CMAKE_FIND_ROOT_PATH]
   )

[...]

   The CMake variable CMAKE_FIND_ROOT_PATH specifies one or more
   directories to be prepended to all other search directories.  This
   effectively "re-roots" the entire search under given locations.  By
   default it is empty.  It is especially useful when cross-compiling to
   point to the root directory of the target environment and CMake will
   search there too.  By default at first the directories listed in
   CMAKE_FIND_ROOT_PATH and then the non-rooted directories will be
   searched.  The default behavior can be adjusted by setting
   CMAKE_FIND_ROOT_PATH_MODE_LIBRARY.  This behavior can be manually
   overridden on a per-call basis.  By using CMAKE_FIND_ROOT_PATH_BOTH
   the search order will be as described above.  If
   NO_CMAKE_FIND_ROOT_PATH is used then CMAKE_FIND_ROOT_PATH will not be
   used.  If ONLY_CMAKE_FIND_ROOT_PATH is used then only the re-rooted
   directories will be searched.

-- 
Pau Garcia i Quiles
http://www.elpauer.org
(Due to my workload, I may need 10 days to answer)
___
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

2010-09-30 Thread Alexander Neundorf
On Thursday 30 September 2010, Nicola Brisotto wrote:
> I use Qt creator with cmake for desktop application and it work well. It
> has support for out of source build, it populate the project browser with
> you source and header, etc My main issue is not a full Qt Creator
> integration. My first need is build with cmake from console.
>
> Currently Qt support 2 toolchain: abdl and raptor.
>
>
>
> I
>
> > http://www.paraview.org/Wiki/CMake_Cross_Compiling
>
> After reading Wiley - "Porting to the Symbian Platform Open Mobile
> Development in C and C++", chapter 2.5.2 and 2.5.3 and some tutorial I
> understand that abdl uses 3 kind of file: 1) one bdl.inf
> 2) one or more *.mpp file
> 3) optionally a pkg file
>
> You process these files with a tool named 'bldmake' and will obtain a batch
> file ('ABLD.BAT') and some makefiles that will build the application for
> you.
>
> This tool exists mainly because a Symbian application is usually built for
> many platforms: the emulator, using a Microsoft X86 compiler,
> as well as the real device using a gcc-derived ARM compiler.
>
> The bldmake saves you from writing specially crafted makefiles for these
> compilers and make utilities; also it allows for building many targets with
> just a single command.
>
> From the bld.inf, type:
>  > bldmake bldfiles
>
> Of course, you must have the PATH set correctly for the installation of the 
SDK you are using. This command will look for the bld.inf, process it and the 
related *.mmp, then generate a BATCH file named ABLD.BAT. Now you have all 
you need to build your applications. Simply type:
>  > abld build
>
> This will build your application in all the available flavors.
> Note that the target files are stored in a very deep directory structure,
> and you are building both in debug and release versions for WINS (windows),
> ARM4 (plain arm), ARMI (speed optimized arm), THUMB (size optimized ARM)!
>
> But you can choose to build for only one target, and since it take less 
time, you usually build ONLY for one version of one target. For example, to 
build for the emulator only in the debug version, or for the device, 
optimized for size, in release version, you type:
>  > abld build wins udeb
>  > abld buind thumb urel
>
> Building for Windows is enough to start the emulator and run the
> application in the emulated environment. Application files are compiled and
> placed straight where the emulator can run it: no need to copy them in the
> right location.
>
> But for real devices, you have to pack everything in a .sis file for 
installation, send it to the phone and install the application. You are 
required to write a .pkg file to describe the installer, and then create it 
with:
>  > makesis file.pkg
>
> this is a small example:
> Here is a simple example of a bld.inf file:
>
> PRJ_PLATFORMS
> DEFAULT
> PRJ_EXPORTS
> ..\inc\SoundTouch.h
> ..\inc\FIFOSamplePipe.h
> ..\inc\FIFOSampleBuffer.h
> ..\inc\STTypes.h
> PRJ_MMPFILES
> SoundTouch.mmp
>
> This specifies that the project should generate makefiles for the default
> platforms (currently WINSCW, ARMV5 and GCCE), export four header files and
> build a single component which is specified in SoundTouch.mmp. The
> corresponding MMP file looks like this:
>
> TARGET SoundTouch.dll
> TARGETTYPE   dll
> UID   0x108D 0x0839739D
> CAPABILITY None
> USERINCLUDE ..\inc
> SYSTEMINCLUDE \epoc32\include \epoc32\include\stdapis
> SYSTEMINCLUDE \epoc32\include\stdapis\sys
> SYSTEMINCLUDE \epoc32\include\stdapis\stlport
> SOURCEPATH ..\src
> SOURCE SoundTouch.cpp AAFilter.cpp
> SOURCEFIFOSampleBuffer.cpp FIRFilter.cpp
> SOURCERateTransposer.cpp TDStretch.cpp
> LIBRARYeuser.lib
> LIBRARYlibc.lib libm.lib libstdcpp.lib

Thanks for that summary, that's great.

> Do we need a custom generator to recreate this process with cmake?

I started creating Symbian cmake files so that cmake can generate Makefiles 
for Symbian, and got so far that I was able to compile and link a hello world 
app.
The patch is from January and attached here:
http://public.kitware.com/Bug/view.php?id=8486
It's the one called "Symbian.patch". 

You can start and have a look at it.
It currently supports only one version of Symbian (the one I have), for 
compiling for Symbian under Linux.
The detection of the version happens in Symbian-GNU-Common.cmake. If you 
follow from there on, you should be able to figure out what needs to be done 
for other versions of symbian.

The main thing left is the processing of the executable after it has been 
linked.

For the beginning probably add_custom_command()/add_custom_target() should be 
good enough.

> > http://www.itk.org/Wiki/Symbian_Carbide_Generator

> I'm not sure but this generator produce a project for carbide so I need
> carbide to build a project. Is it right?
>
> Now there is alternative tool chains called Raptor that

Re: [CMake] undefining preprocessor macros

2010-09-30 Thread Alexander Neundorf
On Thursday 30 September 2010, Ryan Pavlik wrote:
>   Either add it to your COMPILE_FLAGS, or create/configure a header file
> with #undef lines.

There is also the cmake command remove_definitions()

Alex
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] FindGit.cmake on Windows

2010-09-30 Thread Dixon, Shane
Is it possible to update the FindGit.cmake module to be more friendly?  I 
changed the line:

find_program(GIT_EXECUTABLE
  NAMES ${git_names}
  DOC "git command line client"
  )

To:

find_program(GIT_EXECUTABLE
  NAMES ${git_names}
  PATHS "$ENV{ProgramFiles}/Git/bin"
  DOC "git command line client"
  )

And it found Git fine on my system.  I'm not sure if that's the only path that 
ought to be added, but I know that worked for me.

--
Shane Dixon
Linux Engineer
Atmel Corporation 

___
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] altering RUN_TESTS post-build command (MSVC + CTest)

2010-09-30 Thread Tyler Roscoe
On Mon, Sep 20, 2010 at 09:07:34AM -0700, Keith Gunderson wrote:
> I'm using a MSVC 9.0 Generator with Cmake 2.8.2
> 
> How do I add a change so that the command for my RUN_TESTS project changes 
> from 
> the default of:
> 
> "C:\Program Files\CMake 2.8\bin\ctest.exe" --force-new-ctest-process  -C 
> $(OutDir)
> if errorlevel 1 goto VCReportError
> 
> to
> 
> "C:\Program Files\CMake 2.8\bin\ctest.exe" --force-new-ctest-process  -VV -C 
> $(OutDir)
> if errorlevel 1 goto VCReportError

AFAIK, there is no way to do this without patching CMake.

What we do instead is just create our own equivalent of the RUN_TESTS
target:

set (cmd ${CMAKE_CTEST_COMMAND} -VV)
if (MSVC)
set (cmd ${cmd} -C ${CMAKE_CFG_INTDIR})
else ()
set (cmd ${cmd} -C ${CMAKE_BUILD_TYPE})
endif ()
add_custom_target (my_run_tests
COMMAND ${cmd}
)

hth,
tyler
___
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] FindGit.cmake on Windows

2010-09-30 Thread Dixon, Shane
 
Oops.  I just realized I already requested this (with the same title no less).  
This didn't make it into the latest RC for Cmake.  Does anyone know if it's 
planned for next?

--
Shane Dixon
Linux Engineer
Atmel Corporation 


-Original Message-
From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf Of 
Dixon, Shane
Sent: Thursday, September 30, 2010 2:53 PM
To: cmake@cmake.org
Subject: [CMake] FindGit.cmake on Windows

Is it possible to update the FindGit.cmake module to be more friendly?  I 
changed the line:

find_program(GIT_EXECUTABLE
  NAMES ${git_names}
  DOC "git command line client"
  )

To:

find_program(GIT_EXECUTABLE
  NAMES ${git_names}
  PATHS "$ENV{ProgramFiles}/Git/bin"
  DOC "git command line client"
  )

And it found Git fine on my system.  I'm not sure if that's the only path that 
ought to be added, but I know that worked for me.

--
Shane Dixon
Linux Engineer
Atmel Corporation 

___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] file COPY/INSTALL doesn't overwrite existing files?

2010-09-30 Thread Eric Noulard
2010/9/30 Guillaume Duhamel :
> Hi,
> I'm trying to use "file(COPY ..." during the build of one of my project.

"file(COPY ..." is a **CMake-time** command, i.e. it will be processed
when CMake runs
and not when building (unless make is triggering a cmake run)
If you want **Build-time** command you'll have to use

add_custom_command/add_custom_target

> The documentation says that files get overwritten according to their
> timestamps, but it seems they just never get overwritten.
> For instance, with this CMakeLists :
> ===
> project(test)
> cmake_minimum_required(VERSION 2.8)
> file(INSTALL dir DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
> file(INSTALL bar.txt DESTINATION ${test_BINARY_DIR}/dir)
> ===
> and those steps :
> $ mkdir build && cd build && cmake .. && make
> $ echo "something new" >> ../bar.txt
> $ make
> bar.txt doesn't get overwritten after the second make.
> Is there anything I'm doing wrong or do I have to detect existing files
> and remove them before the copy?

try

add_custom_command(
  OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/dir ${CMAKE_CURRENT_BINARY_DIR}/dir/bar.txt
  COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_CURRENT_SOURCE_DIR}/dir ${CMAKE_CURRENT_BINARY_DIR}/dir
  COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_CURRENT_SOURCE_DIR}/bar.txt
${CMAKE_CURRENT_BINARY_DIR}/dir/bar.txt
  )

or something similar.

-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
___
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] Stopping the VS build when configure fails

2010-09-30 Thread James Bigler
Is CMake supposed to stop the VS build when configure fails?

1>CMake Error in samples/traversal/CMakeLists.txt:
1>  Cannot find source file "traversal.c".  Tried extensions .c .C .c++ .cc
1>  .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp .hxx .in .txx
1>-- Build files have been written to: C:/code/rtsdk/rtmain/build-64-vs9-c30
1>Project : error PRJ0019: A tool returned an error code from "Checking
Build System"
1>Build log was saved at
"file://c:\code\build-64-vs9-c30\ZERO_CHECK.dir\Release\BuildLog.htm"
1>ZERO_CHECK - 1 error(s), 0 warning(s)
2>-- Build started: Project: ggg, Configuration: Release x64 --
3>-- Build started: Project: rrr, Configuration: Release x64 --
2>Compiling...

I'm currently using VS 2008 64 bit with CMake 2.6.3.
___
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] Stopping the VS build when configure fails

2010-09-30 Thread James Bigler
On Thu, Sep 30, 2010 at 5:42 PM, James Bigler  wrote:

> I'm currently using VS 2008 64 bit with CMake 2.6.3.
>

This also happens with 2.8.3 RC1.

James
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] Stopping the VS build when configure fails

2010-09-30 Thread John Drescher
On Thu, Sep 30, 2010 at 7:47 PM, James Bigler  wrote:
> On Thu, Sep 30, 2010 at 5:42 PM, James Bigler  wrote:
>>
>> I'm currently using VS 2008 64 bit with CMake 2.6.3.
>
> This also happens with 2.8.3 RC1.
>
That is good. I would be worried if it did not. The error means a file
(traversal.c) is missing in your source or at least not in the folder
that CMake is expecting.

John
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Stopping the VS build when configure fails

2010-09-30 Thread John Drescher
On Thu, Sep 30, 2010 at 7:42 PM, James Bigler  wrote:
> Is CMake supposed to stop the VS build when configure fails?
>

Yes.

John
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] Inherited AdditionalIncludeDirectories wrong for VS 2010 IDE build

2010-09-30 Thread Karl Wallner

Hi All,

using cmake for a quite big project (with several sub-projects, some macros, find modules etc.) sometimes .vcxproj 
contains output like this:

 

   /Zm1000 /bigobj 
%(AdditionalOptions)
  
%(AdditionalIncludeDirectories)
  ... LOTS OF INCLUDES ... 
/include
  EnableFastChecks

The problem is the second AdditionalIncludeDirectories not containing the final 
"%(AdditionalIncludeDirectories)".
Inside VS (Properties -> Configuration Properties -> C/C++ -> Additional 
Include Directories) this results
in the checkbox for "Inherit from parent of project defaults" being unchecked 
and so the includes are not
used. If you would check this checkbox, everything would work - but is a 
dissatisfying solution.

I tried hard to reproduce this error in a smaller example, but failed. I 
couldn't reproduce it, but I could fix it:
 SNIP -
diff -r -c \
cmake-2.8.2.orig/Source/cmVisualStudioGeneratorOptions.cxx 
cmake-2.8.2/Source/cmVisualStudioGeneratorOptions.cxx
*** cmake-2.8.2.orig/Source//cmVisualStudioGeneratorOptions.cxx 2010-06-28 
17:15:59.0 +0200
--- cmake-2.8.2/Source//cmVisualStudioGeneratorOptions.cxx  2010-10-01 
02:46:57.677851800 +0200
***
*** 251,257 
  {
  fout << "<" << m->first << ">";
  }
!   fout  << m->second << "first << ">\n";
}
  }
else
--- 251,261 
  {
  fout << "<" << m->first << ">";
  }
! fout  << m->second;
! if (m->first == "AdditionalIncludeDirectories") {
!   fout  << ";%(AdditionalIncludeDirectories)";
! }
! fout  << "first << ">\n";
}
  }
else

 SNIP -

I guess this is a bad fix (ugly hack, wrong place). Maybe somebody is able to explain/guess what might be wrong with my 
CMake-Files or to correctly fix this issue.



Regards,

Karl


___
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] CMakeDetermineVSServicePack.cmake support for vs2010

2010-09-30 Thread Philip Lowman
On Thu, Sep 30, 2010 at 11:04 AM,  wrote:

>  *Done.  Issue number 11279. [
> http://public.kitware.com/Bug/view.php?id=11279]*
>
> * *
>
> *I also noted that the script could be improved by calling the compiler
> with the ‘/?’ switch and parsing it’s output instead of parsing the output
> from try_compile’ing a simple c file it writes.  That would make it quite a
> bit faster.*
>

Aaron,

Thanks for the patch. I've pushed it to git next.
Regarding your idea to use the output of "cl /?" to determine the version
number, I think it is a good one. If you have time to rewrite the module to
do this instead and test it I would merge the changes for a future version
of CMake.

Some potential issues.
1. "cl /?" appears to pause waiting for input, this would have to be
mitigated somehow in a safe way or perhaps just "cl" could be executed as
that appears to include the output.
2. "cl" or "cl /?" output would have to be verified on VS8 to ensure it
outputs there as well (it appears to be there in VS9/Express)
3. You couldn't just run "cl", you would have to find out the CMake variable
for the compiler and run that.

My time is really limited. If you're interested, please create a new ticket
and submit a patch. It would save probably at least a second off of an
initial configure.

-- 
Philip Lowman
___
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] Stopping the VS build when configure fails

2010-09-30 Thread Rolf Eike Beer
Am Friday 01 October 2010 schrieb John Drescher:
> On Thu, Sep 30, 2010 at 7:47 PM, James Bigler  wrote:
> > On Thu, Sep 30, 2010 at 5:42 PM, James Bigler  
wrote:
> >> I'm currently using VS 2008 64 bit with CMake 2.6.3.
> > 
> > This also happens with 2.8.3 RC1.
> 
> That is good. I would be worried if it did not. The error means a file
> (traversal.c) is missing in your source or at least not in the folder
> that CMake is expecting.

As you can see from James' log CMake did in fact _not_ stop the build but 
continued building even if there was an error in generating. And: yes, I have 
seen MSVC builds e.g. running through "INSTALL" even if one of the projects 
before failed to build.

Eike


signature.asc
Description: This is a digitally signed message part.
___
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