Re: [CMake] Eclipse generator - basic macros

2009-07-14 Thread Benjamin Schindler
Hei, thanks for the thorough review and hints. I'll surely apply them Thanks Benjamin Hendrik Sattler wrote: Zitat von Benjamin Schindler : I'm working on a project which builds both on linux and windows. I generated an eclipse project out of it which works basically fine but it's not able to

Re: [CMake] Eclipse generator - basic macros

2009-07-14 Thread Hendrik Sattler
Zitat von Benjamin Schindler : I'm working on a project which builds both on linux and windows. I generated an eclipse project out of it which works basically fine but it's not able to recognize i.e. the __GNUC__ macro (and probably any other macro defined per default on gcc) are not recognized b

Re: [CMake] Eclipse generator - basic macros

2009-07-14 Thread Miguel A. Figueroa-Villanueva
On Tue, Jul 14, 2009 at 7:46 PM, Benjamin Schindler wrote: > Miguel A. Figueroa-Villanueva wrote: >> Just to be clear... >> >> If you have compiler dependent code: >> >> #if defined(_MSC_VER) >> ... >> #elif defined(__GNUC__) >> ... >> #else >> ... >> #endif >> >> Then you could do something like t

Re: [CMake] Eclipse generator - basic macros

2009-07-14 Thread Benjamin Schindler
Miguel A. Figueroa-Villanueva wrote: On Tue, Jul 14, 2009 at 6:55 PM, Benjamin Schindler wrote: Hi That workaround works - I've done it when I sent the initial mail. But I can imagine various situation when this can become an issue as well (like when writing compiler or platform specific c

Re: [CMake] Eclipse generator - basic macros

2009-07-14 Thread Miguel A. Figueroa-Villanueva
On Tue, Jul 14, 2009 at 6:55 PM, Benjamin Schindler wrote: > Hi > > That workaround works - I've done it when I sent the initial mail. But I can > imagine various situation when this can become an issue as well (like when > writing compiler or platform specific code), so I posted it here anyway to

Re: [CMake] Eclipse generator - basic macros

2009-07-14 Thread Miguel A. Figueroa-Villanueva
On Tue, Jul 14, 2009 at 3:26 PM, Mike Jackson wrote: > On Tue, Jul 14, 2009 at 3:18 PM, Michael Jackson wrote: >> On Jul 14, 2009, at 3:10 PM, Miguel A. Figueroa-Villanueva wrote: >> >>> Well, I see it as a viable workaround, but only if you use eclipse >>> only with gcc. In the case where you migh

Re: [CMake] Eclipse generator - basic macros

2009-07-14 Thread Benjamin Schindler
Hi That workaround works - I've done it when I sent the initial mail. But I can imagine various situation when this can become an issue as well (like when writing compiler or platform specific code), so I posted it here anyway to start a discussion. I think the probing for defined macros like

Re: [CMake] How to remove _WINDOWS for MSVC preprocessor definitions for library & executable projects?

2009-07-14 Thread Erwin Coumans
remove_definitions(-D_WINDOWS ) didn't work, possibly because it wasn't added using add_definitions (but a built-in). I'm happy with string (REPLACE "/D_WINDOWS" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) 2009/7/14 Eric Noulard : > 2009/7/14 Erwin Coumans : >>> string (REPLACE "/D_WINDOWS" "" CMAKE

Re: [CMake] How to remove _WINDOWS for MSVC preprocessor definitions for library & executable projects?

2009-07-14 Thread Eric Noulard
2009/7/14 Erwin Coumans : >> string (REPLACE "/D_WINDOWS" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) > > Great, that did the job. > Don't know if it can work for your case but you have the 'remove_definitions' command too: remove_definitions Removes -D define flags added by add_definitions.

Re: [CMake] How to remove _WINDOWS for MSVC preprocessor definitions for library & executable projects?

2009-07-14 Thread Erwin Coumans
> string (REPLACE "/D_WINDOWS" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) Great, that did the job. Thanks! Erwin 2009/7/14 Tyler Roscoe : > On Tue, Jul 14, 2009 at 12:07:32PM -0700, Erwin Coumans wrote: >> By default Cmake seems to add some built-in preprocessor definitions >> for Visual Studio pro

Re: [CMake] Eclipse generator - basic macros

2009-07-14 Thread Mike Jackson
So. I'll take my foot out of my mouth now. I actually got CDT 6.0 to work with nmake (from VS 2008 Express). Now if I could just calm down the warning level that would make things readable. And the form that I use to control the DLL import and export seems to work also. Mike On Tue, Jul 14, 2009

