[CMake] Nested Project()

2011-08-15 Thread klaas.holwerda

Hi,

I have several nested directories, and each directory contains a CMakeLists.txt 
file.
And most start with PROJECT(  ) Where xxx is some name for what I like to 
contains some targets.

In VC it is possible to create in the top solution, so called solution folders.
Why does CMake not use the PROJECT() statement to create such solution folders, in order to group 
targets?


If I remember well, in older versions of Cmake its VC generators, this was like 
that.
I even remember the documentation of PROJECT() did mention it as a special 
feature for VC in those days.
Why is it gone?

Regards,

Klaas





___
Powered by www.kitware.com

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

Please keep messages on-topic and check 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] add_definition??

2011-04-13 Thread klaas.holwerda

Hi,

I use ADD_DEFINITIONS( ${wxWidgets_DEFINITIONS} ) to add flags for compilation 
like this:

set( wxWidgets_CXX_FLAGS ${wxWidgets_CXX_FLAGS}
-D__WXMSW__ -D__GNUWIN32__ -D__WIN95__
-fexceptions -fno-pcc-struct-return
-fstrict-aliasing
-Wall#all warnings
-Wno-unused-variable
 )

Now a user complains that those flags are added to CXX_FLAGS as well as 
RC_FLAGS .
The first is right, the second is a problem for the resource compiler windres.exe used in codeblocks 
IDE.


What is the right way to set compiler flags for cpp sources and other flags for 
the resource compiler?

Or are the generated makefiles not correct??

Thanks,

Klaas
___
Powered by www.kitware.com

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

Please keep messages on-topic and check 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] N projects/packages that depend

2010-08-05 Thread klaas.holwerda

Hi,

I have in my repository N projects/packages, that depend on each other.
E.g. project 1 found with find_package( wxDocview ), needs to build 
first, before i can do project2.
I can not generate all at once all cmake binary project files, since the 
project2, call find_package on project 1.


Still i like to have an overall CmakeLists.txt file.

So i started in that top file with find_package( wxDocview), right after 
cmake generated the binary stuff for that wxDocview project, on which 
the second project depends.

If the compiled project is not found i tell the user to first make it.

But when i type make in project 1, it first runs cmake again, and tells 
me the again that i should first make it.

An that is no good.

Well i don't see how to do i :-(.

Does someone know how to handle such a situation?

Thanks,

Klaas


___
Powered by www.kitware.com

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

Please keep messages on-topic and check 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] Bug in Suffixes windows 2.6

2008-09-20 Thread klaas.holwerda

Hi,

I think this is a bug, only the last version of FIND_PATH actually works.
This is in Cmake 2.6 patch 0.

Thanks,

Klaas

PROJECT( myproject )

FIND_PATH( DIRTOFIND ft2build.h
 c:/soft/freetype/GnuWin32
 PATH_SUFFIXES_PATH include
 NO_DEFAULT_PATH
)

MESSAGE( results in ${DIRTOFIND} )

FIND_PATH( DIRTOFIND ft2build.h
 c:/soft/freetype/GnuWin32
 NO_DEFAULT_PATH
 PATH_SUFFIXES_PATH include
)

MESSAGE( results in ${DIRTOFIND} )

FIND_PATH( DIRTOFIND ft2build.h
 c:/soft/freetype/GnuWin32/include
 NO_DEFAULT_PATH
)

MESSAGE( results in ${DIRTOFIND} )

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] FindFreetype wrong?

2008-09-17 Thread klaas.holwerda

Hi,

I want to use FIND_PACKAGE( FREETYPE ) on windows. But it looks like it 
does not work.

If i change in FindFreetype.cmake:

FIND_PATH(FREETYPE_INCLUDE_DIR_ft2build ft2build.h
 $ENV{FREETYPE_DIR}
 NO_DEFAULT_PATH
 PATH_SUFFIXES include
)

to this:

FIND_PATH(FREETYPE_INCLUDE_DIR_ft2build ft2build.h
 $ENV{FREETYPE_DIR}/include
 NO_DEFAULT_PATH
)

It starts working. I tried setting FREETYPE_DIR environment variable 
with and without a / at the end, but that is not solving it.

Even setting this:

