Re: [CMake] How to build projects with make -j2 and ADD_SUBDIRECTORY?

2009-02-16 Thread Michael Wild


On 16. Feb, 2009, at 8:49, Micha Renner wrote:


How to build projects with make -j2 and ADD_SUBDIRECTORY?


A TOP-Level CMakeLists.txt has the following lines:

ADD_SUBDIRECTORY(libtiff) # The Library
ADD_SUBDIRECTORY(test)# Programm depending on libtiff
# more subdiretories depending on libtiff

The build-command is:
make -j2

The result is: make cancels the build of the test-subdirectory  
(libtiff

isn't ready).
What can I do that the project in the test-directory waits until the
build of the libaray is done?

I guess, this is something what CMake can't do yet.

With best regards
Michael




Hi Michael

This works for me (Mac OS X 10.5.6, GNU Make 3.81). What version of  
Make are you using? Reasonably recent versions of GNU Make should be  
able to do exactly that, but AFAIK, nmake and MSYS Make have serious  
trouble getting parallel builds right (or do not have the feature at  
all).


Whether parallel builds are available is not so much a thing that  
CMake handles, but the native build system (in your case some variant  
of Make).



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] parsing config.h files and setting cmake variables accordingly

2009-02-16 Thread Clemens Arth

Hi again,

now I have followed exactly that way and created a config.cmake file, 
which is translated into a config.h file. This approach works perfectly 
well on Linux and everything immediately responds to changes in the 
config.cmake file. However, if I create a Visual Studio project on 
Windows, the project itself gets updated according to changes in the 
config.cmake file, but the sources including config.h are not 
recompiled. Maybe I missed something, but even if the config.h file 
changes on a build command (and it really does!), the sources are all 
treated as up2date, so no rebuilding happens. Maybe there is a step 
missing, something like marking some files as dirty, but I don't really 
think so, or at least I can not imagine...


Clemens

Michael Jackson wrote:
That is the best way to do it. Have all the options in your CMake file 
and let the user select which options they want to compile with. Then 
configure_file to create your config.h file.



---
Mike Jackson www.bluequartz.net



On Feb 13, 2009, at 7:45 AM, Clemens Arth wrote:


Hello,

the config files were written some years ago simply to collect all 
the possibilities how to compile the projects. Unfortunately this was 
long before cmake came into play, thus the problem just came up now 
because I wanted to set up a system for nightly builds.


Well, I think the best solution might be to drop the old config.h 
file and to replace it by a file for setting the variables in the 
cmake environment, and finally to create a new config.h version with 
cmake online with a call to configure_file. I think, this is, in 
principal, the way you might have kept in mind when you suggested a 
look at configure_file, right?


Regards
Clemens

Pau Garcia i Quiles wrote:

Hello,

I see. So, where is that config.h created? In your CMake build-system?
is it from an external library? If the former, maybe you could use
variables (cmake -DWITH_OPENGL:BOOL=1 ... ); if the latter, I don't
know (the only thing I can come with at this moment to survive
additional spaces, etc are regular expressions).

On Fri, Feb 13, 2009 at 1:10 PM, Clemens Arth clemens.a...@gmx.at 
wrote:



Hi,

thanks for the hint, but my problem is exactly the opposite of the one
configure_file is solving. I'm already using configure_file in 
multiple
places, but here I don't want to write config files, instead I want 
to parse
their content back to cmake, and that's why I don't think 
configure_file.


Regards
Clemens

Pau Garcia i Quiles wrote:


Hello,

Take a look at CONFIGURE_FILE

On Fri, Feb 13, 2009 at 12:46 PM, Clemens Arth clemens.a...@gmx.at
wrote:



Hi,

I've got a  question concerning  string processing in cmake. Our 
software
framework consists of multiple libraries and has many different 
features

to
be enabled or disabled using #defines. For example, one option is to
compile
with OpenGL or with OpenGL ES support. Thus in a config.h file, 
one of

two
variables is valid to be #defined, USE_OPENGL or USE_OPENGLES. 
Depending

on
the variable defined cmake should link against a specific set of
libraries.

Currently determining which feature is set works the following 
way in my

CMakeLists.txt:

Code:
# check for the configuration and set the corresponding GL/GLES 
libraries

accordingly
FILE(READ ${LIB_SOURCE_DIR}/include/config.h CURRENT_CONFIG)
STRING(REGEX MATCH \#define USE_OPENGLES GLES_IS_SET 
${CURRENT_CONFIG})
STRING(REGEX MATCH \#define USE_OPENGL GL_IS_SET 
${CURRENT_CONFIG})

IF(#define USE_OPENGLES STREQUAL ${GLES_IS_SET})
MESSAGE(GLES config!)
ELSE(#define USE_OPENGLES STREQUAL ${GLES_IS_SET})
IF(#define USE_OPENGL STREQUAL ${GL_IS_SET})
MESSAGE(GL config!)
ELSE(#define USE_OPENGL STREQUAL ${GL_IS_SET})
MESSAGE(Error! USE_GL or USE_GLES must be defined!)
ENDIF(#define USE_OPENGL STREQUAL ${GL_IS_SET})
ENDIF(#define USE_OPENGLES STREQUAL ${GLES_IS_SET})


Note that this is really a bad hack. First, if GLES_IS_SET is set
,GL_IS_SET
is also set automatically. Second, if by accident the string does 
not
exactly match the content (an additional space, or there is a 
second
variable, for example called USE_OPENGL_EXTRAS), everything gets 
really
weird or fails at all. Finally, a problem is that cmake does not 
actually
notice if I changed the config.h file, so there should be an 
option to

mark
the configuration as dirty if the config.h file is altered - this 
is a
problem which must not necessarily be solved, but maybe there is 
a simple

solution to this.

Can someone give me some tips how to improve my really ugly 
solution?


Thanks and best regards
Clemens
___
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] relative CMAKE_MODULE_PATH

2009-02-16 Thread Pau Garcia i Quiles
Hello,

This works for me with CMake CVS:

SET( CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake )

On Mon, Feb 16, 2009 at 11:26 AM, Johannes Stallkamp
johannes.stallk...@rub.de wrote:
 Hello list,

 is it possible to set a relative path as CMAKE_MODULE_PATH ? I
 actually had problems with that (CMake 2.6.3-RC 8)
 Is it because the relative path would be resolved w.r.t current build
 dir and not w.r.t. to the directory with CMakeLists.txt ?

 Reason:
 I want to point CMAKE_MODULE_PATH to a directory in the source tree
 which contains a file with a couple of cmake macros and some
 customized modules.

 These should be available in all projects. These projects may be
 located at varying depth within the tree.
 e.g. (simplified view)

 ROOT
 |-common components
|-libraryA
|-libraryB
|-CMakeMacros
 |-applicationA
|-subcomponentA
|-plugins
|-pluginA
|-pluginB
|-pluginC
 |-applicationB


 Initially, I just used

 INCLUDE( ../../CMakeMacros/localmacros.cmake)
 ( ../ varying according to project location, of course )

 which is fine, as long as I only want to use that single file but
 creates problems if I want to add custom/customized modules.

 However,
SET( CMAKE_MODULE_PATH ../../CMakeModules)
INCLUDE( localmacros )
 does not work. CMake complains that it cannot find that file.

 My current workaround is
SET( CMAKE_MODULE_PATH
 ${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeModules)
INCLUDE( localmacros )


 Is that necessary or is there a more elegant way I'm not aware of?

 Kind Regards
 Johannes

 ___
 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




-- 
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] relative CMAKE_MODULE_PATH

2009-02-16 Thread Eric Noulard
2009/2/16 Pau Garcia i Quiles pgqui...@elpauer.org:
 Hello,

 This works for me with CMake CVS:

 SET( CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake )

Yes I do that too but...
this is not a relative path :-)

as asked in the first place:

 is it possible to set a relative path as CMAKE_MODULE_PATH ?

I don't really know if relative path is meant to work.

See the CMake use full paths FAQ entry:

http://www.cmake.org/Wiki/CMake_FAQ#Why_does_CMake_use_full_paths.2C_or_can_I_copy_my_build_tree.3F

-- 
Erk
___
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] relative CMAKE_MODULE_PATH

2009-02-16 Thread Philip Lowman



.. Original Message ...
On Mon, 16 Feb 2009 12:45:06 +0100 Eric Noulard eric.noul...@gmail.com 
wrote:
2009/2/16 Pau Garcia i Quiles pgqui...@elpauer.org:
 This works for me with CMake CVS:

 SET( CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake )

Yes I do that too but...
this is not a relative path :-)

Try using CMAKE_CURRENT_SOURCE_DIR

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


[CMake] setting environment variable through cmake

2009-02-16 Thread ankit jain
Hi all,

I want to set an enviromnet varibale but not able to do it.
Currently iam using the command:
SET( ENV{varname} value )

But it is not working.
Can anybody guide me how to do it by giving an example.


Ankit
___
Powered by www.kitware.com

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

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

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

[CMake] How can I install something into an absolute directory?

2009-02-16 Thread Kermit Mei

Hello, community!

How can I install something into an absolute directory?
For example, I want to install the directory under /usr/share.
When I use the following command:
INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/dict/mydir DESTINATION share)

'mydir' may be installed into /usr/local/share, if I run
cmake -DCMAKE_INSTALL_PREFIX=/usr/local ..

How to avoid it, and guarantee it can be install under /usr/share 
whatevery I

pointed with cmake PREFIX ?

Thanks.

Kermit Mei
___
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] parsing config.h files and setting cmake variables accordingly

2009-02-16 Thread Michael Jackson
You would also want to add the configured file (config.h) to the list  
of sources that get compiled.


configure_file(...  config.h)

add_executable(MyApp  main.c config.h)

That way the dependency is setup between the configured file and the  
compilation of the executable.


Also I think it is generally better practice to have the input file  
that is used in the configure_file command have the name config.h.in  
rather than config.cmake. Having the .cmake file on the end may lead  
to confusion when others look at your project.


Cheers
---
Mike Jackson www.bluequartz.net



On Feb 16, 2009, at 5:32 AM, Clemens Arth wrote:


Hi again,

now I have followed exactly that way and created a config.cmake  
file, which is translated into a config.h file. This approach works  
perfectly well on Linux and everything immediately responds to  
changes in the config.cmake file. However, if I create a Visual  
Studio project on Windows, the project itself gets updated according  
to changes in the config.cmake file, but the sources including  
config.h are not recompiled. Maybe I missed something, but even if  
the config.h file changes on a build command (and it really  
does!), the sources are all treated as up2date, so no rebuilding  
happens. Maybe there is a step missing, something like marking some  
files as dirty, but I don't really think so, or at least I can not  
imagine...


Clemens

Michael Jackson wrote:
That is the best way to do it. Have all the options in your CMake  
file and let the user select which options they want to compile  
with. Then configure_file to create your config.h file.



---
Mike Jackson www.bluequartz.net



On Feb 13, 2009, at 7:45 AM, Clemens Arth wrote:


Hello,

the config files were written some years ago simply to collect all  
the possibilities how to compile the projects. Unfortunately this  
was long before cmake came into play, thus the problem just came  
up now because I wanted to set up a system for nightly builds.


Well, I think the best solution might be to drop the old config.h  
file and to replace it by a file for setting the variables in the  
cmake environment, and finally to create a new config.h version  
with cmake online with a call to configure_file. I think, this is,  
in principal, the way you might have kept in mind when you  
suggested a look at configure_file, right?


Regards
Clemens

Pau Garcia i Quiles wrote:

Hello,

I see. So, where is that config.h created? In your CMake build- 
system?

is it from an external library? If the former, maybe you could use
variables (cmake -DWITH_OPENGL:BOOL=1 ... ); if the latter, I don't
know (the only thing I can come with at this moment to survive
additional spaces, etc are regular expressions).

On Fri, Feb 13, 2009 at 1:10 PM, Clemens Arth  
clemens.a...@gmx.at wrote:



Hi,

thanks for the hint, but my problem is exactly the opposite of  
the one
configure_file is solving. I'm already using configure_file in  
multiple
places, but here I don't want to write config files, instead I  
want to parse
their content back to cmake, and that's why I don't think  
configure_file.


Regards
Clemens

Pau Garcia i Quiles wrote:


Hello,

Take a look at CONFIGURE_FILE

On Fri, Feb 13, 2009 at 12:46 PM, Clemens Arth clemens.a...@gmx.at 


wrote:



Hi,

I've got a  question concerning  string processing in cmake.  
Our software
framework consists of multiple libraries and has many  
different features

to
be enabled or disabled using #defines. For example, one option  
is to

compile
with OpenGL or with OpenGL ES support. Thus in a config.h  
file, one of

two
variables is valid to be #defined, USE_OPENGL or USE_OPENGLES.  
Depending

on
the variable defined cmake should link against a specific set of
libraries.

Currently determining which feature is set works the following  
way in my

CMakeLists.txt:

Code:
# check for the configuration and set the corresponding GL/ 
GLES libraries

accordingly
FILE(READ ${LIB_SOURCE_DIR}/include/config.h CURRENT_CONFIG)
STRING(REGEX MATCH \#define USE_OPENGLES GLES_IS_SET $ 
{CURRENT_CONFIG})
STRING(REGEX MATCH \#define USE_OPENGL GL_IS_SET $ 
{CURRENT_CONFIG})

IF(#define USE_OPENGLES STREQUAL ${GLES_IS_SET})
MESSAGE(GLES config!)
ELSE(#define USE_OPENGLES STREQUAL ${GLES_IS_SET})
IF(#define USE_OPENGL STREQUAL ${GL_IS_SET})
   MESSAGE(GL config!)
ELSE(#define USE_OPENGL STREQUAL ${GL_IS_SET})
   MESSAGE(Error! USE_GL or USE_GLES must be defined!)
ENDIF(#define USE_OPENGL STREQUAL ${GL_IS_SET})
ENDIF(#define USE_OPENGLES STREQUAL ${GLES_IS_SET})


Note that this is really a bad hack. First, if GLES_IS_SET is  
set

,GL_IS_SET
is also set automatically. Second, if by accident the string  
does not
exactly match the content (an additional space, or there is  
a second
variable, for example called USE_OPENGL_EXTRAS), everything  
gets really
weird or fails at all. Finally, a problem is that cmake does  
not actually
notice if I changed the config.h 

Re: [CMake] Add_custom_target copying files

2009-02-16 Thread Michael Jackson

Not sure, it should work.

Try changing POST_BUILD to PRE_BUILD and see what happens.

also try printing the variable ${${inputPo}}

message(STATUS ${inputPo}: ${${inputPo}})
message(STATUS inputPo: ${inputPo})

_
Mike Jackson  mike.jack...@bluequartz.net
BlueQuartz Softwarewww.bluequartz.net
Principal Software Engineer  Dayton, Ohio



On Feb 15, 2009, at 3:48 PM, Leopold Palomo Avellaneda wrote:


A Diumenge 15 Febrer 2009, Michael Jackson va escriure:

Here is a code snippet from a project that I use that copies some
files to the build directory.


Thanks,

but my modified version doesn't work and I don't know what's  
happen 



macro (GETTEXT_UPDATE_LANG_PO dirOUTpo inputPo )

  #message (STATUS Calling the macro to copy files to ${dirOUTpo}\n)
  foreach ( _file ${${inputPo}} )
   get_filename_component(_fdest ${_file} NAME)
   set(dest ${dirOUTpo}/${_fdest})
   message (STATUS Copying ${_file} to ${dest} \n)
   add_custom_command (
 TARGET update_lang_po
 POST_BUILD
 COMMAND${CMAKE_COMMAND}
 ARGS   -E copy_if_different
 ${_file} ${dest})
 #copy_if_different
  endforeach(_file ${${inputPo}})
endmacro (GETTEXT_UPDATE_LANG_PO dirOUTpo inputPo)

I call this macro with a inputPo, a list of files and dirOUTpo a var  
with a

value.

The message status shows the correct values, but no copy is done.
Any idea?

I simple execute make update_lang_po, but nothing is copied ...

Thanks in advance,

Leo






#-- Copy all the HDF5 files from the test directory into the build
directory
SET (HDF5_REFERENCE_TEST_FILES
  tnullspace.h5
  family_v1.7_3.h5
  family_v1.7_1.h5
  mergemsg.h5
  tbogus.h5
  tbad_msg_count.h5
  group_new.h5
  deflate.h5
  noencoder.h5
  family_v1.7_0.h5
  le_extlink1.h5
  tmtimeo.h5
  tmtimen.h5
  fill_old.h5
  tlayouto.h5
  family_v1.7_2.h5
  th5s.h5
  tarrold.h5
)

FOREACH ( h5_file ${HDF5_REFERENCE_TEST_FILES} )
   SET (dest ${PROJECT_BINARY_DIR}/${h5_file})
   MESSAGE(STATUS  Copying ${dest})
   ADD_CUSTOM_COMMAND (
 TARGET ${HDF5_TEST_LIB_NAME}
 POST_BUILD
 COMMAND${CMAKE_COMMAND}
 ARGS   -E copy_if_different ${HDF5_TEST_SOURCE_DIR}/$
{h5_file} ${dest}
 )

ENDFOREACH ( h5_file ${HDF5_REFERENCE_TEST_FILES} )

_
Mike Jackson  mike.jack...@bluequartz.net
BlueQuartz Softwarewww.bluequartz.net
Principal Software Engineer  Dayton, Ohio

On Feb 15, 2009, at 9:28 AM, Leopold Palomo Avellaneda wrote:

Hi,

I would like to create a custom target that copy several files
(one, two or
n files, but at least one) to a directory. I know how to do it with
one file:

add_custom_target(my_copy_target
${CMAKE_COMMAND} -E copy ${_inputfile} ${dirOUT}/)

but, I really don't know how to do it with a list of files.

Someone could help me?

Regards,

Leo


___
Powered by www.kitware.com

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

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

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





___
Powered by www.kitware.com

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

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

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


Re: [CMake] How can I install something into an absolute directory?

2009-02-16 Thread Andreas Pakulat
On 16.02.09 21:12:46, Kermit Mei wrote:
 How can I install something into an absolute directory?
 For example, I want to install the directory under /usr/share.
 When I use the following command:
 INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/dict/mydir DESTINATION share)

 'mydir' may be installed into /usr/local/share, if I run
 cmake -DCMAKE_INSTALL_PREFIX=/usr/local ..

Thats correct and the right thing to happen.

 How to avoid it, and guarantee it can be install under /usr/share  
 whatevery I
 pointed with cmake PREFIX ?

Your app should not need that, in particular nothing that builds from
source should install into a directory thats controlled by a distributions
packaging system. Apart from that, something like this would probably break
how distributions build a package from such sources.

Can you explain why you think you need this?

Andreas

-- 
Good day to let down old friends who need help.
___
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 environment variable through cmake

2009-02-16 Thread Nicolas Desprès
Hi,

What version of cmake do you use? It is working for me.

Cheers,

Nico

On Mon, Feb 16, 2009 at 6:46 AM, ankit jain ankitgu...@gmail.com wrote:
 Hi all,

 I want to set an enviromnet varibale but not able to do it.
 Currently iam using the command:
 SET( ENV{varname} value )

 But it is not working.
 Can anybody guide me how to do it by giving an example.


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




-- 
Nicolas Desprès
___
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 build projects with make -j2 and ADD_SUBDIRECTORY?

2009-02-16 Thread Michael Wild


On 16. Feb, 2009, at 14:42, Micha Renner wrote:


Hi Michael


This works for me (Mac OS X 10.5.6, GNU Make 3.81). What version of
Make are you using?

The same as you.


Reasonably recent versions of GNU Make should be
able to do exactly that, but AFAIK, nmake and MSYS Make have serious
trouble getting parallel builds right (or do not have the feature at
all).

You are right. Especially , nmake might be a death end.


Whether parallel builds are available is not so much a thing that
CMake handles, but the native build system (in your case some variant
of Make).

I'm pretty sure that this a is CMake-problem. E.g the autotools can  
do a

parallel build of tiff.

The problem with CMake arises only if the library-build is long and  
the

parallel depending build short. In this case it took 50s to build the
library and 8s to build the depending program.


50s is not sooo bad, here I have targets which take dozens of minutes...



If the subdirectories are independent, then I have no difficulties to
make parallel builds.



Aah yes, I noticed similar effects. Strange thing is that the  
Makefiles generated by CMake support building a single target in  
parallel. But once the scheduler decided to do the easier thing, and  
build two different targets in parallel, and one finishes much earlier  
than the other, it won't ever fork the build process of the other  
target, but instead start to build another target non-parallel. This  
is not so bad if you have many targets of about the same size, as I do  
(in the order of 100), but if you have only a very few targets with  
one of them being much more expensive than all the others, it breaks  
down.





The other point is, there is no way to tell CMake that Sub1 depends on
Sub2 and Sub2 depends on Sub3.


You can't define dependencies of directories, but of targets. That  
should do the trick, right? And actually makes more sense...





So from the silence of the maintainers I conclude that I'm right,  
alas.

(Of course not sure, so I asked.)


I'd wait over the night, most of them are across the Atlantic ;-)




Nevertheless, thanks for responding.

Michael



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] Add_custom_target copying files

2009-02-16 Thread Leopold Palomo Avellaneda
A Dilluns 16 Febrer 2009, Michael Jackson va escriure:
 Not sure, it should work.

 Try changing POST_BUILD to PRE_BUILD and see what happens.

 also try printing the variable ${${inputPo}}

 message(STATUS ${inputPo}: ${${inputPo}})
 message(STATUS inputPo: ${inputPo})


Well,

first of all thanks for all. After looking and testing a lot i have found a 
functional solution. See above:

Conceptually the main problem have been that I cannot have several custom 
target with the same name in the same directory. So, I was doing a bad 
implementation of your solution. The solution that I have found have been 
create a custom target for every file that I would like to copy and add them 
to the target as dependency.

So, by now it's working. 

Best regards,

Leo

-8
macro (GETTEXT_UPDATE_LANG_PO dirOUTpo inputPo)

   #message (STATUS Calling the macro to copy files to ${dirOUTpo}\n)
   foreach ( _file ${${inputPo}} )
get_filename_component(_fdest ${_file} NAME)
get_filename_component(target ${_file} NAME_WE)
set(dest ${dirOUTpo}/${_fdest})
#message (STATUS Copying ${_file} to ${dest} \n)

add_custom_target(${target}
  ${CMAKE_COMMAND} -E copy_if_different
  ${_file} ${dest})
  
  add_dependencies(update_lang_po ${target})
 endforeach(_file ${${inputPo}}) 

endmacro (GETTEXT_UPDATE_LANG_PO dirOUTpo inputPo)



 On Feb 15, 2009, at 3:48 PM, Leopold Palomo Avellaneda wrote:
  A Diumenge 15 Febrer 2009, Michael Jackson va escriure:
  Here is a code snippet from a project that I use that copies some
  files to the build directory.
 
  Thanks,
 
  but my modified version doesn't work and I don't know what's
  happen 
 
 
  macro (GETTEXT_UPDATE_LANG_PO dirOUTpo inputPo )
 
#message (STATUS Calling the macro to copy files to ${dirOUTpo}\n)
foreach ( _file ${${inputPo}} )
 get_filename_component(_fdest ${_file} NAME)
 set(dest ${dirOUTpo}/${_fdest})
 message (STATUS Copying ${_file} to ${dest} \n)
 add_custom_command (
   TARGET update_lang_po
   POST_BUILD
   COMMAND${CMAKE_COMMAND}
   ARGS   -E copy_if_different
   ${_file} ${dest})
   #copy_if_different
endforeach(_file ${${inputPo}})
  endmacro (GETTEXT_UPDATE_LANG_PO dirOUTpo inputPo)
 
  I call this macro with a inputPo, a list of files and dirOUTpo a var
  with a
  value.
 
  The message status shows the correct values, but no copy is done.
  Any idea?
 
  I simple execute make update_lang_po, but nothing is copied ...
 
  Thanks in advance,
 
  Leo
 
  #-- Copy all the HDF5 files from the test directory into the build
  directory
  SET (HDF5_REFERENCE_TEST_FILES
tnullspace.h5
family_v1.7_3.h5
family_v1.7_1.h5
mergemsg.h5
tbogus.h5
tbad_msg_count.h5
group_new.h5
deflate.h5
noencoder.h5
family_v1.7_0.h5
le_extlink1.h5
tmtimeo.h5
tmtimen.h5
fill_old.h5
tlayouto.h5
family_v1.7_2.h5
th5s.h5
tarrold.h5
  )
 
  FOREACH ( h5_file ${HDF5_REFERENCE_TEST_FILES} )
 SET (dest ${PROJECT_BINARY_DIR}/${h5_file})
 MESSAGE(STATUS  Copying ${dest})
 ADD_CUSTOM_COMMAND (
   TARGET ${HDF5_TEST_LIB_NAME}
   POST_BUILD
   COMMAND${CMAKE_COMMAND}
   ARGS   -E copy_if_different ${HDF5_TEST_SOURCE_DIR}/$
  {h5_file} ${dest}
   )
 
  ENDFOREACH ( h5_file ${HDF5_REFERENCE_TEST_FILES} )
 
  _
  Mike Jackson  mike.jack...@bluequartz.net
  BlueQuartz Softwarewww.bluequartz.net
  Principal Software Engineer  Dayton, Ohio
 
  On Feb 15, 2009, at 9:28 AM, Leopold Palomo Avellaneda wrote:
  Hi,
 
  I would like to create a custom target that copy several files
  (one, two or
  n files, but at least one) to a directory. I know how to do it with
  one file:
 
  add_custom_target(my_copy_target
  ${CMAKE_COMMAND} -E copy ${_inputfile} ${dirOUT}/)
 
  but, I really don't know how to do it with a list of files.
 
  Someone could help me?
 
  Regards,
 
  Leo
 
 
  ___
  Powered by www.kitware.com
 
  Visit other Kitware open-source projects at
  http://www.kitware.com/opensource/opensource.html
 
  Please keep messages on-topic and check the CMake FAQ at:
  http://www.cmake.org/Wiki/CMake_FAQ
 
  Follow this link to subscribe/unsubscribe:
  http://www.cmake.org/mailman/listinfo/cmake


___
Powered by www.kitware.com

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

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

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


[CMake] CMake Facebook group

2009-02-16 Thread Bill Hoffman
I have created a CMake Facebook group that is open to the public.  If 
you are on Facebook, please feel free to join.


-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] include_regular_expression question(Ubuntu CMake-2.6-patch0)

2009-02-16 Thread Pavel Shevaev
On Sun, Feb 15, 2009 at 11:02 PM, Pavel Shevaev pacha.shev...@gmail.com wrote:
 Sorry folks, I'm replying to myself - I think I've found a solution:
 mark directory containing infrequently changing paths using
 set_directory_properties, e.g:

 set_directory_properties(PROPERTIES INCLUDE_REGULAR_EXPRESSION ^$)

And again I'm replying to myself, sorry :( set_directory_properties
didn't work neither for some reason :(

The workaround I'm using now is the following command:

include_regular_expression(^.*(h|cpp)$)

It works for boost since it uses .hpp extension for headers while my
project uses .h extension... It's kinda a hack, but it works and this
alone has *dramatically* sped up dependency checks. Basically, these
checks cost nothing now.


-- 
Best regards, Pavel
___
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] CheckTypeSize and non-standard headers

2009-02-16 Thread Aaron Turner
I'm trying to figure out how to write my CMakeLists.txt file to find
wint_t under OSX which defines it in /usr/include/runetype.h rather
then one of the standard headers that CheckTypeSize uses.  I was
hoping Cmake behaved like autotools where if you first look for the
header it will automatically include it in future type checks, but
that doesn't seem to be the case.

Suggestions?

-- 
Aaron Turner
http://synfin.net/
http://tcpreplay.synfin.net/ - Pcap editing and replay tools for Unix  Windows
Those who would give up essential Liberty, to purchase a little
temporary Safety,
deserve neither Liberty nor Safety.
-- Benjamin Franklin
___
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] CheckTypeSize and non-standard headers

2009-02-16 Thread Michael Jackson

SET(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES})
SET(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES};/usr/include)

CHECK_SYMBOL_EXISTS(wint_t runetype.h HAVE_WINT_T)

SET(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE})

IF (HAVE_WINT_T)
message(STATUS wint_t is available)
endif()

Also, check the documentation for the CheckSymbolExists macro.

• CheckSymbolExists: Check if the symbol exists in include files
CHECK_SYMBOL_EXISTS(SYMBOL FILES VARIABLE)

SYMBOL - symbol
FILES - include files to check
VARIABLE - variable to return result


The following variables may be set before calling this macro to modify  
the way the check is run:


CMAKE_REQUIRED_FLAGS = string of compile command line flags
CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
CMAKE_REQUIRED_INCLUDES = list of include directories
CMAKE_REQUIRED_LIBRARIES = list of libraries to link
Defined in: /Users/Shared/Toolkits/CMake-CVS/share/cmake-2.7/Modules/ 
CheckSymbolExists.cmake



_
Mike Jackson  mike.jack...@bluequartz.net
BlueQuartz Softwarewww.bluequartz.net
Principal Software Engineer  Dayton, Ohio



On Feb 16, 2009, at 2:13 PM, Aaron Turner wrote:


I'm trying to figure out how to write my CMakeLists.txt file to find
wint_t under OSX which defines it in /usr/include/runetype.h rather
then one of the standard headers that CheckTypeSize uses.  I was
hoping Cmake behaved like autotools where if you first look for the
header it will automatically include it in future type checks, but
that doesn't seem to be the case.

Suggestions?

--
Aaron Turner
http://synfin.net/
http://tcpreplay.synfin.net/ - Pcap editing and replay tools for  
Unix  Windows

Those who would give up essential Liberty, to purchase a little
temporary Safety,
deserve neither Liberty nor Safety.
   -- Benjamin Franklin
___
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] CheckTypeSize and non-standard headers

2009-02-16 Thread Aaron Turner
On Mon, Feb 16, 2009 at 12:14 PM, Michael Jackson
mike.jack...@bluequartz.net wrote:
 SET(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES})
 SET(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES};/usr/include)

 CHECK_SYMBOL_EXISTS(wint_t runetype.h HAVE_WINT_T)

 SET(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE})

 IF (HAVE_WINT_T)
 message(STATUS wint_t is available)
 endif()


Doesn't seem to work.   FYI:

echo '#include runetype.h' | gcc -E - | grep wint_t

returns:
typedef int __darwin_wint_t;
typedef __darwin_wint_t wint_t;

So I know I'm using the right header.  this is cmake 2.6-patch 2


-- 
Aaron Turner
http://synfin.net/
http://tcpreplay.synfin.net/ - Pcap editing and replay tools for Unix  Windows
Those who would give up essential Liberty, to purchase a little
temporary Safety,
deserve neither Liberty nor Safety.
-- Benjamin Franklin
___
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-16 Thread Luigi Calori

Alexander Neundorf ha scritto:

On Monday 16 February 2009, Philip Lowman wrote:
  

Hi,

Luigi suggested a kind of CMake ports system in a recent thread here on the
CMake mailing list.  This would presumably be a system whereby popular 3rd
party dependencies which have not yet CMakeified their source trees could
be CM'd and baselined in one place and ultimately downloaded for easy
incorporation into CMake projects (especially with a goal towards
MSVC/MinGW portability).  VTK seems to be doing this internally for several
of it's dependencies and the OSG project seems interested in doing the same
for similar reasons but would prefer not to duplicate a bunch of work. 



I think also the KDE-on-Windows developer cmakeified a few projects.
  
I' ve checked out the project, it is really inetresting, I' ve tried 
their emerge utility (a kind of a port of the Gentoo portage tools on 
windows)
It seems it is able to keep a list of packeges and their dependencies 
and can handle different compiler platforms like mingw, msvc8, msvc9
Regarding CMake, it use it for some libs but not all (libcurl,libjasper 
is built with cmake, tiff, and jpeg seems not).


  

Since many of the dependencies overlap, is there general interest in this
kind of a thing from the VTK perspective or from others?

The goal would be to create an open-source project (hosted probably at a
neutral site like SF.net or Google Code) where the ports could be stored,
baselined, etc. and then released so that anyone could download whichever
are needed and incorporate them into their own projects?  Export/Install



You suggest to keep a whole copy of these projects there, not only the build 
files, right ?
  


KDE-on-Windows keeps the cmake separated, in the package definition, that keep 
the url to where get thezipped source.
The process is then to get, uncompress, patch ,configure, build and install.
These step are described and implemented in python scripts. It seems that the 
CMakeList are added in the expanded package.

In my attempt to provide basic dependencies for OpenSceneGraph, I used a 
similar approach.
I kept the cmake in a completely separated place, developed  cmake code for 
download and expansion.

 this current, i.e. they will more or less quickly 
become out-of-date (happened to me with python).
  
I do not see value in keeping sources (as VTK does) apart from avoid the 
download-expand step.
If the cmake scripts use glob rex expr to get source files, it should be 
quite resilient to project change and should be easier to mantain.
I think that having cmake  support for download,unpack and patch would 
really help.


Thanks
  Luigi

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


  


___
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] CheckTypeSize and non-standard headers

2009-02-16 Thread Aaron Turner
More testing seems to indicate that check_symbol_exists won't find any
typedef defined in headers.

Looking a the CheckSymbolExists.cmake file, the following .c is
generated as a test:

#include runetype.h
void cmakeRequireSymbol(int dummy,...) {
(void)dummy;
}

int main() {
#ifndef wint_t
cmakeRequireSymbol(0, wint_t);
#endif
return 0;
}

Unfortunately, you can't use #ifndef to test for the existence of a
typedef, hence you get a compile failure and the result of the test is
false.

Is there another check which is typedef/define agnostic?  I'm sure I
could write my own, but this seems like it should be included in the
standard cmake library.


-- 
Aaron Turner
http://synfin.net/
http://tcpreplay.synfin.net/ - Pcap editing and replay tools for Unix  Windows
Those who would give up essential Liberty, to purchase a little
temporary Safety,
deserve neither Liberty nor Safety.
-- Benjamin Franklin
___
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-16 Thread Philip Lowman
On Sun, Feb 15, 2009 at 11:30 PM, Bill Hoffman bill.hoff...@kitware.comwrote:

 Philip Lowman wrote:

 Hi,

 Luigi suggested a kind of CMake ports system in a recent thread here on
 the CMake mailing list.  This would presumably be a system whereby popular
 3rd party dependencies which have not yet CMakeified their source trees
 could be CM'd and baselined in one place and ultimately downloaded for easy
 incorporation into CMake projects (especially with a goal towards MSVC/MinGW
 portability).  VTK seems to be doing this internally for several of it's
 dependencies and the OSG project seems interested in doing the same for
 similar reasons but would prefer not to duplicate a bunch of work.  Since
 many of the dependencies overlap, is there general interest in this kind of
 a thing from the VTK perspective or from others?

 The goal would be to create an open-source project (hosted probably at a
 neutral site like SF.net or Google Code) where the ports could be stored,
 baselined, etc. and then released so that anyone could download whichever
 are needed and incorporate them into their own projects?  Export/Install
 support could also be built into the projects so that they could be prebuilt
 and installed by others and used that way as well.

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

 Does this sound interesting?

  I think it might be more interesting to start a campaign to push the
 cmake files into those projects.  Why shouldn't jpg,tiff,zlib, and friends
 not ship with good cmake files.  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...


Part of me believes that even if they were to accept the CMake build systems
as submitted, in the long-term, patches would still have to be maintained
against their native CMake builds.  This is why I listed it as a secondary
goal.  Some of my concerns here are centered around library names (witness
Kitware's prefix of each library with kw, I'm guessing for technical and
legal reasons?) and of course the eventual growth of the CMake build systems
by each open-source project for their own reasons (they may choose to
INSTALL() different targets, provide for unit testing, or any number of
things which could prove difficult to be kept optional to the original
CMakePorts build, especially if someone isn't watching their trunk).  The
goal is to be able to add a project to your build by simply saying
add_subdirectory(CMakePorts/libjpeg) or something like that.  In the end
it might be a completely different use case then what the developers of jpg,
tiff, zlib, and friends have in mind.

So ultimately I think this might have to be more of a long term endeavour.
Ultimately, at least if that ends up being the case it's a burden that many
people can share instead of each project doing individually.  Most of these
libraries are fairly stable and their release cycles are fairly long...  I
think.  In the end, tools could be developed to make the baselining process
easy (assuming diff isn't good enough).  Ultimately, it might turn a little
bit into Debian packaging, except for software building.  Obviously the
whole project would likely have a bias towards Windows since Linux doesn't
have the problem of not coming with these very useful libraries.

-- 
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] CheckTypeSize and non-standard headers

2009-02-16 Thread Michael Jackson

project(Test)
cmake_minimum_required(VERSION 2.7)

INCLUDE(${CMAKE_ROOT}/Modules/CheckTypeSize.cmake)

set(CMAKE_REQUIRED_DEFINITIONS_SAVE ${CMAKE_REQUIRED_DEFINITIONS})
set(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS};- 
D__need_wint_t=1)


CHECK_TYPE_SIZE(wint_t WINT_T)
message(STATUS Size of wint_t: ${WINT_T})
message(STATUS HAVE_WINT_T: ${HAVE_WINT_T})

set(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS_SAVE})

Although I am not sure under what circumstances you are supposed to  
define __need_wint_t? Or if there is some other encompassing macro to  
define. Otherwise the above will find the size in bytes of wint_t.


_
Mike Jackson  mike.jack...@bluequartz.net
BlueQuartz Softwarewww.bluequartz.net
Principal Software Engineer  Dayton, Ohio



On Feb 16, 2009, at 7:30 PM, Aaron Turner wrote:


More testing seems to indicate that check_symbol_exists won't find any
typedef defined in headers.

Looking a the CheckSymbolExists.cmake file, the following .c is
generated as a test:

#include runetype.h
void cmakeRequireSymbol(int dummy,...) {
   (void)dummy;
}

int main() {
#ifndef wint_t
   cmakeRequireSymbol(0, wint_t);
#endif
   return 0;
}

Unfortunately, you can't use #ifndef to test for the existence of a
typedef, hence you get a compile failure and the result of the test is
false.

Is there another check which is typedef/define agnostic?  I'm sure I
could write my own, but this seems like it should be included in the
standard cmake library.


--
Aaron Turner
http://synfin.net/
http://tcpreplay.synfin.net/ - Pcap editing and replay tools for  
Unix  Windows

Those who would give up essential Liberty, to purchase a little
temporary Safety,
deserve neither Liberty nor Safety.
   -- Benjamin Franklin
___
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] setting environment variable through cmake

2009-02-16 Thread Philip Lowman
On Mon, Feb 16, 2009 at 7:46 AM, ankit jain ankitgu...@gmail.com wrote:

 Hi all,

 I want to set an enviromnet varibale but not able to do it.
 Currently iam using the command:
 SET( ENV{varname} value )

 But it is not working.
 Can anybody guide me how to do it by giving an example.


Are you trying to set an environment variable that can be used during build
time?  This isn't possible.
http://www.cmake.org/Wiki/CMake_FAQ#How_can_I_get_or_set_environment_variables.3F

Could you elaborate on when you need the environment variable?

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

2009-02-16 Thread Alan W. Irwin

On 2009-02-17 00:41+0100 Luigi Calori wrote:


I think also the KDE-on-Windows developer cmakeified a few projects.

I' ve checked out the [KDE-on-Windows] project, it is really inetresting, I' ve tried their 
emerge utility (a kind of a port of the Gentoo portage tools on windows)
It seems it is able to keep a list of packeges and their dependencies and can 
handle different compiler platforms like mingw, msvc8, msvc9
Regarding CMake, it use it for some libs but not all (libcurl,libjasper is 
built with cmake, tiff, and jpeg seems not).


[...]KDE-on-Windows keeps the cmake separated, in the package definition, that 
keep the url to where get thezipped source.

The process is then to get, uncompress, patch ,configure, build and install.
These step are described and implemented in python scripts. It seems that the 
CMakeList are added in the expanded package.