Re: [CMake] cmake giving errors while building kdelibs svn

2009-07-14 Thread Alexander Neundorf
On Tuesday 14 July 2009, Primal Pappachan wrote: > 2009/7/14 Alexander Neundorf > > > On Sunday 12 July 2009, Primal Pappachan wrote: > > > On Sun, Jul 12, 2009 at 10:33 PM, Andreas Pakulat wrote: > > > > On 12.07.09 21:51:33, Primal Pappachan wrote: > > > > > I was trying to build the kdelibs sv

Re: [CMake] How to remove _WINDOWS for MSVC preprocessor definitions for library & executable projects?

2009-07-14 Thread Tyler Roscoe
On Tue, Jul 14, 2009 at 12:07:32PM -0700, Erwin Coumans wrote: > By default Cmake seems to add some built-in preprocessor definitions > for Visual Studio project files, > such as WIN32 and _WINDOWS. WIN32 is ok, but _WINDOWS is not always desired. Looks like it's set in Modules/Platform/Windows-cl

Re: [CMake] How to iterator over a set of directories containing projects?

2009-07-14 Thread Peter
Am 14.07.2009 20:22, schrieb Alexander Neundorf: On Monday 13 July 2009, Peter wrote: I have a bunch (50+) of sample programs deep in the hierarchy of my library project. Each of these samples has a similar CMakeLists.txt file, like add_executable( binning binning.cpp ) target_l

Re: [CMake] testing with standard output

2009-07-14 Thread Henrique Almeida
This is quite crazy, but it may completelly solve the problem. I wonder why there isn't a single line version of that. I'm even willing to contribute a patch, but I'd need some guidance. 2009/7/14 James C. Sutherland : > > > I asked a similar question recently.  Here is the recipe for comparing f

Re: [CMake] Eclipse generator - basic macros

2009-07-14 Thread Michael Jackson
If you are using nmake then you are using MSVC which means you would drop down into the #if defined (_MSVC_VER) block. At that point FLOW_DLL is going to be defined as either the import or export version neither of which I have any faith that CDT Would be able to parse any way (or it might

Re: [CMake] Eclipse generator - basic macros

2009-07-14 Thread Miguel A. Figueroa-Villanueva
On Tue, Jul 14, 2009 at 2:39 PM, Michael Jackson wrote: > Using the form I sent earlier I do not have any of these problems. All my > source files are parsed and indexed correctly. Am I missing something or > doing something wrong? > > Mike Jackson Hello Mike, Well, I see it as a viable workaroun

[CMake] How to remove _WINDOWS for MSVC preprocessor definitions for library & executable projects?

2009-07-14 Thread Erwin Coumans
Hi, By default Cmake seems to add some built-in preprocessor definitions for Visual Studio project files, such as WIN32 and _WINDOWS. WIN32 is ok, but _WINDOWS is not always desired. I searched and tried some previous suggestions, but it seems only able to add, but not remove definitions such as

Re: [CMake] Build Dependencies problem

2009-07-14 Thread Bill Hoffman
Eric Tellefsen wrote: Hi, I'm new to the list and relatively new to CMake. I'm currently in the process of attempting to migrate an existing project to CMake (from plain Unix makefiles) The source files for each library are in a series of subdirectories as illustrated in the simple diagra

Re: [CMake] Build Dependencies problem

2009-07-14 Thread Eric Noulard
2009/7/14 Eric Tellefsen : > > Hi, > > I'm new to the list and relatively new to CMake.  I'm currently in the > process of attempting to migrate an existing project to CMake (from plain > Unix makefiles) > > The source files for each library are in a series of subdirectories as > illustrated in the

[CMake] Build Dependencies problem

2009-07-14 Thread Eric Tellefsen
Hi, I'm new to the list and relatively new to CMake. I'm currently in the process of attempting to migrate an existing project to CMake (from plain Unix makefiles) The source files for each library are in a series of subdirectories as illustrated in the simple diagrams at the bottom of the ma

Re: [CMake] Documentation bug in MacroAddFileDependencies.cmake

2009-07-14 Thread Alexander Neundorf
On Monday 13 July 2009, Marcel Loose wrote: > Hi all, > > I noticed while browsing the documentation that there's a documentation > bug in MacroAddFileDependencies.cmake. The docs refer to a completely > different macro (MACRO_OPTIONAL_FIND_PACKAGE), which BTW is not present > at all in the Modules

Re: [CMake] Eclipse generator - basic macros

