[CMake] Testing with CMake--issue of subdirs

2010-03-23 Thread Kiran Gopal Patil
Hi,

I do have following folder structure
main
|
| sub1
| |
| |-sub11
|
|--sub2
| |--sub22
|
|--sub3
| |--sub33
|

I do have the CMakeLists.txt for the main and sub1,2,3 are added in it which
inturn add sub11,22,33

I want to do make test  for full project at directory main.
In addition to this I want to do make test for sub11,22,33 selectively
like say make test sub11.

Can I do something like this with CMake?
Please help me.

-- 
Thanks  Regards,
Kiran Patil
___
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] issue with debugging on codeblocks (cmake generated project)

2010-03-23 Thread nader.akh...@laposte.net

Hello,

I can't debug on my cmake generated project for codeblocks, despite having 
activated debug symbol and explicitely added src path.
I always get the message:

No source file named 
/home/toto/Bureau/tdr/tdr_games/brothers_on_death/src/main_rpg_brothers_on_death.cpp

Don't know if it's cmake issue or codeblocks. Does anyone meet the same issue?
Here are my traces, if it could help:

debugger output:


Building to ensure sources are up-to-date
Build succeeded
Selecting target:
brothers_on_death
Adding source dir: /home/toto/Bureau/tdr/tdr_engine/src
Adding source dir: /home/toto/Bureau/tdr/tdr_engine_impl/src
Adding source dir: /home/toto/Bureau/tdr/tdr_engine_impl/tdr_engine_impl_sdl/src
Adding source dir: /home/toto/Bureau/tdr/tdr_games/brothers_on_death/src
Adding source dir: /home/toto/Bureau/tdr/
Adding source dir: /home/toto/Bureau/tdr/
Changing directory to: 
/home/toto/Bureau/tdr/build/CodeBlocksUnix/tdr_games/brothers_on_death
Adding file: 
/home/toto/Bureau/tdr/build/CodeBlocksUnix/tdr_games/brothers_on_death/brothers_on_death
Starting debugger:
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Debugger name and version: GNU gdb (GDB) 7.0-ubuntu
No source file named 
/home/toto/Bureau/tdr/tdr_games/brothers_on_death/src/main_rpg_brothers_on_death.cpp.
Breakpoint 1 
(/home/toto/Bureau/tdr/tdr_games/brothers_on_death/src/main_rpg_brothers_on_death.cpp:145)
 pending.
No source file named 
/home/toto/Bureau/tdr/tdr_games/brothers_on_death/src/main_rpg_brothers_on_death.cpp.
Breakpoint 2 
(/home/toto/Bureau/tdr/tdr_games/brothers_on_death/src/main_rpg_brothers_on_death.cpp:158)
 pending.
No source file named 
/home/toto/Bureau/tdr/tdr_games/brothers_on_death/src/main_rpg_brothers_on_death.cpp.
Breakpoint 3 
(/home/toto/Bureau/tdr/tdr_games/brothers_on_death/src/main_rpg_brothers_on_death.cpp:156)
 pending.
No source file named /home/toto/Bureau/tdr/tdr_engine_impl/src/tdr_engine.cpp.
Breakpoint 4 (/home/toto/Bureau/tdr/tdr_engine_impl/src/tdr_engine.cpp:301) 
pending.
No source file named /home/toto/Bureau/tdr/tdr_engine_impl/src/tdr_engine.cpp.
Breakpoint 5 (/home/toto/Bureau/tdr/tdr_engine_impl/src/tdr_engine.cpp:295) 
pending.
No source file named 
/home/toto/Bureau/tdr/tdr_engine_impl/tdr_engine_impl_sdl/src/tdr_grafbox_sdl.cpp.
Breakpoint 6 
(/home/toto/Bureau/tdr/tdr_engine_impl/tdr_engine_impl_sdl/src/tdr_grafbox_sdl.cpp:39)
 pending.
No source file named 
/home/toto/Bureau/tdr/tdr_engine_impl/tdr_engine_impl_sdl/src/tdr_grafbox_sdl.cpp.
Breakpoint 7 
(/home/toto/Bureau/tdr/tdr_engine_impl/tdr_engine_impl_sdl/src/tdr_grafbox_sdl.cpp:31)
 pending.