FIND_PATH(FREETYPE_INCLUDE_DIR_ft2build ft2build.h
 c:/soft/freetype/GnuWin32
 NO_DEFAULT_PATH
 PATH_SUFFIXES include
)

does not work, so i think it is something within Cmake itself. Maybe 
something with window paths??

This is with Visual studio 8 + Cmake 2.6 patch 0

Klaas





___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] CMake and Lua

2008-02-25 Thread klaas.holwerda

Ken Martin wrote:

Which is why CMake has
include, macro, foreach etc. which are all staples of a programming
language.
  
Right, much better to spend time on something else, and use Lua for all 
these things.
Add wxLua , and  the graphical interface becomes easy too. CMakeSetup is 
nice, but i can't organize options the way i want.


So would it be possible to make some hybrid kind of Cmake, which makes 
it possible to slowly migrate.
Or how do you think about using existing modules in Cmake syntax. Maybe 
calling Cmake macros  from a Lua script?
How exactly did you wrap in Lua what is there now? Can you mix, or is it 
just a change or two, and Cmake becomes a lua script?
I think to give this a chance, there need to be both at the same time, 
and slowly migrate modules and projects.


Just curious, and like Lua much that i use it as scripting language in 
my own project, using Cmake to generate the binding and to build it :-)


Klaas


___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] linking just static or dynamix no mix.

2007-04-03 Thread klaas.holwerda

Hi,

My own library, depends on wxWidgets, wxLua, wxstedit. The problem is 
that i need to link them all static or dynamic, not a mix of them.
Now Cmake choosen dynamic above static when available, as i understood. 
But if for library there is no dynamic version available, this becomes a 
problem. The linking will be oke, but running the executable, gives 
errors on two times initializing a static object.


Anyway, i like to set a flag too choose  what is the preferred manner 
of  linking  ( if on search for static libraries first, else prefer 
dynamic linking).

Does such a  Cmake variable  exist ?

Thanks,

Klaas
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] IF how?

2007-02-20 Thread klaas.holwerda

Hi,

The myvar is the outcome of something like this:

   EXEC_PROGRAM( sh
   ARGS ${wxWidgets_CONFIG_EXECUTABLE} ${CONFIG_TEST} 
--version

   OUTPUT_VARIABLE wxWidgets_PFVERSION
   RETURN_VALUEwxWidgets_WANTED_AVAILABLE
   )   
   IF ( NOT ${wxWidgets_WANTED_AVAILABLE} STREQUAL 0 )


So it will always be there, i am now doing it like the above.
But i am surprised,  that  it does not work  in a simpler form.

Thanks.

Klaas

Brandon J. Van Every wrote:


Try

IF(myvar)
  // blah != 0
ELSE(myvar)
 // blah == 0
ENDIF(myvar)


___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] how work dependencies

2007-02-19 Thread klaas.holwerda

Hi Bill,

Working on the test case you asked for, i discovered the problem.
Using SET_TARGET_PROPERTIES() i changed the name of the libraries.
But also is use TARGET_LINK_LIBRARIES using that real name.
I should have used the original target name it seems.

Using the real name, dependencies are not discovered, but using the 
original target used in ADD_LIBRARY() all is fine.

You might say of course.
But what i did, was put all libraries in a variable, to be used in a 
template for external user programs to use my libraries in an easy manner.
So there one needs the real names of the libraries. While in the samples 
coming with the libraries one prefers the target names itself, since 
only then Cmake finds the dependencies.


Still it is a bit strange, because using real names, Cmake did not 
understand to relink a sample, when a library was rebuild.

So it knows:
- that it links to a library since the real name is in the links list in 
the VC IDE.
- but when that library is out of date, it does not see that, and does 
not relink.


Anyway, i now use target names internal for the samples, and create a 
variable using real names for external programs.


Thanks!

Klaas

Bill Hoffman wrote:

klaas.holwerda wrote:

Hi,

I always thought that Cmake did automatically rebuild libraries, 
within the same Cmake build, linked to my application.
Like if i have several libraries created with ADD_LIBRARY() and 
linked to my end executable with TARGET_LINK_LIBARIES or just 
LINK_LIBRARIES.
But it seems i am missing something, since it stopped working for me, 
and i don't know which change did that.
Maybe it is SET_TARGET_PROPERTIES() which i use to set output names 
for libraries, different from the ones in ADD_LIBRARY its target.
So the end executable target, is linked with the endname from the 
properties, not with the original target name of ADD_LIBRARY.