2009-07-14 Thread Michael Jackson
Jul 14, 2009, at 2:26 PM, Alexander Neundorf wrote: On Tuesday 14 July 2009, Miguel A. Figueroa-Villanueva wrote: On Tue, Jul 14, 2009 at 11:40 AM, Benjamin Schindler wrote: Miguel A. Figueroa-Villanueva wrote: On Mon, Jul 13, 2009 at 10:31 AM, Benjamin Schindler wrote: I'm working on a pro

Re: [CMake] Eclipse generator - basic macros

2009-07-14 Thread Alexander Neundorf
On Tuesday 14 July 2009, Miguel A. Figueroa-Villanueva wrote: > On Tue, Jul 14, 2009 at 11:40 AM, Benjamin Schindler wrote: > > Miguel A. Figueroa-Villanueva wrote: > >> On Mon, Jul 13, 2009 at 10:31 AM, Benjamin Schindler wrote: > >>> I'm working on a project which builds both on linux and windows

Re: [CMake] How to iterator over a set of directories containing projects?

2009-07-14 Thread Alexander Neundorf
On Monday 13 July 2009, Peter wrote: > I have a bunch (50+) of sample programs deep in the hierarchy of my > library project. Each of these samples has a similar CMakeLists.txt > file, like > > add_executable( binning binning.cpp ) > target_link_libraries( binning ${Boost_LIBRARIES} ) > >

Re: [CMake] cmake giving errors while building kdelibs svn

2009-07-14 Thread Alexander Neundorf
On Sunday 12 July 2009, Primal Pappachan wrote: > On Sun, Jul 12, 2009 at 10:33 PM, Andreas Pakulat wrote: > > On 12.07.09 21:51:33, Primal Pappachan wrote: > > > I was trying to build the kdelibs svn from by following the > > > instructions from this site. http://edu.kde.org/kstars/svn.php. > > >

Re: [CMake] Eclipse generator - basic macros

2009-07-14 Thread Miguel A. Figueroa-Villanueva
On Tue, Jul 14, 2009 at 11:40 AM, Benjamin Schindler wrote: > Miguel A. Figueroa-Villanueva wrote: >> On Mon, Jul 13, 2009 at 10:31 AM, Benjamin Schindler wrote: >>> I'm working on a project which builds both on linux and windows. I >>> generated >>> an eclipse project out of it which works basical

Re: [CMake] Nonsensical errors returned when dlls needed for execute_process aren't found.

2009-07-14 Thread Tyler Roscoe
On Tue, Jul 14, 2009 at 09:50:48AM -0600, James Bigler wrote: > I've filed a bug where execute_process returns a nonsensical error code > (with no error message) when trying to run a program that can't find all the > dlls it needs to run. > > http://www.vtk.org/Bug/view.php?id=9258 > > Has anyone

[CMake] Nonsensical errors returned when dlls needed for execute_process aren't found.

2009-07-14 Thread James Bigler
I've filed a bug where execute_process returns a nonsensical error code (with no error message) when trying to run a program that can't find all the dlls it needs to run. http://www.vtk.org/Bug/view.php?id=9258 Has anyone else experience this? It took me a lot of head scratching to determine wha

Re: [CMake] Eclipse generator - basic macros

2009-07-14 Thread Michael Jackson
On Jul 14, 2009, at 11:40 AM, Benjamin Schindler wrote: #if defined(_MSC_VER) && (_MSC_VER >= 1300) #ifdef FLOW_DLL_EXPORT #define FLOW_DLL _declspec(dllexport) #else #define FLOW_DLL _declspec(dllimport) #endif #else #ifdef __GNUC__ #define FLOW_DLL #endif #endif Not sure how dangerous thi

Re: [CMake] Eclipse generator - basic macros