Child process PID: 9453
Program exited with code 0377.
Debugger finished with status 0


debugger logs:


LD_LIBRARY_PATH=.:
Command-line: /usr/bin/gdb -nx -fullname  -quiet -args 
/home/toto/Bureau/tdr/build/CodeBlocksUnix/tdr_games/brothers_on_death/brothers_on_death
Working dir : /home/toto/Bureau/tdr/
Reading symbols from 
/home/toto/Bureau/tdr/build/CodeBlocksUnix/tdr_games/brothers_on_death/brothers_on_death...
done.
(gdb)
 set prompt cb_gdb:
Executing: xterm -T 'Program Console' -e sleep 84325
cb_gdb:
 show version
GNU gdb (GDB) 7.0-ubuntu
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type show copying
and show warranty for details.
This GDB was configured as i486-linux-gnu.
For bug reporting instructions, please see:
.
cb_gdb:
 set confirm off
cb_gdb:
 set width 0
cb_gdb:
 set height 0
cb_gdb:
 set breakpoint pending on
cb_gdb:
 set print asm-demangle on
cb_gdb:
 set unwindonsignal on
cb_gdb:
 set disassembly-flavor intel
cb_gdb:
 cd /home/toto/Bureau/tdr/build/CodeBlocksUnix/tdr_games/brothers_on_death
cb_gdb:
 directory /home/toto/Bureau/tdr/tdr_engine/src
cb_gdb:
 directory /home/toto/Bureau/tdr/tdr_engine_impl/src
cb_gdb:
 directory /home/toto/Bureau/tdr/tdr_engine_impl/tdr_engine_impl_sdl/src
cb_gdb:
 directory /home/toto/Bureau/tdr/tdr_games/brothers_on_death/src
cb_gdb:
 directory /home/toto/Bureau/tdr/
cb_gdb:
 break 
 /home/toto/Bureau/tdr/tdr_games/brothers_on_death/src/main_rpg_brothers_on_death.cpp:145
No source file named 
/home/toto/Bureau/tdr/tdr_games/brothers_on_death/src/main_rpg_brothers_on_death.cpp.
Breakpoint 1 
(/home/toto/Bureau/tdr/tdr_games/brothers_on_death/src/main_rpg_brothers_on_death.cpp:145)
 pending.
cb_gdb:
 break 
 /home/toto/Bureau/tdr/tdr_games/brothers_on_death/src/main_rpg_brothers_on_death.cpp:158
No source file named 
/home/toto/Bureau/tdr/tdr_games/brothers_on_death/src/main_rpg_brothers_on_death.cpp.
Breakpoint 2 
(/home/toto/Bureau/tdr/tdr_games/brothers_on_death/src/main_rpg_brothers_on_death.cpp:158)
 pending.
cb_gdb:
 break 
 /home/toto/Bureau/tdr/tdr_games/brothers_on_death/src/main_rpg_brothers_on_death.cpp:156
No source file named 

Re: [CMake] scope of set_source_files_properties?

2010-03-23 Thread Brad King
Simmons, Aaron wrote:
Am I missing something?  The code is below...
 
 Top-level CMakeLists.txt:
 cmake_minimum_required(VERSION 2.8)
 project(test)
 
 set(src ${CMAKE_CURRENT_SOURCE_DIR}/subdir/test.c)
 
 add_subdirectory(subdir)
 get_source_file_property( temp ${src} COMPILE_FLAGS )

Due to historical development reasons, source file properties
are scoped only in the directory where they are set.  Only
targets created by an add_exectuable, add_library, or
add_custom_target commands in the *same* directory (not even
a subdirectory) can see the property of a source file.

-Brad
___
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] scope of set_source_files_properties?

2010-03-23 Thread David Cole
Sorry for my misleading answer on this yesterday. Even I, as a CMake
developer, was surprised by this.


On Tue, Mar 23, 2010 at 8:43 AM, Michael Wild them...@gmail.com wrote:


 On 23. Mar, 2010, at 13:33 , Brad King wrote:

  Simmons, Aaron wrote:
  Am I missing something?  The code is below...
 
  Top-level CMakeLists.txt:
 cmake_minimum_required(VERSION 2.8)
 project(test)
 
 set(src ${CMAKE_CURRENT_SOURCE_DIR}/subdir/test.c)
 
 add_subdirectory(subdir)
 get_source_file_property( temp ${src} COMPILE_FLAGS )
 
  Due to historical development reasons, source file properties
  are scoped only in the directory where they are set.  Only
  targets created by an add_exectuable, add_library, or
  add_custom_target commands in the *same* directory (not even
  a subdirectory) can see the property of a source file.
 
  -Brad

 Would be nice if that was mentioned somewhere (preferably in the
 SET_SOURCE_FILES_PROPERTIES docs). Or is it just me not being able to read
 man-pages once again ;-)

 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

___
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] scope of set_source_files_properties?

2010-03-23 Thread Michael Wild
I actually knew that source file properties are local to the directory, but 
only because I've been bitten by this already ;-)

Michael

On 23. Mar, 2010, at 13:59 , David Cole wrote:

 Sorry for my misleading answer on this yesterday. Even I, as a CMake
 developer, was surprised by this.
 
 
 On Tue, Mar 23, 2010 at 8:43 AM, Michael Wild them...@gmail.com wrote:
 
 
 On 23. Mar, 2010, at 13:33 , Brad King wrote:
 
 Simmons, Aaron wrote:
 Am I missing something?  The code is below...
 
 Top-level CMakeLists.txt:
   cmake_minimum_required(VERSION 2.8)
   project(test)
 
   set(src ${CMAKE_CURRENT_SOURCE_DIR}/subdir/test.c)
 
   add_subdirectory(subdir)
   get_source_file_property( temp ${src} COMPILE_FLAGS )
 
 Due to historical development reasons, source file properties
 are scoped only in the directory where they are set.  Only
 targets created by an add_exectuable, add_library, or
 add_custom_target commands in the *same* directory (not even
 a subdirectory) can see the property of a source file.
 
 -Brad
 
 Would be nice if that was mentioned somewhere (preferably in the
 SET_SOURCE_FILES_PROPERTIES docs). Or is it just me not being able to read
 man-pages once again ;-)
 
 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
 

___
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] Testing with CMake--issue of subdirs

2010-03-23 Thread Tyler Roscoe
On Tue, Mar 23, 2010 at 02:43:45PM +0530, Kiran Gopal Patil wrote:
 I do have the CMakeLists.txt for the main and sub1,2,3 are added in it which
 inturn add sub11,22,33
 
 I want to do make test  for full project at directory main.
 In addition to this I want to do make test for sub11,22,33 selectively
 like say make test sub11.

Use ctest directly instead of make test. ctest has a bunch of flags (-R,
-I, -E) that you can use to run subsets of the tests in your system.

tyler
___
Powered by www.kitware.com

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

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

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


Re: [CMake] Handling library dependencies and minimizing duplicated include_directories

2010-03-23 Thread Tyler Roscoe
On Mon, Mar 22, 2010 at 05:47:15PM -0700, aaron_wri...@selinc.com wrote:
 So... no easy answer for this? The only reason I bring this up is that 
 I've looked at the cmake version of boost, and it requires a library of 
 several cmake files full of macros and functions that help get their 
 project organization to work with cmake. I've had to resort to the same 
 kind of thing. ADD_LIBRARY just didn't cut it. I like that cmake allows me 
 to get to the functionality I want, but it seems that it becomes a 
 scripting language at that point, and cmake is certainly not a scripting 
 language. Boost for example has numerous helper functions or macros for 
 using named arguments with macros and functions. (They are all very 
 cleaver and I totally use them in my project.) Another example is that my 
 project has functions and macros for adding the dependencies between 
 libraries, dependencies like include directories, link directories, and 
 link libraries. Is there something on the horizon for CMake to address 
 these issues? Or have they been addressed, but I've missed them?
 
 On a side note, I see questions for this kind of thing all the time on 
 this mailing list. I never see a very good answer. Perhaps a wiki page or 
 a blog could be made covering project organization. It could perhaps cut 
 down on repeat questions.

My take on this is that every build system is a little different. Weird
organic organization builds up over time. Different groups have
different requirements. Different compilers and platforms require
slightly different approaches. As such, it's hard to write a one size
fits all solution.

So I think the only way CMake can succeed is by providing fundamental
building blocks and letting build engineers put those pieces together
into a whole that suits their needs.

I *do* think of CMake as a scripting language, one that's tuned for
modelling builds and perfomring common activities related to builds
(manipulating files, calling external scripts).

That said, I agree the Boost stuff is interesting and once it matures, I
hope we can find a way to absorb those concepts into CMake proper. Kind
of like how the Boost libraries are experimental additions to C++ that
are (sloowly) migrating back into the C++ spec.

I also agree that the wiki could be expanded with more examples of
common practices. The archives for this mailing list are sprinkled with
fantastic examples from some experienced developers but it's not always
easy to find what you're looking for.

tyler
___
Powered by www.kitware.com

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

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

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


Re: [CMake] scope of set_source_files_properties?

2010-03-23 Thread Brad King
Simmons, Aaron wrote:
 Lots of these subfolders have per-source flags/args
 
 Is there some other way to go about doing this?

Generally per-source flags should be reserved for tweaking and
workarounds such as using -O0 to disable buggy optimizations.
Their Makefile and VS project file implementations are not
scalable (as in changing one flag on one file causes the whole
target to recompile).

Are all these sources going into a single executable?
If so, I suggest using an add_library() to create a static
library for each feature.  Then link the executable to all
of them.

-Brad
___
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] scope of set_source_files_properties?

2010-03-23 Thread Brad King
Brad King wrote:
 Simmons, Aaron wrote:
 Lots of these subfolders have per-source flags/args

 Is there some other way to go about doing this?
 
 Generally per-source flags should be reserved for tweaking and
 workarounds such as using -O0 to disable buggy optimizations.
 Their Makefile and VS project file implementations are not
 scalable (as in changing one flag on one file causes the whole
 target to recompile).
 
 Are all these sources going into a single executable?
 If so, I suggest using an add_library() to create a static
 library for each feature.  Then link the executable to all
 of them.

Oh, and then you can specify per-feature flags as target
flags on each static library.

-Brad
___
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] scope of set_source_files_properties?

2010-03-23 Thread Simmons, Aaron
 Due to historical development reasons, source file properties
 are scoped only in the directory where they are set.  Only
 targets created by an add_exectuable, add_library, or
 add_custom_target commands in the *same* directory (not even
 a subdirectory) can see the property of a source file.

Wow, this seriously needs to be documented.  Also, I'm surprised this has never 
been mentioned on the list before (I've been searching).  As a feature request, 
perhaps set_source_files_properties() could have a scope parameter in the same 
way set() does.

This limitation has put a major crimp in my ability to cleanly make a project.  
It's a library with tons of subfolders organized by feature:
 src/
  somefeature1/
  somefeature2/
  ...

I have CMakeList.txt files in each subfolder that add the sources for that 
folder.  Lots of these subfolders have per-source flags/args that need to be 
set.  Ideally, it should be up to the CMakeList in a subfolder to set these 
per-source flags.  Otherwise, the top level CMakeList needs to set them all, 
which makes it highly cluttered (and not particularly modular).

Is there some other way to go about doing this?



Thanks,
aaron

___
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] scope of set_source_files_properties?

2010-03-23 Thread Brad King
Simmons, Aaron wrote:
 You have to send in a flag that tells it what audio api to use on which OS.

We rarely create source files that depend on definitions from the command line
to function (which is one reason per-source flags are not solid in CMake).
Instead we use configure_file() to put options in header files which then
get included by the sources.  It's much more reliable because the configured
header gets included in dependency scanning.

 Are all these sources going into a single executable?
 If so, I suggest using an add_library() to create a static
 library for each feature.  Then link the executable to all
 of them.

 Oh, and then you can specify per-feature flags as target
 flags on each static library.
 
 All the sources are going into a single *library*.  I could make a bunch of 
 static libraries corresponding to each folder, but I'm not sure how to 
 subsequently link all them into a single static library.  (It's been 
 mentioned elsewhere on this list, but the answer was vague.)

That's a convenience library approach, and it's not really supported
(partly because there is no way to implement it on some toolchains such
as MSVC).

-Brad
___
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] scope of set_source_files_properties?

