Re: [CMake] Problem with circular dependencies

2009-05-28 Thread Dmytro Ovdiienko
Hello Tyler, Please find my comments below. 2009/5/29 Tyler Roscoe > On Fri, May 29, 2009 at 01:45:45AM +0430, Dmytro Ovdiienko wrote: > > I prefer encapsulation of all library related information into the > library. > > Only library know where it is located, where are public headers are > loca

Re: [CMake] Problem with circular dependencies

2009-05-28 Thread Dmytro Ovdiienko
Agree 2009/5/29 David Cole > On Thu, May 28, 2009 at 6:06 PM, Tyler Roscoe wrote: > >> Well as you concisely stated at the beginning of this discussion, you >> have a circular dependency. Software is bad at handling circular >> dependencies, so it is your job as the human to jump in and decide

Re: [CMake] Suggesting to FindQT4.cmake where to find QT4

2009-05-28 Thread Clinton Stimpson
Jed Brown wrote: Alexander Neundorf wrote: On Monday 25 May 2009, Jed Brown wrote: Bill Hoffman wrote: You can also set QMake on the cmake command line as well: cmake -DQT_QMAKE_EXECUTABLE=/path/to/qmake ../source Yeah, I'm much less concerned with this particular cas

Re: [CMake] Suggesting to FindQT4.cmake where to find QT4

2009-05-28 Thread Jed Brown
Alexander Neundorf wrote: > On Monday 25 May 2009, Jed Brown wrote: >> Bill Hoffman wrote: >>> You can also set QMake on the cmake command line as well: >>> >>> cmake -DQT_QMAKE_EXECUTABLE=/path/to/qmake ../source >> Yeah, I'm much less concerned with this particular case as with the >> philosophy

[CMake] Copy target from different configurations

2009-05-28 Thread Daniel Tavares
How can I get the location of the target being built? Granted, this file name changes depending on the configuration that you're building. I'm trying to add a post build event using add_custom_command that will copy the target executable to a different directory, but I can't get the correct loc

Re: [CMake] Question about -E cmake_progress_start ...

2009-05-28 Thread Alexander Neundorf
On Thursday 28 May 2009, Tyler Roscoe wrote: ... > Nice detective work! Thanks for sharing it. > > Alex or one of the other doc-oriented people: is it worth opening a bug > about these undocumented features? Can we add this snipper Xiangyun has > written to the wiki or somewhere else? Or is it the

Re: [CMake] Building a FreeBSD port with CPack

2009-05-28 Thread Alexander Neundorf
On Wednesday 27 May 2009, Jean-Pierre Bergamin wrote: > Hello CMake-Users > > Has anyone already tried to build a proper FreeBSD port with CPack? > I think it would not be too hard to build a generator that creates a > Makefile to build a FreeBSD port. Is there any documentation how to create > a n

Re: [CMake] Problem with ASM and COMPILE_DEFINITIONS

2009-05-28 Thread Alexander Neundorf
On Wednesday 27 May 2009, Marcel Loose wrote: > Hi all, > > I've done some more digging and found the culprit: using > add_definitions() with a quoted string containing more than one > argument. > > So, for example, the following command defines preprocessor variables > that are NOT discarded by CM

Re: [CMake] add_definitions() bug?

2009-05-28 Thread David Cole
It's not a bug in add_definitions. Quotes matter. With a space in the string inside the quotes, you are telling add_definitions that there is a single definition with a space in it. Without the quotes, you are telling add_definitions that there are two definitions separated by the space. The basi

Re: [CMake] Problem with circular dependencies

2009-05-28 Thread David Cole
On Thu, May 28, 2009 at 6:06 PM, Tyler Roscoe wrote: > Well as you concisely stated at the beginning of this discussion, you > have a circular dependency. Software is bad at handling circular > dependencies, so it is your job as the human to jump in and decide how > to break it up. We have discus

Re: [CMake] Suggesting to FindQT4.cmake where to find QT4

