[CMake] Difficult 'make install' problem

2009-09-14 Thread Marcel Loose
Hi all,

I am facing a difficult 'make install' problem. I'll try to explain my
project setup. 

The main project consists of parts and subsystems. Parts contain source
code; subsystems do not contain source code, but define a certain subset
of all available parts.

Here is a simplified version of my source code tree.

main
  subsystems
subsys_1  (depends on part_1b, part_2a)
subsys_2  (depends on part_1a, part_1c, part_2b)
  part_1
part_1a
part_1b   (depends on part_1a)
part_1c   (depends on part_1a)
  part_2
part_2a   (depends on part_1c)
part_2b   (depends on part_1b)

Each leaf-directory contains a CMake project. The subsystems tree does
not contain any source code; it merely contains CMakeLists.txt files
that record the subsystem's dependencies. Only the part_* directories
contain source code files.

For each project, a custom target is defined with the same name as that
of the project. That way, you can easily define project dependencies
(which may reach a bit further than just library dependencies).

With this setup, it is straightforward to build, say, subsys_1. This
will trigger a build of the (sub)projects part_1a, part_1b, part_1c, and
part_2a. 

There's one caveat, though: you can only build a subsystem from the
top-level build directory! When typing 'make' in the subsystems/subsys_1
directory, nothing happens. This is different from the behaviour you see
when typing 'make' in, e.g., the directory part_1/part_1c. 

This isn't a big deal when simply building the target subsys_1. However,
it is a problem if you want to install subsys_1, where installing means,
installing all the products (i.e. libraries, binaries, etc.) that
subsys_1 consists of. 

What I would like is that, if I type 'make install' in the directory
subsystems/subsys_1, the result would be the same as if I had
subsequently typed 'make install' in the directories part_1/part_1a,
part_1/part_1b, part_1/part_1c, and part_2/part_2a.

Does anyone know how I could achieve this in CMake?

Best regards,
Marcel Loose.



___
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] Problems with CMake on 64-bit Vista

2009-09-14 Thread Tanguy Krotoff
Hi all

I have the exact same problem: a message complaining about a bad
side-by-side configuration.
I have this on a fresh VM with XP 64bits and Visual Studio 2008 SP1.

I do have the 32bits debug version of msvcr90d.dll and friends inside
C:\WINDOWS\WinSxS\x86_Microsoft.VC90.DebugCRT_1fc8b3b9a1e18e3b_9.0.21022.8_x-ww_597c3456

I don't have any 64bits debug version of msvcr90d.dll and friends
inside C:\WINDOWS\WinSxS
I don't have a directory called something like
C:\WINDOWS\WinSxS\amd64_Microsoft.VC90.DebugCRT

So I've added C:\Program Files (x86)\Microsoft Visual Studio
9.0\VC\redist\Debug_NonRedist\amd64\Microsoft.VC90.DebugCRT
to my PATH.
Using cmake --debug-trycompile, running cmTryCompileExec.exe gives me
side-by-side error.
If I copy-paste msvcr90d.dll and friends inside the directory where
cmTryCompileExec.exe is then it works.

What I don't understand is why try_run() compiles in debug mode.
And I can't manage to make try_run() compile in release mode (that
will solve all my problems), I don't know how to overwrite the flags
specified in the file
CMakeFiles\CMakeTmp\CMakeFiles\cmTryCompileExec.dir\flags.make


So the simple question is: how to make try_run() compile in release
mode instead of debug mode?


Thanks in advance