2010-03-23 Thread Hendrik Sattler
Am Dienstag 23 März 2010 16:42:42 schrieb Brad King:
  All the sources are going into a single *library*.  I could make a bunch
  of static libraries corresponding to each folder, but I'm not sure how to
  subsequently link all them into a single static library.  (It's been
  mentioned elsewhere on this list, but the answer was vague.)
 
 That's a convenience library approach, and it's not really supported
 (partly because there is no way to implement it on some toolchains such
 as MSVC).

The problem comes up once in a while. And the argument for why this doesn't 
work is that you cannot link static libraries into another. Well, then don't, 
I'd say. CMake knows the names of the object files to link into the final 
library, it just needs a frame to let the CMake user work with it. One could 
be a VIRTUAL key word for add_library that makes it just a place-holder for a 
group of object files: no link stage. When such a library is linked to 
another, well... obvious...

HS
___
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] scope of set_source_files_properties?

2010-03-23 Thread Verweij, Arjen
Hi,

-Original Message-
From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf
Of Simmons, Aaron


All the sources are going into a single *library*.  I could make a bunch
of static libraries corresponding to each folder, but I'm not sure how
to subsequently link all them into a single static library.  (It's been
mentioned elsewhere on this list, but the answer was vague.)

For our Fortran code, we're currently migrating from Makefiles and RCS to SVN 
and CMake. It is apparent that CMake and static libraries over more than a 
single source directory don't play nice. Fortunately Michael Wild was nice 
enough to type it out for the inadvertent cmake user.

Also, we ran into the problem referenced in this thread, where the source flags 
that were overridden mysteriously disappeared. Sometimes, inside the source 
(mostly Fortran) are compiler flags differing from the default that need to 
be set, as well as openmp statements. So instead of setting the source flags in 
the local directory, we're now going to set it from the top level target, and 
wrap the functionality in a my_add_library() that will parse the source list, 
look for override cmake files, set the overrides for the particular file and 
THEN add the library. Easy as pie.

At any rate, it seems like a rather elaborate workaround...

I agree. But linking is really expensive, so I'm seriously considering making a 
customer version (also for innight testing) and a development version that will 
use shared objects so you don't have to link a tonne of objects everytime you 
changed a source file. Previously, we would have source and binaries sit in a 
shared directory, and the make system would just link the updated object again 
the already existing binary, to keep it fast. Of course this has drawbacks, but 
I'm looking for something equally fast and I don't think I will achieve it 
without going to an .so model for the subcomponents.

If only there were a function like add_objects() that would provide you with 
targets to be used further along the line, eh :) But I guess this usage really 
is a corner case and not used much.

Regards,
Arjen


___
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] scope of set_source_files_properties?

2010-03-23 Thread Verweij, Arjen
Hi,

-Original Message-
From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On 
Behalf Of Hendrik Sattler


 That's a convenience library approach, and it's not really 
 supported (partly because there is no way to implement it on some 
 toolchains
such
 as MSVC).

The problem comes up once in a while. And the argument for why this 
doesn't work is that you cannot link static libraries into another. 
Well, then don't, I'd say. CMake knows the names of the object files to 
link into the final library, it just needs a frame to let the CMake 
user work with it. One could be a VIRTUAL key word for add_library that 
makes it just a place-holder for a group of object files: no link 
stage. When such a library is linked to another, well... obvious...

Yes please! :) It would make my life much easier.

Regards,
Arjen
___
Powered by www.kitware.com

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

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

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


Re: [CMake] CMake + SWIG = Java JNI problems

2010-03-23 Thread Chris Hamons
Anybody want to take a stab at this? Maybe point me to the e-mail
address of somebody who could help. I've read what documentation
exists and poked around the source code to no avail. Google gives no
helpful answers.

Thanks,
--Chris

On Sun, Mar 21, 2010 at 11:20 PM, Chris Hamons chris.ham...@gmail.com wrote:
 Hello everyone,
                I'm having trouble mixing cmake and swig to make a
 java JNI module. It looks roughly:

        IF(DEFINED SWIG_JAVA)
                FIND_PACKAGE(JNI REQUIRED)
                include_directories(${JNI_INCLUDE_DIRS})
                SET(CMAKE_SWIG_OUTDIR ${ROOT_DIR}/swig/generated/java/libtcod)
                SWIG_ADD_MODULE(libtcod-java java libtcod.i)
                SWIG_LINK_LIBRARIES(libtcod-java ${JNI_LIBRARIES} 
 ${LIBTCOD_NAME})
        ENDIF()

 With  ${LIBTCOD_NAME} being the name of the library this JNI is trying
 to wrap (libtcod-VS.dll).

 It builds fine, and my entire build produces:
 libtcod-VS.dll (the main library)
 libtcod-java.dll (the swig generated library)
 A bunch of .java files files I build into a .jar

 The problem is when I try to load it in java, I get
 UnsatisfiedLinkError errors. The error is related to symbols exported
 from libtcod-VS.dll. It seems that java JNI wants both the SWIG
 symbols and the base library symbols in the same library.

 What I can't seem to do is to do that. I've tried adding the cpp files
 for the library into the SWIG_ADD_MODULE list to build into
 libtcod-java.dll, however that won't link. The base library uses this
 line:

        set_property(TARGET ${LIBTCOD_NAME} PROPERTY COMPILE_DEFINITIONS
 LIBTCOD_EXPORTS)

 to setup the headers correctly for linking. However, since the swig
 project name is abstracted via SWIG_ADD_MODULE and
 SWIG_LINK_LIBRARIES, I don't know how I can set this.

 Any suggestions? My {python,ruby,csharp,lua} wrappers don't have this
 problem, since they seem perfectly happy to have my swig symbols in a
 different file as the base symbols.

 Thanks,
 Chris Hamons

___
Powered by www.kitware.com

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

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

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


Re: [CMake] CMake 2.8 config error

2010-03-23 Thread Dean Inglis

Here is a bit more after some testing.
I tried compiling against the stable ITK release
(InsightToolkit-3.16.0) with CMake 2.8 and
get the same error.  I removed CMake 2.8 and
installed CMake 2.6, did a clean config and build
of all sources and now the error no longer occurs.
I am cc'ing to CMake users as this seems more of a
CMake issue than ITK (or CMake with ITK?).

Dean



I am statically building cvs ITK against gdcm 2.1
on Win32 using VS 2005 express nmake with CMake 2.8.
During configuration I get this error:

Cmake Error at Utilities/MetaIO/CMakeLists.txt:104 (INSTALL):
install TARGETS given no ARCHIVE DESTINATION for static
library target vtkmetaio.

I am doing an nmake install to a CMAKE_INSTALL_PREFIX:PATH
set for all my kitware projects (VTK, KWWidgets, gdcm. ITK).

I am building everything statically so that my KWWidgets app will be 
deployable.

I am using a common Install path to circumvent a VS resource compiler
error involving too many includes.

Is there a setting I am missing somewhere in my cache files or is this a 
bug?


Dean


___
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] [Insight-users] CMake 2.8 config error

2010-03-23 Thread Brad King
Dean Inglis wrote:
 Here is a bit more after some testing.
 I tried compiling against the stable ITK release
 (InsightToolkit-3.16.0) with CMake 2.8 and
 get the same error.  I removed CMake 2.8 and
 installed CMake 2.6, did a clean config and build
 of all sources and now the error no longer occurs.
 I am cc'ing to CMake users as this seems more of a
 CMake issue than ITK (or CMake with ITK?).
[snip]
 Cmake Error at Utilities/MetaIO/CMakeLists.txt:104 (INSTALL):
 install TARGETS given no ARCHIVE DESTINATION for static
 library target vtkmetaio.

Edit ITK/Utilities/MetaIO/CMakeLists.txt to add some message()-s
in this top block:

IF(VTK_VERSION)
  SET(METAIO_FOR_VTK 1)
  MARK_AS_ADVANCED( METAIO_FOR_VTK )
  SET(METAIO_NAMESPACE vtkmetaio)
  MESSAGE(FATAL_ERRORO ITK IS NOT VTK!)  # ADD THIS LINE
ELSE(VTK_VERSION)
...
ENDIF(VTK_VERSION)

Does CMake hit this?  Are you pointing ITK at a VTK?

-Brad
___
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] [Insight-users] CMake 2.8 config error

2010-03-23 Thread Dean Inglis

Hi Brad,

It'll be a while until I can check this again,
since Ive deleted the problem builds.  Im not
sure how I could be pointing ITK at VTK
other than having gdcm built pointing
to the install directory for VTK to build
vtkgdcm and then ITK pointing to gdcm
in the install directory.  Ill try again and
post if I get the error.

Dean




Dean Inglis wrote:

Here is a bit more after some testing.
I tried compiling against the stable ITK release
(InsightToolkit-3.16.0) with CMake 2.8 and
get the same error.  I removed CMake 2.8 and
installed CMake 2.6, did a clean config and build
of all sources and now the error no longer occurs.
I am cc'ing to CMake users as this seems more of a
CMake issue than ITK (or CMake with ITK?).

[snip]

Cmake Error at Utilities/MetaIO/CMakeLists.txt:104 (INSTALL):
install TARGETS given no ARCHIVE DESTINATION for static
library target vtkmetaio.


Edit ITK/Utilities/MetaIO/CMakeLists.txt to add some message()-s
in this top block:

IF(VTK_VERSION)
 SET(METAIO_FOR_VTK 1)
 MARK_AS_ADVANCED( METAIO_FOR_VTK )
 SET(METAIO_NAMESPACE vtkmetaio)
 MESSAGE(FATAL_ERRORO ITK IS NOT VTK!)  # ADD THIS LINE
ELSE(VTK_VERSION)
...
ENDIF(VTK_VERSION)

Does CMake hit this?  Are you pointing ITK at a VTK?

-Brad

___
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] Question about Nightly Builds

2010-03-23 Thread Felipe Sodre dos Santos
Hi. I have two CTEST scripts on my linux environment. One of them is for 
Nightly builds, and the other one for Experimental builds.

The only difference between them is that one calls CTEST_START (Experimental) 
while the other one calls CTEST_START (Nightly). Both of them delete the source 
directory, do a fresh checkout from SVN, configure, build and test.

Last night my nightly build broke, and after making some changes in the code 
and submitting to SVN server, it works for the experimental build. However, 
when I try the Nightly one again, it breaks exactly the same way as last night, 
as if I hadn't submitted any fix. How could that be?

Thanks!
___
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] Question about Nightly Builds

2010-03-23 Thread Tyler Roscoe
On Tue, Mar 23, 2010 at 04:50:54PM -0300, Felipe Sodre dos Santos wrote:
 Last night my nightly build broke, and after making some changes in
 the code and submitting to SVN server, it works for the experimental
 build. However, when I try the Nightly one again, it breaks exactly
 the same way as last night, as if I hadn't submitted any fix. How
 could that be?

The Nightly build updates your working copy to its state at
${CTEST_NIGHTLY_START_TIME}.

tyler
___
Powered by www.kitware.com

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

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

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


[CMake] Problems with CMake.ModuleNotices test

2010-03-23 Thread Orion Poplawski
It looks like the CMake.ModuleNotices test is not parallel safe.  I'm 
seeing randomly different errors on builds:


build #1
148: CMake Error at ModuleNoticesTest.cmake:44 (message):
148:   Some modules do not have a valid copyright notice:
148:
148: FindEXPAT.cmake
148: FindOpenSceneGraph.cmake

and

build #2
148: CMake Error at ModuleNoticesTest.cmake:44 (message):
148:   Some modules do not have a valid copyright notice:
148:
148: FindPerlLibs.cmake


--
Orion Poplawski
Technical Manager 303-415-9701 x222
NWRA/CoRA DivisionFAX: 303-415-9702
3380 Mitchell Lane  or...@cora.nwra.com
Boulder, CO 80301  http://www.cora.nwra.com
___
Powered by www.kitware.com

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

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

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


[CMake] Noob question, what is cmake_install.cmake?

2010-03-23 Thread Darren Weber
I've got a build going for some ITK code and I want to install the binaries
into /usr/local/bin/.

This is what I try, without success.

[ ~/src/kitware/itkImageSeries2Volume-build ]$ gmake
[  9%] Built target itkImageSeries2VTKvolume
[ 18%] Built target itkImageSeriesResize
[ 27%] Built target itkImageSeriesSize
[ 36%] Built target itkRGBCoregisterImageSeries2VTKvolume
[ 45%] Built target itkRGBImageSeries2VTKvolume
[ 54%] Built target itkRGBImageSeriesComposeAffineTransforms
[ 63%] Built target itkRGBImageSeriesComposeRigid2DTransforms
[ 72%] Built target itkRGBImageSeriesComposeScalableAffine
[ 81%] Built target itkRGBImageSeriesComposeTransforms
[ 90%] Built target itkRGBImageSeriesResize
[100%] Built target itkRGBImageSeriesSize
[ ~/src/kitware/itkImageSeries2Volume-build ]$ gmake install
gmake: *** No rule to make target `install'.  Stop.


Here's the content of the cmake_install.cmake file (I replace my home path
with ${HOME} only for this email):

[ ~/src/kitware/itkImageSeries2Volume-build ]$ cat cmake_install.cmake
# Install script for directory: ${HOME}/src/kitware/itkImageSeries2Volume

# Set the install prefix
IF(NOT DEFINED CMAKE_INSTALL_PREFIX)
  SET(CMAKE_INSTALL_PREFIX /usr/local)
ENDIF(NOT DEFINED CMAKE_INSTALL_PREFIX)
STRING(REGEX REPLACE /$  CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})

# Set the install configuration name.
IF(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
  IF(BUILD_TYPE)
STRING(REGEX REPLACE ^[^A-Za-z0-9_]+ 
   CMAKE_INSTALL_CONFIG_NAME ${BUILD_TYPE})
  ELSE(BUILD_TYPE)
SET(CMAKE_INSTALL_CONFIG_NAME )
  ENDIF(BUILD_TYPE)
  MESSAGE(STATUS Install configuration: \${CMAKE_INSTALL_CONFIG_NAME}\)
ENDIF(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)

# Set the component getting installed.
IF(NOT CMAKE_INSTALL_COMPONENT)
  IF(COMPONENT)
MESSAGE(STATUS Install component: \${COMPONENT}\)
SET(CMAKE_INSTALL_COMPONENT ${COMPONENT})
  ELSE(COMPONENT)
SET(CMAKE_INSTALL_COMPONENT)
  ENDIF(COMPONENT)
ENDIF(NOT CMAKE_INSTALL_COMPONENT)

IF(CMAKE_INSTALL_COMPONENT)
  SET(CMAKE_INSTALL_MANIFEST
install_manifest_${CMAKE_INSTALL_COMPONENT}.txt)
ELSE(CMAKE_INSTALL_COMPONENT)
  SET(CMAKE_INSTALL_MANIFEST install_manifest.txt)
ENDIF(CMAKE_INSTALL_COMPONENT)

FILE(WRITE
${HOME}/src/kitware/itkImageSeries2Volume-build/${CMAKE_INSTALL_MANIFEST}
)
FOREACH(file ${CMAKE_INSTALL_MANIFEST_FILES})
  FILE(APPEND 
${HOME}/src/kitware/itkImageSeries2Volume-build/${CMAKE_INSTALL_MANIFEST}
${file}\n)
ENDFOREACH(file)


TIA,
Darren
___
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] ICC under Linux

2010-03-23 Thread Oliver Smith
When you tell CMake under Linux to use ICC, there's no automatic 
detection of the custom archiver and linker that ICC requires. The 
following lines fix that, but would it be possible to add them to the 
stock CMake files someplace so that using ICC becomes slightly more 
transparent?


# Intel(R) Compiler has its own library archiver,
# if you build libraries and do not use xiar,
# the Intel compiler will complain about invalid
# archives at the link phase.

# The Intel(R) archiver is xiar usually
# located in the same folder as the compiler,
# /opt/intel/Compiler/nn/n.nn/ia32/bin/xiar
# for example.

FIND_PROGRAM(XIAR xiar)
IF(XIAR)
  SET(CMAKE_AR ${XIAR})
ENDIF(XIAR)
MARK_AS_ADVANCED(XIAR)

# Intel(R) Compiler also comes with its own linker
# which provides a number of additional benefits when
# linking code compiled with the Intel(R) compiler.
# Again, usually in the same place as icc itself,

# /opt/intel/COmpiler/nn/n.nn/ia32/bin/xild per e.g

FIND_PROGRAM(XILD xild)
IF(XILD)
  SET(CMAKE_LINKER ${XILD})
ENDIF(XILD)
MARK_AS_ADVANCED(XILD)


___
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