2009-05-28 Thread Alexander Neundorf
On Monday 25 May 2009, Jed Brown wrote: > Bill Hoffman wrote: > > You can also set QMake on the cmake command line as well: > > > > cmake -DQT_QMAKE_EXECUTABLE=/path/to/qmake ../source > > Yeah, I'm much less concerned with this particular case as with the > philosophy that the correct way to selec

Re: [CMake] Problem with circular dependencies

2009-05-28 Thread Tyler Roscoe
On Fri, May 29, 2009 at 01:45:45AM +0430, Dmytro Ovdiienko wrote: > I prefer encapsulation of all library related information into the library. > Only library know where it is located, where are public headers are located, > where lib file is located. The way you proposed violates this encapsulatio

Re: [CMake] Relative include() calls

2009-05-28 Thread David Cole
There is also one more technique to consider here. There is a self-referential variable available in every CMakeLists.txt or every included file called CMAKE_CURRENT_LIST_FILE. You could do this inside your "common.cmake" file: get_filename_component( dir "${CMAKE_CURRENT_LIST_FILE}" PATH ) i

Re: [CMake] Basic Tutorial Help

2009-05-28 Thread Adam A Smith
I feel that these are stupid questions, but I'm still a little confused about the basic example. It mentions 3 source files: hello.cxx, demo.cxx, and demo_b.cxx. So is hello.cxx supposed to be the source file for a library, with no main()? That would possibly make demo.cxx the entry point fo

Re: [CMake] Problem with circular dependencies

2009-05-28 Thread Dmytro Ovdiienko
Tyler, Please find my comments below. 2009/5/29 Tyler Roscoe > On Thu, May 28, 2009 at 10:03:11PM +0300, Dmytro Ovdiienko wrote: > > That was just a sample. CMake can build it correctly, if you specify > full > > path to the include directlry. > > > > If you root CMakeLists.txt declares ROOT_P

Re: [CMake] Problem with circular dependencies

2009-05-28 Thread Dmytro Ovdiienko
Michael, I agree with the first part and not agree with the second part of your message. Libraries (*.lib) are stored to the different folders and compiler will not find A to link it into B without full path. So CMake should provide linker with the full path of the A and B libraries. To calculate

Re: [CMake] Problem with circular dependencies