In my view a SF project that just collects and maintains CMake-based build
system patches for the more important free software projects that are still
struggling with autotools would be worthwhile.  Of course, the eventual goal
would be to integrate individual patches to implement a CMake-based build
system for a particular software project in with that project, but the SF
project would provide facilities to work on such patches and make them
available for those who would like to try them. I think the availability of
working patches would be a big help in convincing parent projects to adopt
the work for themselves especially if you make clear that you are not
interfering with their existing build system at all, and your patches will
peacefully coexist with it as an added feature.

Of course, you can debate forever whether such a SF project would be
successful or not, but the only way to really know is to try it and see.
That is, start with something small and expand from there. I don't have time
to help with such a SF project myself at this time, but I think it is a good
idea that has a reasonable chance of success, and I would certainly be
cheering from the sidelines.

Alan
__
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__

Linux-powered Science
__
___
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] Fwd: setting environment variable through cmake

2009-02-16 Thread ankit jain
-- Forwarded message --
From: ankit jain ankitgu...@gmail.com
Date: 2009/2/17
Subject: Re: [CMake] setting environment variable through cmake
To: Philip Lowman phi...@yhbt.com


2009/2/17 Philip Lowman phi...@yhbt.com

 On Mon, Feb 16, 2009 at 7:46 AM, ankit jain ankitgu...@gmail.com wrote:

 Hi all,

 I want to set an enviromnet varibale but not able to do it.
 Currently iam using the command:
 SET( ENV{varname} value )

 But it is not working.
 Can anybody guide me how to do it by giving an example.


 Are you trying to set an environment variable that can be used during build
 time?  This isn't possible.

 http://www.cmake.org/Wiki/CMake_FAQ#How_can_I_get_or_set_environment_variables.3F

 Could you elaborate on when you need the environment variable?



 I need to set the environment variable at the time of testing since my test
 needs two environment variable that need to be set fro running the tests.

Iam using cmake 2.6



 --
 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] Fwd: setting environment variable through cmake

2009-02-16 Thread Philip Lowman
On Mon, Feb 16, 2009 at 11:03 PM, ankit jain ankitgu...@gmail.com wrote:



 -- Forwarded message --
 From: ankit jain ankitgu...@gmail.com
 Date: 2009/2/17
 Subject: Re: [CMake] setting environment variable through cmake
 To: Philip Lowman phi...@yhbt.com


 2009/2/17 Philip Lowman phi...@yhbt.com

  On Mon, Feb 16, 2009 at 7:46 AM, ankit jain ankitgu...@gmail.com wrote:

 Hi all,

 I want to set an enviromnet varibale but not able to do it.
 Currently iam using the command:
 SET( ENV{varname} value )

 But it is not working.
 Can anybody guide me how to do it by giving an example.


 Are you trying to set an environment variable that can be used during
 build time?  This isn't possible.

 http://www.cmake.org/Wiki/CMake_FAQ#How_can_I_get_or_set_environment_variables.3F

 Could you elaborate on when you need the environment variable?



 I need to set the environment variable at the time of testing since my
 test needs two environment variable that need to be set fro running the
 tests.

 Iam using cmake 2.6


This should work on the latest CMake 2.6.3 RC, provided you use make test.

set_tests_properties(foo PROPERTIES ENVIRONMENT foo=bar)


-- 
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] Fwd: setting environment variable through cmake

2009-02-16 Thread Philip Lowman
On Tue, Feb 17, 2009 at 12:15 AM, Philip Lowman phi...@yhbt.com wrote:

 On Mon, Feb 16, 2009 at 11:03 PM, ankit jain ankitgu...@gmail.com wrote:



 -- Forwarded message --
 From: ankit jain ankitgu...@gmail.com
 Date: 2009/2/17
 Subject: Re: [CMake] setting environment variable through cmake
 To: Philip Lowman phi...@yhbt.com


 2009/2/17 Philip Lowman phi...@yhbt.com

  On Mon, Feb 16, 2009 at 7:46 AM, ankit jain ankitgu...@gmail.comwrote:

 Hi all,

 I want to set an enviromnet varibale but not able to do it.
 Currently iam using the command:
 SET( ENV{varname} value )

 But it is not working.
 Can anybody guide me how to do it by giving an example.


 Are you trying to set an environment variable that can be used during
 build time?  This isn't possible.

 http://www.cmake.org/Wiki/CMake_FAQ#How_can_I_get_or_set_environment_variables.3F

 Could you elaborate on when you need the environment variable?



 I need to set the environment variable at the time of testing since my
 test needs two environment variable that need to be set fro running the
 tests.

 Iam using cmake 2.6


 This should work on the latest CMake 2.6.3 RC, provided you use make
 test.

 set_tests_properties(foo PROPERTIES ENVIRONMENT foo=bar)


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

-- 
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] CheckTypeSize and non-standard headers

2009-02-16 Thread Philip Lowman
On Mon, Feb 16, 2009 at 10:23 PM, Aaron Turner synfina...@gmail.com wrote:

 On Mon, Feb 16, 2009 at 5:53 PM, Michael Jackson
 mike.jack...@bluequartz.net wrote:
  project(Test)
  cmake_minimum_required(VERSION 2.7)
 
  INCLUDE(${CMAKE_ROOT}/Modules/CheckTypeSize.cmake)
 
  set(CMAKE_REQUIRED_DEFINITIONS_SAVE ${CMAKE_REQUIRED_DEFINITIONS})
  set(CMAKE_REQUIRED_DEFINITIONS
  ${CMAKE_REQUIRED_DEFINITIONS};-D__need_wint_t=1)
 
  CHECK_TYPE_SIZE(wint_t WINT_T)
  message(STATUS Size of wint_t: ${WINT_T})
  message(STATUS HAVE_WINT_T: ${HAVE_WINT_T})
 
  set(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS_SAVE})
 
  Although I am not sure under what circumstances you are supposed to
 define
  __need_wint_t? Or if there is some other encompassing macro to define.
  Otherwise the above will find the size in bytes of wint_t.

 Not sure I follow what you're trying to accomplish with the above.
 Is this cmake 2.7 specific or some trick with the __need_wint_t (which
 isn't used in runetype.h)?


Hmm, try it in CMake 2.6, there is a CheckTypeSize.cmake.  Also, you
shouldn't have to specify the full path to it, just

INCLUDE(CheckTypeSize.cmake)



 For now, i'm just hacking around the issue with:

 check_include_file(runetype.h HAVE_RUNETYPE_H)
 IF(APPLE AND HAVE_RUNETYPE_H)
# OS X has wint_t, but check_type_size won't find it
SET(HAVE_WINT_T 1)
 ELSE(APPLE AND HAVE_RUNETYPE_H)
check_type_size(wint_tHAVE_WINT_T)
 ENDIF(APPLE AND HAVE_RUNTYPE_H)

 Long term, I'm going to write my own version of check_symbol_exists
 which uses a different test which is define/typedef agnostic.


Please consider submitting it via the bugtracker when you're done.

-- 
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] CheckTypeSize and non-standard headers

2009-02-16 Thread Aaron Turner
On Mon, Feb 16, 2009 at 9:28 PM, Philip Lowman phi...@yhbt.com wrote:
 On Mon, Feb 16, 2009 at 10:23 PM, Aaron Turner synfina...@gmail.com wrote:

 On Mon, Feb 16, 2009 at 5:53 PM, Michael Jackson
 mike.jack...@bluequartz.net wrote:
  project(Test)
  cmake_minimum_required(VERSION 2.7)
 
  INCLUDE(${CMAKE_ROOT}/Modules/CheckTypeSize.cmake)
 
  set(CMAKE_REQUIRED_DEFINITIONS_SAVE ${CMAKE_REQUIRED_DEFINITIONS})
  set(CMAKE_REQUIRED_DEFINITIONS
  ${CMAKE_REQUIRED_DEFINITIONS};-D__need_wint_t=1)
 
  CHECK_TYPE_SIZE(wint_t WINT_T)
  message(STATUS Size of wint_t: ${WINT_T})
  message(STATUS HAVE_WINT_T: ${HAVE_WINT_T})
 
  set(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS_SAVE})
 
  Although I am not sure under what circumstances you are supposed to
  define
  __need_wint_t? Or if there is some other encompassing macro to define.
  Otherwise the above will find the size in bytes of wint_t.

 Not sure I follow what you're trying to accomplish with the above.
 Is this cmake 2.7 specific or some trick with the __need_wint_t (which
 isn't used in runetype.h)?

 Hmm, try it in CMake 2.6, there is a CheckTypeSize.cmake.  Also, you
 shouldn't have to specify the full path to it, just

 INCLUDE(CheckTypeSize.cmake)

As I said in my first post, CheckTypeSize doesn't include runetype.h,
hence doesn't work in this case.

 For now, i'm just hacking around the issue with:

 check_include_file(runetype.h HAVE_RUNETYPE_H)
 IF(APPLE AND HAVE_RUNETYPE_H)
# OS X has wint_t, but check_type_size won't find it
SET(HAVE_WINT_T 1)
 ELSE(APPLE AND HAVE_RUNETYPE_H)
check_type_size(wint_tHAVE_WINT_T)
 ENDIF(APPLE AND HAVE_RUNTYPE_H)

 Long term, I'm going to write my own version of check_symbol_exists
 which uses a different test which is define/typedef agnostic.

 Please consider submitting it via the bugtracker when you're done.

Will do.  Honestly, I'm a bit surprised this isn't already part of the
basic Cmake library.  Having to write try_compile() or try_run() tests
for this sort of thing is just silly- especially since you can't
inline the source code like in Autoconf.

-- 
Aaron Turner
http://synfin.net/
http://tcpreplay.synfin.net/ - Pcap editing and replay tools for Unix  Windows
Those who would give up essential Liberty, to purchase a little
temporary Safety,
deserve neither Liberty nor Safety.
-- Benjamin Franklin
___
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] Working with make test

2009-02-16 Thread ankit jain
Hi all,

Actually my test cases are written in  C files. os iam creating executable
for that nad directly run the executbale through make.

Is it necessary to do it like make test?

If iam not doing is it iam missing something.

Apart form them i have some of my test cases defined in .tsh files which i
dont know how to handle it with cmake.
Does any body have any idea how to deal with these type of files.

Any help in thi regard will be highly appreciated.

Regards-
Ankit
___
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] CheckTypeSize and non-standard headers

2009-02-16 Thread Philip Lowman
On Tue, Feb 17, 2009 at 12:41 AM, Aaron Turner synfina...@gmail.com wrote:

 On Mon, Feb 16, 2009 at 9:28 PM, Philip Lowman phi...@yhbt.com wrote:
  On Mon, Feb 16, 2009 at 10:23 PM, Aaron Turner synfina...@gmail.com
 wrote:
  For now, i'm just hacking around the issue with:
 
  check_include_file(runetype.h HAVE_RUNETYPE_H)
  IF(APPLE AND HAVE_RUNETYPE_H)
 # OS X has wint_t, but check_type_size won't find it
 SET(HAVE_WINT_T 1)
  ELSE(APPLE AND HAVE_RUNETYPE_H)
 check_type_size(wint_tHAVE_WINT_T)
  ENDIF(APPLE AND HAVE_RUNTYPE_H)
 
  Long term, I'm going to write my own version of check_symbol_exists
  which uses a different test which is define/typedef agnostic.
 
  Please consider submitting it via the bugtracker when you're done.

 Will do.  Honestly, I'm a bit surprised this isn't already part of the
 basic Cmake library.  Having to write try_compile() or try_run() tests
 for this sort of thing is just silly- especially since you can't
 inline the source code like in Autoconf.


Not sure on the check_symbol_exists issue.

You should be able to inline source code in your CMakeLists.txt.  Here's an
example I wrote for OpenSceneGraph:

INCLUDE(CheckCXXSourceCompiles)
SET(CMAKE_REQUIRED_DEFINITIONS -DGLU_TESS_CALLBACK_TRIPLEDOT)
SET(CMAKE_REQUIRED_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/include
${GLUT_INCLUDE_DIR} ${GL_INCLUDE_DIR})
SET(CMAKE_REQUIRED_LIBRARIES ${GLUT_LIBRARY} ${GL_LIBRARY})
CHECK_CXX_SOURCE_COMPILES(
#include osg/GL
#include osg/GLU
static void testcb(GLvoid *, void*) { }
int main() {
   GLUtesselator *t = gluNewTess();
   gluTessCallback(t, GLU_TESS_VERTEX_DATA, (GLU_TESS_CALLBACK)
testcb);
   return 0;
}

GLU_Tesselator_Needs_Variable_Parameter_Callback_Convention_Failure_Means_No)
SET(DEFAULT_GLU_TESS_CALLBACK_TRIPLEDOT

${GLU_Tesselator_Needs_Variable_Parameter_Callback_Convention_Failure_Means_No})


-- 
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] CheckTypeSize and non-standard headers

2009-02-16 Thread Aaron Turner
On Mon, Feb 16, 2009 at 9:53 PM, Philip Lowman phi...@yhbt.com wrote:
 On Tue, Feb 17, 2009 at 12:41 AM, Aaron Turner synfina...@gmail.com wrote:

 On Mon, Feb 16, 2009 at 9:28 PM, Philip Lowman phi...@yhbt.com wrote:
  On Mon, Feb 16, 2009 at 10:23 PM, Aaron Turner synfina...@gmail.com
  wrote:
  For now, i'm just hacking around the issue with:
 
  check_include_file(runetype.h HAVE_RUNETYPE_H)
  IF(APPLE AND HAVE_RUNETYPE_H)
 # OS X has wint_t, but check_type_size won't find it
 SET(HAVE_WINT_T 1)
  ELSE(APPLE AND HAVE_RUNETYPE_H)
 check_type_size(wint_tHAVE_WINT_T)
  ENDIF(APPLE AND HAVE_RUNTYPE_H)
 
  Long term, I'm going to write my own version of check_symbol_exists
  which uses a different test which is define/typedef agnostic.
 
  Please consider submitting it via the bugtracker when you're done.

 Will do.  Honestly, I'm a bit surprised this isn't already part of the
 basic Cmake library.  Having to write try_compile() or try_run() tests
 for this sort of thing is just silly- especially since you can't
 inline the source code like in Autoconf.

 Not sure on the check_symbol_exists issue.

 You should be able to inline source code in your CMakeLists.txt.  Here's an
 example I wrote for OpenSceneGraph:

 INCLUDE(CheckCXXSourceCompiles)
 SET(CMAKE_REQUIRED_DEFINITIONS -DGLU_TESS_CALLBACK_TRIPLEDOT)
 SET(CMAKE_REQUIRED_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/include
 ${GLUT_INCLUDE_DIR} ${GL_INCLUDE_DIR})
 SET(CMAKE_REQUIRED_LIBRARIES ${GLUT_LIBRARY} ${GL_LIBRARY})
 CHECK_CXX_SOURCE_COMPILES(
 #include osg/GL
 #include osg/GLU
 static void testcb(GLvoid *, void*) { }
 int main() {
GLUtesselator *t = gluNewTess();
gluTessCallback(t, GLU_TESS_VERTEX_DATA, (GLU_TESS_CALLBACK)
 testcb);
return 0;
 }

 GLU_Tesselator_Needs_Variable_Parameter_Callback_Convention_Failure_Means_No)
 SET(DEFAULT_GLU_TESS_CALLBACK_TRIPLEDOT

 ${GLU_Tesselator_Needs_Variable_Parameter_Callback_Convention_Failure_Means_No})



Ah!  I hadn't noticed CheckCSourceCompiles/Runs... that makes things
easier!  thanks.


-- 
Aaron Turner
http://synfin.net/
http://tcpreplay.synfin.net/ - Pcap editing and replay tools for Unix  Windows
Those who would give up essential Liberty, to purchase a little
temporary Safety,
deserve neither Liberty nor Safety.
-- Benjamin Franklin
___
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] parsing config.h files and setting cmake variables accordingly

2009-02-16 Thread Clemens Arth
Yes, that was exactly what I did and it works on Linux, but it does not 
help in VS, unfortunately... VS sets up all the includes and linking 
options right, but then it prompts me to reload the project, and that's 
it