On Fri, Jul 24, 2009 at 4:59 PM, Barry Hathaway bhath...@nycap.rr.com wrote:
 I'm having a couple of problems using CMake on a 64-bit Vista system.
 The first is using the 32-bit binary download of CMake to build vxl.
 The vxl build tries a number of times to use TRY_RUN. The try (compile)
 part works, but the run part always fails with message complaining about a
 bad side-by-side configuration:

 Run Build Command:C:\PROGRA~2\MICROS~1.0\Common7\IDE\devenv.com
 CMAKE_TRY_COMPILE.sln /build Debug /project cmTryCompileExec
 Microsoft (R) Visual Studio Version 9.0.21022.8. Copyright (C) Microsoft
 Corp. All rights reserved.
 1-- Build started: Project: cmTryCompileExec, Configuration: Debug x64
 --
 1Compiling...
 1Microsoft (R) C/C++ Optimizing Compiler Version 15.00.21022.08 for x64
 1Copyright (C) Microsoft Corporation.  All rights reserved.
 1cl /Od /D WIN32 /D _WINDOWS /D VXL_HAS_TYPE_OF_SIZE /D _DEBUG /D
 CMAKE_INTDIR=\Debug\ /D _MBCS /FD /EHsc /RTC1 /MDd
 /FocmTryCompileExec.dir\Debug\\
 /FdC:/projects/reface/vxlbin-x64/CMakeFiles/CMakeTmp/Debug/cmTryCompileExec.pdb
 /W3 /c /Zi /TP   /Zm1000 -IC:/projects/reface/vxlbin-x64/CMakeTmp 1
 ..\..\..\fbi\Code\vxl\config\cmake\config\vxl_platform_tests.cxx
 1vxl_platform_tests.cxx
 1Compiling manifest to resources...
 1Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0 1Copyright
 (C) Microsoft Corporation.  All rights reserved.
 1Linking...
 1Embedding manifest...
 1Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0 1Copyright
 (C) Microsoft Corporation.  All rights reserved.
 1Build log was saved at
 file://c:\projects\reface\vxlbin-x64\CMakeFiles\CMakeTmp\cmTryCompileExec.dir\Debug\BuildLog.htm
 1cmTryCompileExec - 0 error(s), 0 warning(s) == Build: 1 succeeded,
 0 failed, 0 up-to-date, 0 skipped == The application has failed to
 start because its side-by-side configuration is incorrect. Please see the
 application event log for more detail

 Anyway, I figured it was an issue with a 32-bit CMake trying to run a 64-bit
 program (why it want to
 compile it with a DEBUG flag is another issue). So I tried to build a 64-bit
 version of CMake with
 Visual Studio 2008.  I was able to run CMake on CMake without any problems;
 however, the compile
 failed with many errors in the header files.  This occurred whether or not I
 checked the build testing option.

 Any ideas to either one of these problems.  Thanks.

 Barry Hathaway

-- 
Tanguy Krotoff tkrot...@gmail.com
+33 6 68 42 70 24
___
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] linking error after upgrading to snow leopard

2009-09-14 Thread Boudewijn Rempt
On Friday 11 September 2009, Michael Jackson wrote:
 You are not specifying the libraries that contain those symbols.
 Looking at your link line you are missing at least the Qt libraries/
 Frameworks and maybe some others.

Weird, though, since the same CMakeLists.txt worked fine with Leopard, 
and continue to work fine on Linux and Windows. And if I remove the bundle 
flag to add_executable, linking works.

 If the arch were incorrect the linker would explicitly tell you that
 the libraries you are trying to link against is the wrong arch.

Ah, good to know.

 Since
 I don't see that error I am assuming that you have forgotten to list
 the libraries that contain those symbols in a
 target_link_libraries() command.

my target_link_libraries looks like this:

target_link_libraries(HyvesDesktop HyvesDesktopLib ${QT_LIBRARIES})

HyvesDesktopLib provides the CrashHandler object, and I've checked whether 
${QT_LIBRARIES} was set correctly, and it points to the right Qt.

-- 
Boudewijn Rempt | http://www.valdyas.org

___
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] linking error with gsl

2009-09-14 Thread Philip Lowman
Have you tried using make VERBOSE=1 to get the full command line being
executed?

It looks like `/usr/local/bin/gsl-config might be being passed to the linker
via target_link_libraries()?
CMake doesn't evaluate backticks, you'll have to use a command like
execute_process().

There might be a problem in the FindGSL module you're using.  This might
take some debugging with the message() command to trace down.  There are
several find modules shipped with CMake 2.6.4 that use a foo-config style
program to parse include directories and libraries which may be helpful.
One is FindFLTK.cmake for example.

On Sun, Sep 13, 2009 at 4:05 PM, Benoist Laurent laurentbeno...@hotmail.com
 wrote:

  Hi,

 I'm a begginner with CMake.
 I've got a project with all sources written and I want to switch to a CMake
 building process.
 My project is quite small :
   - 5 sources in myProject/src directory
   - 5 headers in myProject/include directory

 The problem is that is need to link with the gsl libraries.
 I used the FindGSL.cmake file that I found here
 http://www.cmake.org/pipermail/cmake/2006-March/008628.html.

 But when I type make, this error occurs :
 Linking C executable myExe
 i686-apple-darwin9-gcc-4.0.1: `/usr/local/bin/gsl-config: No such file or
 directory
 make[2]: *** [myExe] Error 1
 make[1]: *** [CMakeFiles/myExe.dir/all] Error 2
 make: *** [all] Error 2

 It's quite strange because the program /usr/local/bin/gsl-config does exist
 and prints -L/usr/local/lib -lgsl -lgslcblas -lm.
 This is my CMakeLists.txt file :

 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
 PROJECT(PROJET)

 FIND_PACKAGE(GSL REQUIRED)

 SET(PROJET_SRCS
 ./src/FN_functions.c
 ./src/HH_functions.c
 ./src/HR_functions.c
 ./src/Iz_functions.c
 ./src/main.c
 ./src/misc.c
 ./src/ML_functions.c
 ./src/parsing.c
 ./src/stim.c
 )

 SET(INCLUDE_DIRS
 ${PROJET_SOURCE_DIR}/include
 ${GSL_INCLUDE_DIRS}
 )

 SET(LIBS ${LIBS} ${GSL_LIBRARIES})

 INCLUDE_DIRECTORIES(${INCLUDE_DIRS})
 ADD_DEFINITIONS(-Wall -ansi -pedantic -02)
 ADD_EXECUTABLE(myExe ${PROJET_SRCS})

 TARGET_LINK_LIBRARIES(myExe ${LIBS})

 --

 Do you see the problem ?


 --
 Achetez un nouveau PC et bénéficiez de Windows 7 dès sa sortie ! En savoir
 plus http://www.portable-windows.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