2009-05-28 Thread Tyler Roscoe
On Thu, May 28, 2009 at 10:03:11PM +0300, Dmytro Ovdiienko wrote: > That was just a sample. CMake can build it correctly, if you specify full > path to the include directlry. > > If you root CMakeLists.txt declares ROOT_PRJ you can write following in the > A project. > > INCLUDE_DIRECTORIES( >

Re: [CMake] Problem with circular dependencies

2009-05-28 Thread Michael Jackson
On May 28, 2009, at 3:03 PM, Dmytro Ovdiienko wrote: > The other side of this problem is you have to write ADD_SUBDIRECTORY > commands in specific order. IMHO it is inconvenient. CMakeLists are essentially a scripting language, so of course order matters. What would you propose instead? But.

Re: [CMake] Question about -E cmake_progress_start ...

2009-05-28 Thread Tyler Roscoe
On Thu, May 28, 2009 at 12:18:38PM -0700, Xiangyun Kong wrote: > In fact, there are quite a few commands not documented, > for the -E cmake_progress_start, based on the implementation, > the syntax format is, > >-E cmake_progress_start [] [### or ] > > and cmake requires the command line must

Re: [CMake] Question about -E cmake_progress_start ...

2009-05-28 Thread Xiangyun Kong
I found what cmake did by scannong the cmake source code, not sure why this is not documented. In fact, there are quite a few commands not documented, for the -E cmake_progress_start, based on the implementation, the syntax format is, -E cmake_progress_start [] [### or ] and cmake requires

Re: [CMake] Problem with circular dependencies

2009-05-28 Thread Dmytro Ovdiienko
Hello Tyler, Please find my comments below. 2009/5/28 Tyler Roscoe > On Thu, May 28, 2009 at 08:56:04PM +0300, Dmytro Ovdiienko wrote: > > 1. We have two projects A and B. > > 2. Project A is stored to /A > > 3. Project B is stored to /B > > 4. Project A depends on B. > > 5. Project B depends o

Re: [CMake] Problem with circular dependencies

2009-05-28 Thread Tyler Roscoe
On Thu, May 28, 2009 at 08:56:04PM +0300, Dmytro Ovdiienko wrote: > 1. We have two projects A and B. > 2. Project A is stored to /A > 3. Project B is stored to /B > 4. Project A depends on B. > 5. Project B depends on A. (please don't ask me why:) ) > 6. There is CMakeLists.txt in the If A and B

Re: [CMake] Relative include() calls

2009-05-28 Thread Michael Jackson
There is a pattern that I use that is similar to what you are wanting so I'll just throw it out there for your consideration: project (Foo) #CMake will now Define Foo_SOURCE_DIR which # is the same as the current directory. It is # also put into the cache. include (${Foo_SOURCE_DIR}/cmake/com

Re: [CMake] CMake Digest, Vol 61, Issue 81

2009-05-28 Thread Adam A Smith
Thanks guys--that was a big help. Adam ___ 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] CTest with multiple directories: problem with absolute paths

2009-05-28 Thread Tyler Roscoe
Assume a project like this: - top-level CMakeLists (calls add_subdirectory() on:) - unittest CMakeLists where add_test() is called on a bunch of unit tests in this directory - (there are many pockets of unit tests in different unittest directories.) I want to be able to run ct

Re: [CMake] Relative include() calls

2009-05-28 Thread Robert Dailey
On Thu, May 28, 2009 at 11:06 AM, Tyler Roscoe wrote: > On Thu, May 28, 2009 at 10:42:03AM -0500, Robert Dailey wrote: > > The most annoying thing about this solution, though, is that every single > > CMakeLists.txt that includes this module needs to make sure it has > > CMAKE_MODULE_PATH setup p

Re: [CMake] Relative include() calls

2009-05-28 Thread Tyler Roscoe
On Thu, May 28, 2009 at 10:42:03AM -0500, Robert Dailey wrote: > The most annoying thing about this solution, though, is that every single > CMakeLists.txt that includes this module needs to make sure it has > CMAKE_MODULE_PATH setup properly. It's just a bit redundant and > tedious. You're kind o

Re: [CMake] nightly builds with VS projects

2009-05-28 Thread Tyler Roscoe
On Thu, May 28, 2009 at 09:45:41AM -0600, Benne, Kyle wrote: > Is anyone using msbuild to run their nightly builds with Visual Studio > solutions generated by CMake? I can't get the tests to run or the > results uploaded using the command line tool. It works fine if I > build the Nightly or Exper

[CMake] nightly builds with VS projects

2009-05-28 Thread Benne, Kyle
Is anyone using msbuild to run their nightly builds with Visual Studio solutions generated by CMake? I can't get the tests to run or the results uploaded using the command line tool. It works fine if I build the Nightly or Experimental targets from within the IDE. Perhaps I am using the wrong

Re: [CMake] Relative include() calls

2009-05-28 Thread Robert Dailey
Yeah I already knew about CMAKE_MODULE_PATH, however I had forgotten that cmake modules are merely put in-place and then executed. So, CMAKE_MODULE_PATH seems to be the only choice here. The most annoying thing about this solution, though, is that every single CMakeLists.txt that includes this modu

Re: [CMake] Question about -E cmake_progress_start ...

2009-05-28 Thread Tyler Roscoe
Make sure you reply to the list, not just to me. On Wed, May 27, 2009 at 10:35:19PM -0700, Xiangyun Kong wrote: > I can sense the meaning, but just try to make sure > I could fully understand it. Do you happen to know any > documentation about it ? I don't. > My development needs to maintain so

Re: [CMake] How to guarntee the sequence of build if no target can be used

2009-05-28 Thread Tyler Roscoe
On Thu, May 28, 2009 at 10:22:16AM -0400, Dong Tiger wrote: > The problem I ran into when using add_custom_command is that C files will be > compiled before foo.h is generated and the compilation will fail. Sounds like you need to add_dependencies(C_target foo.h_custom_target). > > If your custom

[CMake] CMakeVSXXFindMake.cmake should use VSXXCOMNTOOLS variable

2009-05-28 Thread Dmytro Ovdiienko
Hello, CMake 2.6.4 cannot generate project for VS2008 Win32 on the following environment: - Windows Serevr 2003 Enterprise x64 - VS2003 (32bit) - VS2005 (32bit) - VS2008 (32bit) It uses VS2003 toolset instead VS2008 because of the order of the directories in the CMakeVS9FindMake.cmake. I chang

Re: [CMake] How to guarntee the sequence of build if no target can be used

2009-05-28 Thread Dong Tiger
Thanks for answering my question. 2009/5/27 Tyler Roscoe > On Wed, May 27, 2009 at 11:01:51PM +, idlecat...@gmail.com wrote: > > foo.h is generated from foo.x. And foo.h is included by bar.h. And then > > bar.h is included by a lot of c files. So actually every c files > including > > bar.h

Re: [CMake] Basic Tutorial Help

2009-05-28 Thread Marcel Loose
Hi Adam, CMakeLists.txt files are the files that you need to write yourself. For simple projects, you'll never need more then these. Except for the style of writing, I think the examples page does gives you a rather good start. Anyway, what about this (I just googled 'cmake tutorial') http://www-f

Re: [CMake] Basic Tutorial Help

2009-05-28 Thread Sergey Rudchenko
*Hi Adam,* ** *Here is the basic rewrite of that tutorial in the imperative. I'll consider writing a tutorial in a step-by-step manner, but here is just a quick adaptation for now.* ** --** **Wbr, Sergey ** *The following example *demonstrates some key ideas of CMake. Make sure that you have C

[CMake] Basic Tutorial Help

2009-05-28 Thread Adam A Smith
Has anybody written a basic tutorial on how to get started with CMake? I've been looking through the docs, and http://www.cmake.org/cmake/help/examples.html is not clear at all. It's written all in the passive voice, which makes it very hard to understand what's done automatically, and what th

[CMake] add_definitions() bug?

2009-05-28 Thread Marcel Loose
Hi all, I ran into this while trying to compile a few assembly sources (see thread: Problem with ASM and COMPILE_DEFINITIONS). Definitions added using add_definitions() with a quoted string containing more than one argument are NOT discarded by CMake when /usr/bin/as is called. For example, when

Re: [CMake] Problem with Linking CXX shared module

2009-05-28 Thread Marcel Loose
I disagree, Quoting from the book "Mastering CMake: A Cross-Platform Build System", section 7.4 on page 115: find_package(OpenGL) is equivalent to include(${CMAKE_ROOT}/Modules/FindOpenGL.cmake) and include(FindOpenGL) However, find_package() offers a means to specify components, which

Re: [CMake] Relative include() calls

2009-05-28 Thread Marcel Loose
Hmm, I guess the original question referred to cmake modules (at least that's what I figured from the file names). Have you tried to set CMAKE_MODULE_PATH. Then you don't need any relative paths anymore. Best regards, Marcel Loose. -Original Message- From: Adolfo Rodríguez To: Tyler Ros

Re: [CMake] Problem with Linking CXX shared module

2009-05-28 Thread Andreas Pakulat
On 28.05.09 11:27:45, nazia zaman wrote: > # Find library locations using convenient cmake search functions > include (FindBoost) > include (FindPythonLibs) This is wrong, these modules shouldn't be include()'ed. You need to use find_package(Boost) and find_package(PythonLibs). See also the cmak

Re: [CMake] Relative include() calls

2009-05-28 Thread Adolfo Rodríguez
On Thu, May 28, 2009 at 7:16 AM, Tyler Roscoe wrote: > On Wed, May 27, 2009 at 11:27:28PM -0500, Robert Dailey wrote: > > From a CMakeLists.txt in my root source dir, I am calling: > > include( ../cmake/common.cmake ) > > > > From common.cmake, I am calling: > > > > include( BoostUtils.cmake ) >