only a complete rebuild lets the  project recompile the sources.

Clemens

Michael Jackson wrote:
You would also want to add the configured file (config.h) to the list 
of sources that get compiled.


configure_file(...  config.h)

add_executable(MyApp  main.c config.h)

That way the dependency is setup between the configured file and the 
compilation of the executable.


Also I think it is generally better practice to have the input file 
that is used in the configure_file command have the name config.h.in 
rather than config.cmake. Having the .cmake file on the end may lead 
to confusion when others look at your project.


Cheers
---
Mike Jackson www.bluequartz.net



On Feb 16, 2009, at 5:32 AM, Clemens Arth wrote:


Hi again,

now I have followed exactly that way and created a config.cmake file, 
which is translated into a config.h file. This approach works 
perfectly well on Linux and everything immediately responds to 
changes in the config.cmake file. However, if I create a Visual 
Studio project on Windows, the project itself gets updated according 
to changes in the config.cmake file, but the sources including 
config.h are not recompiled. Maybe I missed something, but even if 
the config.h file changes on a build command (and it really does!), 
the sources are all treated as up2date, so no rebuilding happens. 
Maybe there is a step missing, something like marking some files as 
dirty, but I don't really think so, or at least I can not imagine...


Clemens

Michael Jackson wrote:
That is the best way to do it. Have all the options in your CMake 
file and let the user select which options they want to compile 
with. Then configure_file to create your config.h file.



---
Mike Jackson www.bluequartz.net



On Feb 13, 2009, at 7:45 AM, Clemens Arth wrote:


Hello,

the config files were written some years ago simply to collect all 
the possibilities how to compile the projects. Unfortunately this 
was long before cmake came into play, thus the problem just came up 
now because I wanted to set up a system for nightly builds.


Well, I think the best solution might be to drop the old config.h 
file and to replace it by a file for setting the variables in the 
cmake environment, and finally to create a new config.h version 
with cmake online with a call to configure_file. I think, this is, 
in principal, the way you might have kept in mind when you 
suggested a look at configure_file, right?


Regards
Clemens

Pau Garcia i Quiles wrote:

Hello,

I see. So, where is that config.h created? In your CMake 
build-system?

is it from an external library? If the former, maybe you could use
variables (cmake -DWITH_OPENGL:BOOL=1 ... ); if the latter, I don't
know (the only thing I can come with at this moment to survive
additional spaces, etc are regular expressions).

On Fri, Feb 13, 2009 at 1:10 PM, Clemens Arth 
clemens.a...@gmx.at wrote:



Hi,

thanks for the hint, but my problem is exactly the opposite of 
the one
configure_file is solving. I'm already using configure_file in 
multiple
places, but here I don't want to write config files, instead I 
want to parse
their content back to cmake, and that's why I don't think 
configure_file.


Regards
Clemens

Pau Garcia i Quiles wrote:


Hello,

Take a look at CONFIGURE_FILE

On Fri, Feb 13, 2009 at 12:46 PM, Clemens Arth 
clemens.a...@gmx.at

wrote:



Hi,

I've got a  question concerning  string processing in cmake. 
Our software
framework consists of multiple libraries and has many different 
features

to
be enabled or disabled using #defines. For example, one option 
is to

compile
with OpenGL or with OpenGL ES support. Thus in a config.h file, 
one of

two
variables is valid to be #defined, USE_OPENGL or USE_OPENGLES. 
Depending

on
the variable defined cmake should link against a specific set of
libraries.

Currently determining which feature is set works the following 
way in my

CMakeLists.txt:

Code:
# check for the configuration and set the corresponding GL/GLES 
libraries

accordingly
FILE(READ ${LIB_SOURCE_DIR}/include/config.h CURRENT_CONFIG)
STRING(REGEX MATCH \#define USE_OPENGLES GLES_IS_SET 
${CURRENT_CONFIG})
STRING(REGEX MATCH \#define USE_OPENGL GL_IS_SET 
${CURRENT_CONFIG})

IF(#define USE_OPENGLES STREQUAL ${GLES_IS_SET})
MESSAGE(GLES config!)
ELSE(#define USE_OPENGLES STREQUAL ${GLES_IS_SET})
IF(#define USE_OPENGL STREQUAL ${GL_IS_SET})
   MESSAGE(GL config!)
ELSE(#define USE_OPENGL STREQUAL ${GL_IS_SET})
   MESSAGE(Error! USE_GL or USE_GLES must be defined!)
ENDIF(#define USE_OPENGL STREQUAL ${GL_IS_SET})
ENDIF(#define USE_OPENGLES STREQUAL ${GLES_IS_SET})


Note that this is really a bad hack. First, if GLES_IS_SET is set
,GL_IS_SET
is also set automatically. Second, if by accident 

[CMake] Install target is not called

2009-02-16 Thread Pavel Shevaev
Folks, what can be the reason for install target not to be called? I
have something like this in my CMakeLists.txt:

  add_executable(foo src1 src2 src3)
  target_link_libraries(foo ${libs})
  install(PROGRAMS ${foo_BINARY_DIR}/foo
   DESTINATION ${foo_SOURCE_DIR}/bin
  )

And for some reason cd build  cmake ..  make  make install
doesn't install anything into bin directory while build completes
successfully and foo binary exists in ${foo_BINARY_DIR}

This is what make install says:

Install the project...
-- Install configuration: 

...and nothing actually happens.

-- 
Best regards, Pavel
___
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] Unrealistic percent numbers(Ubuntu cmake 2.6-patch0)

2009-02-16 Thread Pavel Shevaev
Hi, CMakers :)

I'm experiencing very weird percent numbers during the build
procedure, something like this:

[ 20%] Built target foo
[ 50%] Built target bar
[150%] Built target baz
[170%] Built target wow
...
[1000%] Built target hey

What can be causing this strange behaviour? Improperly written CMakeLists.txt?

-- 
Best regards, Pavel
___
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] Install target is not called

2009-02-16 Thread Eric Noulard
2009/2/17 Pavel Shevaev pacha.shev...@gmail.com:
 Folks, what can be the reason for install target not to be called? I
 have something like this in my CMakeLists.txt:

  add_executable(foo src1 src2 src3)
  target_link_libraries(foo ${libs})
  install(PROGRAMS ${foo_BINARY_DIR}/foo
   DESTINATION ${foo_SOURCE_DIR}/bin
  )

If your binary to install is a CMake target (like in your example)
you should use:

install(targets foo
RUNTIME DESTINATION  ${foo_SOURCE_DIR}/bin)

moreover installing in ${foo_SOURCE_DIR} is a bit strange,
if you want to collect all your compiled executable in
a bin directory of the source tree then you may
try to use

CMAKE_RUNTIME_OUTPUT_DIRECTORY

if you do

SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)

after calling make, all your executable will end up in
${PROJECT_SOURCE_DIR}/bin

finally you usually don't want to put compiled executable in the SOURCE tree
but in the BUILD tree. So one usually do:
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)


-- 
Erk
___
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-16 Thread Patrick Spendrin

Philip Lowman schrieb:

Hi,

Luigi suggested a kind of CMake ports system in a recent thread here on 
the CMake mailing list.  This would presumably be a system whereby 
popular 3rd party dependencies which have not yet CMakeified their 
source trees could be CM'd and baselined in one place and ultimately 
downloaded for easy incorporation into CMake projects (especially with a 
goal towards MSVC/MinGW portability).  VTK seems to be doing this 
internally for several of it's dependencies and the OSG project seems 
interested in doing the same for similar reasons but would prefer not to 
duplicate a bunch of work.  Since many of the dependencies overlap, is 
there general interest in this kind of a thing from the VTK perspective 
or from others?


The goal would be to create an open-source project (hosted probably at a 
neutral site like SF.net or Google Code) where the ports could be 
stored, baselined, etc. and then released so that anyone could download 
whichever are needed and incorporate them into their own projects?  
Export/Install support could also be built into the projects so that 
they could be prebuilt and installed by others and used that way as well.


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


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 ;-)





___
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



--
web: http://windows.kde.org
mailing list:kde-wind...@kde.org
irc: #kde-windows (irc.freenode.net)
___
Powered by www.kitware.com

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

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

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