2009-07-14 Thread Benjamin Schindler
Miguel A. Figueroa-Villanueva wrote: On Mon, Jul 13, 2009 at 10:31 AM, Benjamin Schindler wrote: Hi I'm working on a project which builds both on linux and windows. I generated an eclipse project out of it which works basically fine but it's not able to recognize i.e. the __GNUC__ macro (and

Re: [CMake] Problem with design and ADD_SUBDIRECTORY

2009-07-14 Thread Andreas Pakulat
On 14.07.09 12:08:43, Martin Santa María wrote: > > Hello everyone, > > I have a design problem. I have a new project consisting on different > packages. Each package should be built as a library but it could depend on > libraries generated by other packages. Also there is an executable built f

Re: [CMake] Problem with design and ADD_SUBDIRECTORY

2009-07-14 Thread Tyler Roscoe
On Tue, Jul 14, 2009 at 12:08:43PM -0300, Martin Santa María wrote: > root/ > CMakeLists.txt -> generates executable with some package libraries > package1/ > CMakeLists.txt -> generates package1.lib > package2/ > CMakeLists.txt -> generates package2.lib that depends on package1 lib

Re: [CMake] Problem with design and ADD_SUBDIRECTORY

2009-07-14 Thread Michael Jackson
In the top level CMakeLists.txt you should be able to do something like: add_executable(Foo .. ) target_link_libraries(Foo package1 package2) and it should just work. CMake will figure out the dependencies. Also in package2/CMakeLists.txt target_link_libraries(package2 package1) will work the

[CMake] Problem with design and ADD_SUBDIRECTORY

2009-07-14 Thread Martin Santa María
Hello everyone, I have a design problem. I have a new project consisting on different packages. Each package should be built as a library but it could depend on libraries generated by other packages. Also there is an executable built from some of these libraries: root/ CMakeLists.txt -> g

Re: [CMake] Eclipse generator - basic macros

2009-07-14 Thread Miguel A. Figueroa-Villanueva
On Mon, Jul 13, 2009 at 10:31 AM, Benjamin Schindler wrote: > Hi > > I'm working on a project which builds both on linux and windows. I generated > an eclipse project out of it which works basically fine but it's not able to > recognize i.e. the __GNUC__ macro (and probably any other macro defined

Re: [CMake] Querying global property in FindXXX.cmake: good or bad?

2009-07-14 Thread Clinton Stimpson
On 07/14/2009 03:34 AM, Marcel Loose wrote: Hi all, I was wondering whether it is good or bad practice to query a (global) property in a FindXXX.cmake file. The reason I wanted to do this is, that when creating statically linked executables you will have to link against every library that you (

Re: [CMake] testing with standard output

2009-07-14 Thread James C. Sutherland
On Jul 14, 2009, at 6:48 AM, Henrique Almeida wrote: Hello, When running "make test", some of my unit tests require that the result is given by a correct output, instead of (just) the correct return value (because, I'm specifically testing the ability to do output). Is there a way to configure

Re: [CMake] testing with standard output

2009-07-14 Thread Henrique Almeida
Also, is there a way to escape a string to convert it to a literal regular expression ? 2009/7/14 Henrique Almeida : >  Quite good. :-) Are there equivalents for stdin and stderr ? > > 2009/7/14 Bill Hoffman : >> Henrique Almeida wrote: >>> >>>  Hello, >>> >>>  When running "make test", some of m

Re: [CMake] testing with standard output

2009-07-14 Thread Bill Hoffman
Henrique Almeida wrote: Hello, When running "make test", some of my unit tests require that the result is given by a correct output, instead of (just) the correct return value (because, I'm specifically testing the ability to do output). Is there a way to configure CTest to report a successful

[CMake] testing with standard output

2009-07-14 Thread Henrique Almeida
Hello, When running "make test", some of my unit tests require that the result is given by a correct output, instead of (just) the correct return value (because, I'm specifically testing the ability to do output). Is there a way to configure CTest to report a successful result for certain tests

[CMake] Querying global property in FindXXX.cmake: good or bad?

2009-07-14 Thread Marcel Loose
Hi all, I was wondering whether it is good or bad practice to query a (global) property in a FindXXX.cmake file. The reason I wanted to do this is, that when creating statically linked executables you will have to link against every library that you (indirectly) depend upon. When creating dynamic

Re: [CMake] CMAKE_FIND_ROOT_PATH and cross-compilation

2009-07-14 Thread Hendrik Sattler
Zitat von Marcel Loose : Now I know that you can add ONLY_CMAKE_FIND_ROOT_PATH to a find_xxx() option. However, I only need this when cross-compiling. In the documentation I saw a hint about CMAKE_FIND_ROOT_PATH_MODE_XXX, but I couldn't find any more info on that. Is this the variable I'm lookin

[CMake] CMAKE_FIND_ROOT_PATH and cross-compilation

2009-07-14 Thread Marcel Loose
Hi all, Is there a way to globally set a variable or property that forces each find_xxx() command to only use CMAKE_FIND_ROOT_PATH when searching for files? The reason I'm asking this is that I'm getting errors like this: Cannot generate a safe runtime search path for target getparsetvalue b

Re: [CMake] Globbing expression

2009-07-14 Thread Marcel Loose
Hi Arnaud, You can't trigger the FILE(GLOB...) command during or prior to compilation or linking. The FILE(GLOB...) is executed by CMake, when CMake runs. The only way I can think of doing this is, indeed, to create a custom command and invoke some kind of globbing command (be it a shell script, y