-- 
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] linking error after upgrading to snow leopard

2009-09-14 Thread Boudewijn Rempt
On Mon, 14 Sep 2009, Boudewijn Rempt wrote:

 my target_link_libraries looks like this:
 
 target_link_libraries(HyvesDesktop HyvesDesktopLib ${QT_LIBRARIES})
 
 HyvesDesktopLib provides the CrashHandler object, and I've checked whether 
 ${QT_LIBRARIES} was set correctly, and it points to the right Qt.
 

But indeed, if I add the bundle flag, there are no libraries on the
command line, if I don't, it looks like:

/usr/bin/c++-mmacosx-version-min=10.6 -Wall -arch i386 
-Wl,-search_paths_first -headerpad_max_install_names -fPIC 
CMakeFiles/HyvesDesktop.dir/src/main.cpp.o 
CMakeFiles/HyvesDesktop.dir/qrc_HyvesDesktop.cxx.o  -o HyvesDesktop  
-F/Users/boudewijn/qt46-carbon-no-dbus/lib 
-F/Users/boudewijn/hyves/hyves-desktop/trunk/3rdparty 
-L/Users/boudewijn/hyves/hyves-desktop/trunk/build/src 
-L/Users/boudewijn/qt46-carbon-no-dbus/lib 
-L/Users/boudewijn/hyves/hyves-desktop/trunk/build/3rdparty/qtsingleapplication-2.6-opensource
 -L/Users/boudewijn/hyves/hyves-desktop/trunk/build/3rdparty/genusapis 
-L/Users/boudewijn/hyves/hyves-desktop/trunk/build/3rdparty/google-breakpad-read-only
 -L/Users/boudewijn/hyves/hyves-desktop/trunk/build/3rdparty/idle 
-L/Users/boudewijn/hyves/hyves-desktop/trunk/build/3rdparty/qjson/lib 
-L/Users/boudewijn/hyves/hyves-desktop/trunk/build/3rdparty/quazip 
src/libHyvesDesktopLib.dylib -framework QtSvg 
/Users/boudewijn/qt46-carbon-no-dbus/lib/libQtUiTools.a -framework QtWebKit 
-framework QtGui -framework Carbon -framework AppKit -framework QtTest 
-framework QtXml -framework QtNetwork /usr/lib/libssl.dylib -framework QtCore 
/usr/lib/libz.dylib -framework ApplicationServices 
3rdparty/qtsingleapplication-2.6-opensource/libqtsingleapplication.a 
3rdparty/genusapis/libgenusapis.a 
3rdparty/google-breakpad-read-only/libbreakpad.a -lcrypto -framework COCOA 
3rdparty/idle/libidle.a /Users/boudewijn/qt46-carbon-no-dbus/lib/libqca.dylib 
3rdparty/qjson/lib/libqjson.a 3rdparty/quazip/libquazip.a -framework QtSvg 
/Users/boudewijn/qt46-carbon-no-dbus/lib/libQtUiTools.a -framework QtWebKit 
-framework QtGui -framework Carbon -framework AppKit -framework QtTest 
-framework QtXml -framework QtNetwork /usr/lib/libssl.dylib -framework QtCore 
/usr/lib/libz.dylib -framework ApplicationServices -framework Carbon -framework 
IOKit -framework Growl

But I don't get a bundle, of course.___
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] linking error after upgrading to snow leopard

2009-09-14 Thread Boudewijn Rempt
Hm, I downgraded from the CVS version to 2.6.4 and the problem doesn't
seem to occur, so I suspect a bug in CMake, after all.

Boudewijn

___
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] Problems with CMake on 64-bit Vista

2009-09-14 Thread Bill Hoffman

Tanguy Krotoff wrote:

Hi all

I have the exact same problem: a message complaining about a bad
side-by-side configuration.
I have this on a fresh VM with XP 64bits and Visual Studio 2008 SP1.

I do have the 32bits debug version of msvcr90d.dll and friends inside
C:\WINDOWS\WinSxS\x86_Microsoft.VC90.DebugCRT_1fc8b3b9a1e18e3b_9.0.21022.8_x-ww_597c3456

I don't have any 64bits debug version of msvcr90d.dll and friends
inside C:\WINDOWS\WinSxS
I don't have a directory called something like
C:\WINDOWS\WinSxS\amd64_Microsoft.VC90.DebugCRT



Are you saying that you can not build debug 64 bit programs?  That 
sounds like a bad compiler install.


-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] Problems with CMake on 64-bit Vista

2009-09-14 Thread Tanguy Krotoff
I see that my statement from my first message is wrong:
when I got the side-by-side error message, I was using Visual Studio
2008 WITHOUT SP1
Visual Studio 2008 SP1 solves the problem by installing the right CRT
debug files.

For sure other people using VS2008 and try_run() in 64bits will get
this problem.

Still why try_run() works in debug mode instead of release mode?


On Mon, Sep 14, 2009 at 3:38 PM, Tanguy Krotoff tkrot...@gmail.com wrote:
 On Mon, Sep 14, 2009 at 3:24 PM, Bill Hoffman bill.hoff...@kitware.com 
 wrote:
 Tanguy Krotoff wrote:

 Hi all

 I have the exact same problem: a message complaining about a bad
 side-by-side configuration.
 I have this on a fresh VM with XP 64bits and Visual Studio 2008 SP1.

 I do have the 32bits debug version of msvcr90d.dll and friends inside

 C:\WINDOWS\WinSxS\x86_Microsoft.VC90.DebugCRT_1fc8b3b9a1e18e3b_9.0.21022.8_x-ww_597c3456

 I don't have any 64bits debug version of msvcr90d.dll and friends
 inside C:\WINDOWS\WinSxS
 I don't have a directory called something like
 C:\WINDOWS\WinSxS\amd64_Microsoft.VC90.DebugCRT


 Are you saying that you can not build debug 64 bit programs?  That sounds
 like a bad compiler install.

 No problem with that.
 It's not because you don't have 64bits debug version of msvcr90d.dll
 and friends inside C:\WINDOWS\WinSxS that you cannot compile a 64bits
 program :)

 When installing VS2008 SP1, directory
 C:\WINDOWS\WinSxS\amd64_Microsoft.VC90.DebugCRT is created with the
 right files inside.
 With VS2008 SP1, try_run() works fine, without SP1 it does not work
 with the side-by-side error

 --
 Tanguy Krotoff tkrot...@gmail.com
 +33 6 68 42 70 24




-- 
Tanguy Krotoff tkrot...@gmail.com
+33 6 68 42 70 24
___
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] Problems with CMake on 64-bit Vista

2009-09-14 Thread Bill Hoffman

Tanguy Krotoff wrote:

I see that my statement from my first message is wrong:
when I got the side-by-side error message, I was using Visual Studio
2008 WITHOUT SP1
Visual Studio 2008 SP1 solves the problem by installing the right CRT
debug files.

For sure other people using VS2008 and try_run() in 64bits will get
this problem.


OK, so SP1 must fix some issue.

Still why try_run() works in debug mode instead of release mode?



Why not debug?  It is the default build.

-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] add_subdirectory and build directory

2009-09-14 Thread Pierre-Julien Villoud
Sorry I did not reply to you...

I actually use the target_link_libraries and the add_dependencies which is 
useless if using the target_link_libraries (I think ?)

So I really wonder why my objects are re-built... It's still a mystery for me !

Thanks again

Pierre-Julien VILLOUD

-Message d'origine-
De : Marcel Loose [mailto:lo...@astron.nl] 
Envoyé : vendredi 11 septembre 2009 18:09
À : Pierre-Julien Villoud
Cc : cmake@cmake.org
Objet : Re: [CMake] add_subdirectory and build directory

Hi Pierre-Julien,

I think I see what the problem is. You didn't specify any dependencies.
You mention that project A depends on B. But don't you actually mean
that libA depends on libB? If that's the case you should add a
target_link_libraries(libA libB) to the CMakeLists.txt file of project
A.

Anyway, you may want to post your CMakeLists.txt files, so that people
can spot what you might be doing wrong. At the moment, I can only make
some wild guesses.

Best regards,
Marcel Loose.

On Fri, 2009-09-11 at 17:34 +0200, Pierre-Julien Villoud wrote:
 Hi and thanks for your answer...
 
 Here is the ouput : 
 
 I'm building A : My CMakelists.txt is in C:/A
 
 -- Configuring done
 -- Generating done
 -- Build files have been written to: C:/A/Debug
 ==Building A==
 [  0%] Built target CMake
 Scanning dependencies of target B
 [  4%] Building CXX object C:/B/CMakeFiles/B.dir/B.cpp.obj
 Linking CXX static library C:\lib\libB.a
 [  4%] Built target B
 Linking CXX shared module C:\bin\A.dll
 [100%] Built target A
 
 Then I'm building B : My CMakeLists.txt is in C:/B
 
 -- Configuring done
 -- Generating done
 -- Build files have been written to: C:/B/Debug
 ==Building B==
 [  0%] Built target CMake
 Scanning dependencies of target B
 [100%] Building CXX object CMakeFiles/B.dir/B.cpp.obj
 Linking CXX static library C:\lib\libB.a
 [100%] Built target B
 
 
 Any clues ?
 
 @Michael : I did not look at your long and precise answer (thank you very 
 much for it BTW) but it seems quite complicated !! How are you managing your 
 dependencies ?
 
 Thank you for your help !
 
 
 
 -Message d'origine-
 De : Marcel Loose [mailto:lo...@astron.nl] 
 Envoyé : vendredi 11 septembre 2009 16:30
 À : Pierre-Julien Villoud
 Cc : cmake@cmake.org
 Objet : Re: [CMake] add_subdirectory and build directory
 
 Hi Pierre-Julien,
 
 Are you sure it's rebuilding? CMake (or 'make' actually), prints a lot
 of messages Built target ... even if no compilation was needed.
 However, if you also see messages like Building ... then it is
 actually rebuilding.
 
 Without an example of the output of your build, it is hard to judge
 what, if anything, is going wrong.
 
 Best regards,
 Marcel Loose.
 
 On Fri, 2009-09-11 at 15:12 +0200, Pierre-Julien Villoud wrote:
  Hi everyone, 
  
   
  
  After unsuccessfully looking for an answer on Google, I contact you.
  
  I have a question regarding the use of add_subdirectory. When a
  project A is depending on a project B, I add the following in A's
  CMakeLists.txt : 
  
   
  
  Add_subdirectory(B Path/To/B/Build/Directory)
  
   
  
  It does build B before A. But when I build B in its build directory
  and I build A after, it builds B again whereas it should not since B
  is up to date.
  
   
  
  Anyone sees what's wrong ?
  
   
  
  Thanks in advance
  
   
  
  Pierre-Julien VILLOUD
  
  
  ___
  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

___
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] Eclipse CDT4 generator - No source files

2009-09-14 Thread Dixon, Shane
Eric,

I read through the link you sent me and tried again and now I can see the 
source files, but they show up as a subdirectory in eclipse.  For example, I 
have a folder called ProjectName/src.  In eclipse, I see src, but it has only 
CMakeLists.txt but there's a folder called ProjectName/src that has the actual 
files in it.  It's a little strange having two directories called src, but it 
seems to be working as expected.  Thanks for the link.

--
Shane

-Original Message-
From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf Of 
Eric Noulard
Sent: Saturday, September 12, 2009 3:08 AM
To: CMake ML
Subject: Re: [CMake] Eclipse CDT4 generator - No source files

2009/9/11 Dixon, Shane shane.di...@atmel.com:
 I'm generating an eclipse project and whenever I import the project, all the
 files are there except for the source and header files.  I had a similar
 problem when generating Visual Studio 9 2008 projects ( I was missing the
 header files).  I fixed that by adding all the .h files to my project_SRCS
 variable so that they all now show up in VS9, but how do I get this to show
 up in Eclipse?  My build platform is Windows XP SP3.

Should work see:http://www.vtk.org/Wiki/Eclipse_CDT4_Generator

1) If you are building in-source then nothing special happen
2) If you are building out-of-source then you'll have a linked ressource
in your CDT project

Which version of CMake are you using?
Which version of Eclipse+CDT are you using?


-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
___
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] Other non-source files in VC9

2009-09-14 Thread Dixon, Shane
I'm using the MSVC9 generator in Windows XP (CMake 2.6.4).  I have several 
files like Readme.txt, News.txt, and Install.txt that I'd like to show up 
when I generate a MSVC9 project.  How do I get those files to show up in MSVC9?

 

--

Shane 

___
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] Other non-source files in VC9

2009-09-14 Thread Tyler Roscoe
On Mon, Sep 14, 2009 at 01:59:48PM -0600, Dixon, Shane wrote:
 I'm using the MSVC9 generator in Windows XP (CMake 2.6.4).  I have
 several files like Readme.txt, News.txt, and Install.txt that
 I'd like to show up when I generate a MSVC9 project.  How do I get
 those files to show up in MSVC9?

Just add them as source files in your add_exectuable() or add_library()
command.

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] Release and Debug build for same source folder?

2009-09-14 Thread motes motes
I would like to create a Release and Debug Build for my source files.
Currently I have been able to make both build types separately but it
would be nice to not have duplicated source files.

My source files depends on ITK and Elastix. I have therefore made both
a Debug and Release build for ITK and Elastix.

Now in my source folder I need to create two CMakelist.txt files. One
that uses the ITK and Elastix Release build and another that uses the
Debug builds. But how do I make CMake use the right CMakeList.txt
file?

Or am I doing it wrong?
___
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] Other non-source files in VC9

2009-09-14 Thread Dixon, Shane
Tyler,

Ok, that worked, but my project has multiple binaries so I'd prefer the 
documentation to show up at the top level.  Is there any way to make them show 
up under the ALL_BUILD target in MSVC9?

--
Shane

-Original Message-
From: Tyler Roscoe [mailto:ty...@cryptio.net] 
Sent: Monday, September 14, 2009 2:04 PM
To: Dixon, Shane
Cc: cmake@cmake.org
Subject: Re: [CMake] Other non-source files in VC9

On Mon, Sep 14, 2009 at 01:59:48PM -0600, Dixon, Shane wrote:
 I'm using the MSVC9 generator in Windows XP (CMake 2.6.4).  I have
 several files like Readme.txt, News.txt, and Install.txt that
 I'd like to show up when I generate a MSVC9 project.  How do I get
 those files to show up in MSVC9?

Just add them as source files in your add_exectuable() or add_library()
command.

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] check_include_files() can't find header because it can't compile test app

2009-09-14 Thread Alexander Neundorf
On Sunday 13 September 2009, Casey Jones wrote:
 Hello, I'm trying to link a Qt4 library into my program as an optional
 dependency.  I can get it to find and link the library with a
 FindFoo.cmake. But when I use check_include_files( foo.h HAVE_FOO_H ) it
 says it can't find the header.  So looking in CMakeError.log it says it
 found foo.h but since it includes Qt headers like:
 #include QString
 instead of
 #include qt4/QtCore/QString
 it can't compile the test program.

 Is there a way to have check_include_files() not compile the test program
 and just make sure the header exists?  

You could just use find_path(FOO_INCLUDE_DIR foo.h ...), usually this is good. 
enough.
Or you can set the cmake variable CMAKE_REQUIRED_INCLUDES before calling the 
check_include_files() macro so that it lists all necessary include dirs 
(should be ${QT_QTCORE_INCLUDE_DIR} or something like this)

 Or is there some other way to create the config.h.in and config.h?

You don't *have* to compile anything in order to create a config.h from a 
config.h.in.
configure_file() reads the config.h.in and replaces all cmake variables with 
their values in that file and writes the output file. 
It doesn't matter where these values come from, whether a 
check_include_files() or if you just set them.

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


Re: [CMake] linking error with gsl

2009-09-14 Thread Benoist Laurent

You were actually right the problem was the FindGSL.cmake file.
Like I said earlier, I took it from the net.
The line SET(GSL_LIBRARIES `${GSL_CONFIG} --libs`) did not returned the 
expected result.
I replaced it by
EXEC_PROGRAM(${GSL_CONFIG}
  ARGS --libs
  OUTPUT_VARIABLE GSL_LIBRARIES)

It works well.

Thank you very much.
Best regards,
Ben


Date: Mon, 14 Sep 2009 07:26:03 -0400
Subject: Re: [CMake] linking error with gsl
From: phi...@yhbt.com
To: laurentbeno...@hotmail.com
CC: cmake@cmake.org

Have you tried using make VERBOSE=1 to get the full command line being 
executed?

It looks like `/usr/local/bin/gsl-config might be being passed to the linker 
via target_link_libraries()?
CMake doesn't evaluate backticks, you'll have to use a command like 
execute_process().


There might be a problem in the FindGSL module you're using.  This might take 
some debugging with the message() command to trace down.  There are several 
find modules shipped with CMake 2.6.4 that use a foo-config style program to 
parse include directories and libraries which may be helpful.  One is 
FindFLTK.cmake for example.


On Sun, Sep 13, 2009 at 4:05 PM, Benoist Laurent laurentbeno...@hotmail.com 
wrote:






Hi,

I'm a begginner with CMake.
I've got a project with all sources written and I want to switch to a CMake 
building process.
My project is quite small :
  - 5 sources in myProject/src directory

  - 5 headers in myProject/include directory

The problem is that is need to link with the gsl libraries.
I used the FindGSL.cmake file that I found here 
http://www.cmake.org/pipermail/cmake/2006-March/008628.html.


But when I type make, this error occurs :
Linking C executable myExe
i686-apple-darwin9-gcc-4.0.1: `/usr/local/bin/gsl-config: No such file or 
directory
make[2]: *** [myExe] Error 1
make[1]: *** [CMakeFiles/myExe.dir/all] Error 2

make: *** [all] Error 2

It's quite strange because the program /usr/local/bin/gsl-config does exist and 
prints -L/usr/local/lib -lgsl -lgslcblas -lm.
This is my CMakeLists.txt file :

CMAKE_MINIMUM_REQUIRED(VERSION 2.6)

PROJECT(PROJET)

FIND_PACKAGE(GSL REQUIRED)

SET(PROJET_SRCS 
./src/FN_functions.c
./src/HH_functions.c
./src/HR_functions.c
./src/Iz_functions.c
./src/main.c
./src/misc.c

./src/ML_functions.c
./src/parsing.c
./src/stim.c
)

SET(INCLUDE_DIRS
${PROJET_SOURCE_DIR}/include
${GSL_INCLUDE_DIRS}
)

SET(LIBS ${LIBS} ${GSL_LIBRARIES})

INCLUDE_DIRECTORIES(${INCLUDE_DIRS})

ADD_DEFINITIONS(-Wall -ansi -pedantic -02)
ADD_EXECUTABLE(myExe ${PROJET_SRCS})

TARGET_LINK_LIBRARIES(myExe ${LIBS})

--

Do you see the problem ?


Achetez un nouveau PC et bénéficiez de Windows 7 dès sa sortie ! En savoir plus


___

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


-- 
Philip Lowman

_
Messenger débarque dans Hotmail ! Essayez-le !
http://www.windowslive.fr/hotmail/web-messenger/___
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] Release and Debug build for same source folder?

2009-09-14 Thread Eric Noulard
2009/9/14 motes motes mort.mo...@gmail.com:
 I would like to create a Release and Debug Build for my source files.
 Currently I have been able to make both build types separately but it
 would be nice to not have duplicated source files.

 My source files depends on ITK and Elastix. I have therefore made both
 a Debug and Release build for ITK and Elastix.

 Now in my source folder I need to create two CMakelist.txt files. One
 that uses the ITK and Elastix Release build and another that uses the
 Debug builds. But how do I make CMake use the right CMakeList.txt
 file?

You should use

1) the debug/optimized etc... flags from
target_link_libraries

2) may be some IF(CMAKE_BUILD_TYPE STREQUAL Debug) etc...

If you post here an example of what is different in your currently
separated CMakeLists.txt files we could help you with more
expressive example.

You may browse the ML archive for thread talking about build type
like may be this one:
http://www.cmake.org/pipermail/cmake/2007-April/013479.html

-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
___
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] Release and Debug build for same source folder?

2009-09-14 Thread motes motes
This is the CmakeList.txt for the Debug build:




cmake_minimum_required(VERSION 2.6)

PROJECT(MYPROJ)

SET(EXTERNALS_DIR D:/code/local/lib)
SET(PROJECT_LIB D:/code/MYPROJ/src/lib)

# Find ITK.
SET(ITK_DIR ${EXTERNALS_DIR}/InsightToolkit-3.12.0/build)

# Elastix source
SET(ELASTIX_SRC ${EXTERNALS_DIR}/elastix_sources_v4.1/src)
# Elastix build
SET(ELASTIX_BUILD ${EXTERNALS_DIR}/elastix_sources_v4.1/src/build)


FIND_PACKAGE(ITK REQUIRED)
IF(ITK_FOUND)
  INCLUDE(${ITK_USE_FILE})
ENDIF(ITK_FOUND)

INCLUDE_DIRECTORIES(${ELASTIX_SRC})
INCLUDE_DIRECTORIES(${ELASTIX_SRC}/Common)
INCLUDE_DIRECTORIES(${ELASTIX_SRC}/Common/ImageSamplers)
INCLUDE_DIRECTORIES(${ELASTIX_SRC}/Common/xout)
INCLUDE_DIRECTORIES(${ELASTIX_SRC}/Common/ParameterFileParser)
INCLUDE_DIRECTORIES(${ELASTIX_SRC}/Common/CostFunctions)
INCLUDE_DIRECTORIES(${ELASTIX_SRC}/Common/Transforms)

INCLUDE_DIRECTORIES(${ELASTIX_SRC}/Core)
INCLUDE_DIRECTORIES(${ELASTIX_SRC}/Core/Install)
INCLUDE_DIRECTORIES(${ELASTIX_SRC}/Core/Kernel)
INCLUDE_DIRECTORIES(${ELASTIX_SRC}/Core/Configuration)
INCLUDE_DIRECTORIES(${ELASTIX_SRC}/Core/ComponentBaseClasses)

INCLUDE_DIRECTORIES(${ELASTIX_SRC}/Components/ImageSamplers/Random)
INCLUDE_DIRECTORIES(${ELASTIX_SRC}/Components/Metrics/AdvancedMeanSquares)
INCLUDE_DIRECTORIES(${ELASTIX_SRC}/Components/Optimizers/StandardGradientDescent)

INCLUDE_DIRECTORIES(${PROJECT_LIB})
INCLUDE_DIRECTORIES(${PROJECT_LIB}/CImg-1.21)
INCLUDE_DIRECTORIES(${PROJECT_LIB}/zlib-1.2.3-lib/include)
INCLUDE_DIRECTORIES(${PROJECT_LIB}/revised)

LINK_DIRECTORIES(${ELASTIX_BUILD})
LINK_DIRECTORIES(${ELASTIX_BUILD}/Components/Optimizers/StandardGradientDescent)
LINK_DIRECTORIES(${ELASTIX_BUILD}/Common)
LINK_DIRECTORIES(${ELASTIX_BUILD}/Core)

ADD_EXECUTABLE(MYPROJ main.cpp )

TARGET_LINK_LIBRARIES(ADAPTIVE ITKCommon ITKAlgorithms ITKBasicFilters
ITKNumerics ITKIO ITKBasicFilters StandardGradientDescent elxCommon
elxCore)

SET(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} -w -lX11 -Dcimg_use_xshm
-lXext -Dcimg_use_xrandr -lXrandr -O3 -fpermissive -march=nocona -m64
-ffast-math -funroll-loops -finline-functions)





The CMakeList.txt for the Release build is the same except from these lines:

SET(ITK_DIR ${EXTERNALS_DIR}/InsightToolkit-3.12.0/buildRelease)

# Elastix build
SET(ELASTIX_BUILD ${EXTERNALS_DIR}/elastix_sources_v4.1/src/buildRelease)


So its basically just two lines thats different between the two
CMakeList.txt files, but I still need to build my project with CMake
(and replace the correct CMakeList.txt file) each time I will change
from Debug to Release or the other way around.







On Mon, Sep 14, 2009 at 10:37 PM, Eric Noulard eric.noul...@gmail.com wrote:
 2009/9/14 motes motes mort.mo...@gmail.com:
 I would like to create a Release and Debug Build for my source files.
 Currently I have been able to make both build types separately but it
 would be nice to not have duplicated source files.

 My source files depends on ITK and Elastix. I have therefore made both
 a Debug and Release build for ITK and Elastix.

 Now in my source folder I need to create two CMakelist.txt files. One
 that uses the ITK and Elastix Release build and another that uses the
 Debug builds. But how do I make CMake use the right CMakeList.txt
 file?

 You should use

 1) the debug/optimized etc... flags from
    target_link_libraries

 2) may be some IF(CMAKE_BUILD_TYPE STREQUAL Debug) etc...

 If you post here an example of what is different in your currently
 separated CMakeLists.txt files we could help you with more
 expressive example.

 You may browse the ML archive for thread talking about build type
 like may be this one:
 http://www.cmake.org/pipermail/cmake/2007-April/013479.html

 --
 Erk
 Membre de l'April - « promouvoir et défendre le logiciel libre » -
 http://www.april.org
 ___
 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] Other non-source files in VC9

2009-09-14 Thread Philip Lowman
On Mon, Sep 14, 2009 at 4:21 PM, Dixon, Shane shane.di...@atmel.com wrote:

 Tyler,

 Ok, that worked, but my project has multiple binaries so I'd prefer the
 documentation to show up at the top level.  Is there any way to make them
 show up under the ALL_BUILD target in MSVC9?


My guess is that would probably require a patch.

You could create a dummy executable target called _README, _INFO or
something like that and hope the user expands the project in the project
browser to see the text files underneath?

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