SO the question is, do i need to use:

ADD_DEPENDCIES explicit, to make target like the above depend on the 
other lower targets?


Or should this be automatic ( which it was for me before ), and is 
something else wrong?
It should be working.   The best thing to try is make VERBOSE=1 and 
look at the output.

Can you create a small test case?

-Bill




___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] MSYS + MINGW + wx-config.sh

2007-02-14 Thread klaas.holwerda

Werner Smekal wrote:

Hi Klaas,

I don't actually understand your problem correctly. As I understand 
you have MSYS, wxWidgets compiled with MSYS and want somehow call 
wx-config which is a bash script from the cmake file? Is this correct?
I want to have the output of wx-config, which is a shell script, 
installed by wxWidgets in /usr/local/bin.
I am working on a new  FindwxWidgets.cmake, to get it working for Mingw 
and Msys with some extended features.



  # run the wx-config program to get cxxflags
  EXEC_PROGRAM(sh
Oke it was in front of me all the time, the sh in the above line is in 
fact sh.exe from MSYS. That makes it work more or less.

The RET variable is empty, and the result is oke.


ARGS ${wxWidgets_CONFIG_EXECUTABLE} --cxxflags
OUTPUT_VARIABLE wxWidgets_CXX_FLAGS
RETURN_VALUE RET)

FindwxWidgets.cmake is supposed to work with MSYS. Here wx-config is 
called during the cmake configuration process. If this doesn't work, 
does FindwxWidgets.cmake work for you in MSYS?

I changed it a bit already, so i now see i did something wrong. Instead of
RESULT_VARIABLE wxWidgets_WANTED_AVAILABLE

it should  be

RESULT_VALUE wxWidgets_WANTED_AVAILABLE

No warning from Cmake somehow, but at least i know what to do.

Thanks a lot for pointing me to the problem,

Klaas



___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] wxWidgets Find + Packages macros

2007-02-10 Thread klaas.holwerda

Hi Cmakers and users,

I did an attempt to improve FindwxWidgets, and to add some macros to 
easily add packages based on something in the making called wxWidgets 
Packages.


http://wxwpm.sourceforge.net/index.php

The packages must be compiled in the same manner as the wxWidgets build 
that was found, also naming of libraries in a package is based on what 
was found in the FindwxWidgets stage.

Questions:
- I am not sure if a FindXX module may contain macros to easily do extra 
thing with the module found, like finding thirdparty libraries or naming 
your own libraries on the bases of the module found etc.

- Where to best place this (wxWidgets itself or in Cmake ).

I did upload it here: http://www.pontademangue.com/tmp/wxpm.tgz

It contains the modified FindwxWidgets, a packaged called led + a 
sample which uses both.
I did test it for VC and Linux. Very likely its needs some additional 
things to deal with MingW or Cygwin, and borland etc. I already did try, 
but not test it. I am already using it as part of wxArt2D, and it does 
the job there.


Oke, this is just a first step, i am open to all suggestions!

Thanks to the original writers of the last version of FindwxWidgets, let 
me know what i did wrong or where to go next.


regards,

Klaas


___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] compile header file for precompiled gcc headers

2006-12-17 Thread klaas.holwerda

Hi,

I want to get gcc to use precompiled headers.
From http://gcc.gnu.org/onlinedocs/gcc/Precompiled-Headers.html
i read that i need to compile a header file ( containing #includes to 
all others for instance ).


I have this haeder file, how to compile it with Cmake?

I tried CHECK_CXX_SOURCE_COMPILES( wxart2d.h DONNO )

But that does not produce a wxart2d.gch file.

Understand that i do not need to get an executable nor library.

Does somebody know how to do it?

Has someone already succeeded in using precompiled headers with gcc on 
Linux, any tips?


Thanks,

Klaas
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] EXECUTE_PROCESS to strip

2006-12-14 Thread klaas.holwerda

Hi I did read this, in release notes:

* Allow EXECUTE_PROCESS to strip trailing white space

Is this automatically or how does one do it?

Thanks,

Klaas


___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake