Re: [CMake] Copying some files using CMake

2010-12-23 Thread John Drescher
On Thu, Dec 23, 2010 at 11:18 AM, Stormwind Dev
stormwind@googlemail.com wrote:
 Dear List,

 I've got a question on copying some files from one directory to another
 using CMake.

 Let's say, I got some libraries collected in a special directory. I want
 CMake to copy these libs to the distribution directory of my project. Using
 add_custom_command, I managed to have CMake copy my .exe to the distribution
 directory, but when I try to do this for my libraries something goes
 terribly wrong.

 add_custom_command( TARGET MagicRPG POST_BUILD
        COMMAND copy \$(TargetPath)\ .\\dist\\bin )

 is what I did to copy my exe. When I use this

 add_custom_command( TARGET MagicRPG POST_BUILD
        COMMAND copy \$(TargetPath)\ \${SDKS_BASE_DIR}/SDL/lib/SDL.dll\
 .\\dist\\bin)

 to get SDL.dll copied to dist/bin Visual Studio fails with message

 Fehler    1    error MSB3073: Der Befehl copy
 D:\Projekte\cpp\games\Magic\bin\Debug\MagicRPG.exe
 D:/SDKs/SDL/lib/SDL.dll .\dist\bin
 if errorlevel 1 goto VCReportError
 :VCEnd wurde mit dem Code 1 beendet.    C:\Program Files
 (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets    113    6
  MagicRPG

 Can anybody please help me with the right syntax for copying multiple files
 at POST_BUILD?


Attached are 3 CMake modules I use for this. One is a macro that
builds a batch file that ends up being a target in visual studio.

I put them in a CMake folder inside my root source folder and have the
following line in my main CMakeLists.txt

include(${PROJECT_SOURCE_DIR}/CMake/GetRuntime.cmake)

this brings in the macro with support for generating the batch file
and GetRuntime target.

Then later in the main CMakeLists.txt file I use the other two modules.

FIND_PACKAGE( Qt4 REQUIRED )
set(QT_USE_QTNETWORK true)
set(QT_USE_QTSQL true)
set(QT_USE_QTXML true)
INCLUDE( ${QT_USE_FILE} )
include(${PROJECT_SOURCE_DIR}/CMake/GetQtRuntime.cmake)

IF(USE_QWT)
FIND_PACKAGE(Qwt REQUIRED)
INCLUDE_DIRECTORIES(${QWT_INCLUDE_DIR})
include(${PROJECT_SOURCE_DIR}/CMake/GetQwtRuntime.cmake)
set (UPMC_EXTERNAL_LIBS ${UPMC_EXTERNAL_LIBS} ${QWT_LIBRARIES})
ENDIF(USE_QWT)

John


GetRuntime.cmake
Description: Binary data


GetQtRuntime.cmake
Description: Binary data


GetQwtRuntime.cmake
Description: Binary data
___
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] Copying some files using CMake

2010-12-23 Thread John Drescher
-- Forwarded message --
From: John Drescher dresche...@gmail.com
Date: Thu, Dec 23, 2010 at 12:03 PM
Subject: Re: [CMake] Copying some files using CMake
To: Stormwind Dev stormwind@googlemail.com


On Thu, Dec 23, 2010 at 11:53 AM, Stormwind Dev
stormwind@googlemail.com wrote:
 Thanks for your reply John. There is one question left about your GetRuntime
 module. The files you copy are located within the CMake directory in your
 root source dir, right?


No only the CMake modules are in that folder. The files I copy are
from the binary folders where I have Qt and qwt built. The other two
modules get the paths using variables defined in the finders for each
package. And the final batch file ends up being created in the
project's binary folder. If you have Qt installed on your system I can
send you a small full project example that I used to develop these
cmake modules.

John
___
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] Did anyone manage to get incremental linking working with NMake generator?

2010-12-09 Thread John Drescher
 Haven't been following this thread closely, but changing the handling of
 /INCREMENTAL is a pain, at least in VS 2005 and 2008. Here is some code
 we use to *disable* /INCREMENTAL. With a little creativity, you could
 probably use this to forcibly *enable* /INCREMENTAL :):


Thanks. I look into this for disabling incremental linking since it
never works well for me and is more trouble than its worth..

John
___
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] Did anyone manage to get incremental linking working with NMake generator?

2010-12-09 Thread John Drescher
On Thu, Dec 9, 2010 at 2:47 PM, Bill Hoffman bill.hoff...@kitware.com wrote:
 On 12/9/2010 12:32 PM, John Drescher wrote:

 Haven't been following this thread closely, but changing the handling of
 /INCREMENTAL is a pain, at least in VS 2005 and 2008. Here is some code
 we use to *disable* /INCREMENTAL. With a little creativity, you could
 probably use this to forcibly *enable* /INCREMENTAL :):


 Thanks. I look into this for disabling incremental linking since it
 never works well for me and is more trouble than its worth..


 I find it to work very well.   What trouble are you having with it?  I have
 never had a problem with it, and it does save time.

Bill,
Sorry, I take that back, I just checked and I no longer have it
disabled in either of my large projects. I remember having problems in
the past (not sure what the were) before I used CMake (before June
2008) and that I always automatically disabled it in all visual studio
builds.

John
___
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 bug tracker discussion

2010-12-09 Thread John Drescher
 I'll start the ball rolling by saying that, personally, I like the bug
 tracker. I find it much easier to keep a list of issues organized and
 accessible than I can with email filters and folders. But I still see
 a need for both tools.

 What do you say?


I like the current system. Especially when you asked a few months ago
for what bugs we really wanted to see addressed for the next release.

John
___
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] Did anyone manage to get incremental linking working with NMake generator?

2010-12-08 Thread John Drescher
 Providing /INCREMENTAL:YES VS2010 linker complains that this is
 deprecated and still does a FULL link.

This is normal behavior in Visual Studio for the first build since
there was no previous full. Did you try modifying a file after it
built and building again without cleaning?

John
___
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] Creating CMakeLists files from Solutions, Projects and Makefiles

2010-12-07 Thread John Drescher
On Tue, Dec 7, 2010 at 2:14 PM, Paul Dean aquawic...@hotmail.com wrote:
 I've been using CMAKE for a few years now and I absolutley LOVE it.
 It makes my life as a programmer so much easier to be able to generate
 project files on any platform.

 What hurts is doing the reverse.  I can't count how many hours I've spent
 converting Solutions, Projects and Makefiles into CmakeLists files.

 I think if CMAKE could generate CMakeLists files from Solutions, Projects
 and Makefiles, it would be the ULTIMATE make system.
 Just think. Any time you run into some sorcecode that does not have a
 CMakeFile, you could generate it from the Makefile or Project.

 I can't imagine any programmer that would not love that ability.  I think it
 would be something great to add to CMAKE.
 What are everyones thoughts on that?


I would love to see a working QMake to CMake converter. And I mean one
that works for complicated QMake projects not just a simple executable
with a few headers and a few source files.

John
___
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] Creating CMakeLists files from Solutions, Projects and Makefiles

2010-12-07 Thread John Drescher
 And without the
 goal of switching from qmake to cmake, I don't see any point in doing a
 conversion in the first place - after all qmake can build the project on
 all interesting platforms already (else it would've been replaced).

The reason I want this is there are a few QMake based libraries I
would like to use with my projects but in their current form (without
proper cmake support / finders ...) it becomes difficult to integrate
them into projects that use CMake.

John
___
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] Trouble with non standard Qt installation.

2010-11-29 Thread John Drescher
On Mon, Nov 29, 2010 at 1:35 PM, tibur tiburti...@gmail.com wrote:
 Hello.

 Our team uses the same Windows (VS) Qt build, but all the developers don't
 store it at the same place on their hard drive. So qmake.exe doesn't contain
 the good include, library, ... directories.

 On the FindQt4.cmake script of version 2.8.2 (line 770), the find_library
 call was using QT_LIBRARY_DIR variable to find the possible location of
 QtCore.lib, ...

 But on version 2.8.3, this module now queries qmake.exe to retrieve the
 library and includes path. This stuck us to the 2.8.2 version of CMake,
 since qmake doesn't return the good directories.

 How can we fix that?


I am confused on what you are trying to fix. I mean on windows CMake
rarely finds anything (since there is no standard path for libraries
or development) unless it was one of the recent applications you built
with CMake. However when it does not find a library, package ... just
setting a variable to appropriate directory in CMakeGUI fixes the
problem.

John
___
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] Trouble with non standard Qt installation.

2010-11-29 Thread John Drescher
On Mon, Nov 29, 2010 at 1:42 PM, John Drescher dresche...@gmail.com wrote:
 On Mon, Nov 29, 2010 at 1:35 PM, tibur tiburti...@gmail.com wrote:
 Hello.

 Our team uses the same Windows (VS) Qt build, but all the developers don't
 store it at the same place on their hard drive. So qmake.exe doesn't contain
 the good include, library, ... directories.

 On the FindQt4.cmake script of version 2.8.2 (line 770), the find_library
 call was using QT_LIBRARY_DIR variable to find the possible location of
 QtCore.lib, ...

 But on version 2.8.3, this module now queries qmake.exe to retrieve the
 library and includes path. This stuck us to the 2.8.2 version of CMake,
 since qmake doesn't return the good directories.

 How can we fix that?


 I am confused on what you are trying to fix.

Oh. I see now. I think you need to have each developer build Qt on
their system.


-- 
John M. Drescher
___
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] Setting up CMake for Windows projects

2010-11-08 Thread John Drescher
On Mon, Nov 8, 2010 at 4:09 PM, Stormwind Developer
stormwind@googlemail.com wrote:
 Greetings,

 I am a complete beginner to CMake, so my problem might be trivial.
 Nevertheless I did not find a solution yet.

 I am running Windows XP in a virtual machine on a linux host system. Having
 CMake 2.6.4 installed I tried to run CMakeLists.txt from a project I
 downloaded.

 My problem is, that CMake fails with message logs like this one:
 Check for working C compiler: E:/Programme/Microsoft Visual Studio
 10.0/VC/bin/cl.exe
 Check for working C compiler: E:/Programme/Microsoft Visual Studio
 10.0/VC/bin/cl.exe -- broken
 CMake Error at E:/Programme/CMake
 2.6/share/cmake-2.6/Modules/CMakeTestCCompiler.cmake:32 (MESSAGE):
   The C compiler E:/Programme/Microsoft Visual Studio 10.0/VC/bin/cl.exe
 is
   not able to compile a simple test program.

   It fails with the following output:

    Change Dir: F:/bin/mygui/CMakeFiles/CMakeTmp



   Run Build Command:E:\PROGRA~1\CMAKE2~1.6\bin\cmake.exe
   CMAKE_TRY_COMPILE.sln /build Debug /project cmTryCompileExec





   CMake will not be able to correctly generate this project.
 Call Stack (most recent call first):
   CMakeLists.txt:12 (project)


 Configuring incomplete, errors occurred!

 I use Visual Studio 2010 for my project, so I specified the path to cl.exe
 as shown in the log. As value for CMAKE_MAKE_PROGRAM I used the path to
 cmake.exe

 Can anybody explain to me how to understand the log? Of course I checked all
 paths and F:/bin/mygui/CMakeFiles/CMakeTmp does exist. I don't know how to
 continue.

 Regards

 Michael


You need to use CMake 2.8.X with Visual Studio 2010.

John
___
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] header files with visual studio

2010-11-05 Thread John Drescher
 So, the question is actually:

 Is there a way to have CMake automatically add included headers to visual
 studio project files or do you need to use a dependency system to generate
 the lists by hand?


Take a look at this:
http://stackoverflow.com/questions/1167154/listing-header-files-in-visual-studio-c-project-generated-by-cmake

John
___
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] header files with visual studio

2010-11-04 Thread John Drescher
On Thu, Nov 4, 2010 at 11:58 AM, Oliver kfsone Smith osm...@playnet.com wrote:
 Checked the faq and googled as much as I could but I couldn't find anything
 describing how to make visual studio include header files in the
 solution/project files?


Add them to the target just like you do C++ files.

John
___
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.3-rc4 ready for testing!

2010-10-30 Thread John Drescher
On Fri, Oct 29, 2010 at 8:57 PM, John Drescher dresche...@gmail.com wrote:
 On Fri, Oct 29, 2010 at 8:17 PM, Karl Wallner cm...@karlwallner.de wrote:
 Am 30.10.2010 00:45, schrieb John Drescher:
 I know its probably too late for 2.8.3 but can someone please look at
 the following bug:
 http://cmake.org/Bug/view.php?id=11206

 This affects me on every single (in house) release of my application.

 Same for this one:
  http://www.cmake.org/Bug/view.php?id=10798

 There is already a patch available.

 I think you have the wrong bug # because that does not appear to have
 anything to do with the generation of NSIS packages.


Sorry. I now see what you were saying. I guess I was tired last evening..

John
___
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.3-rc4 ready for testing!

2010-10-29 Thread John Drescher
On Fri, Oct 29, 2010 at 6:03 PM, David Cole david.c...@kitware.com wrote:
 The CMake 2.8.3 release candidate stream continues!
 You can find the source and binaries here:
 http://www.cmake.org/files/v2.8/?C=M;O=D

 EXCEPT: There are not yet Irix or Sun pre-built binary
 installers available for CMake 2.8.3-rc4. There is a
 failing (HTML documentation validity checking) test on
 some platforms that appears to be unrelated to any CMake
 source code changes. That test failure is preventing the
 release building process from completing today on those
 platforms. If that issue clears up soon, I'll re-do the
 installers on those platforms. If not, just use rc3, or
 build from source. We'll address this before the final
 release.

 This will be the LAST release candidate for 2.8.3
 unless a major regression is reported. So please
 try it on your projects and let us know right away
 about any problems.


I know its probably too late for 2.8.3 but can someone please look at
the following bug:
http://cmake.org/Bug/view.php?id=11206

This affects me on every single (in house) release of my application.

John
___
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.3-rc4 ready for testing!

2010-10-29 Thread John Drescher
 I know its probably too late for 2.8.3 but can someone please look at
 the following bug:
 http://cmake.org/Bug/view.php?id=11206

 This affects me on every single (in house) release of my application.

 A workaround is to do a monolithic install.
 SET(CPACK_MONOLITHIC_INSTALL 1)
 ...
 INCLUDE(CPack)

 Does that not work for you?

Thanks. I will try that next build..
John
___
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.3-rc4 ready for testing!

2010-10-29 Thread John Drescher
On Fri, Oct 29, 2010 at 8:17 PM, Karl Wallner cm...@karlwallner.de wrote:
 Am 30.10.2010 00:45, schrieb John Drescher:
 I know its probably too late for 2.8.3 but can someone please look at
 the following bug:
 http://cmake.org/Bug/view.php?id=11206

 This affects me on every single (in house) release of my application.

 Same for this one:
  http://www.cmake.org/Bug/view.php?id=10798

 There is already a patch available.

I think you have the wrong bug # because that does not appear to have
anything to do with the generation of NSIS packages.

John
___
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] Beginner's Question: Organizing Projects

2010-10-28 Thread John Drescher
On Thu, Oct 28, 2010 at 8:23 AM, Dominik Gabi dkgis...@gmail.com wrote:
 On Wed, 2010-10-27 at 10:54 -0500, Ryan Pavlik wrote:
 On Wed, Oct 27, 2010 at 9:04 AM, Rolf Eike Beer e...@sf-mail.de wrote:
  Thanks. The way I understand this is that now instead of
 
  include_directories(${GTKMM_INCLUDE_DIRS})
 
  i would write something like
 
  include_directories(${GTKMM_INCLUDE_DIRS})
  # and at the end of the file
  set(INCLUDE_DIRECTORIES ${INCLUDE_DIRECTORIES} PARENT_SCOPE)
 
  ? I'd do the same with the LINK_DIRECTORIES, LINK_LIBRARIES property and
  for all other libraries?
 
  Don't set LINK_DIRECTORIES and LINK_LIBRARIES. When you are a beginner
  probably every usage of them is wrong.
 
  You simply do
 
  TARGET_LINK_LIBRARIES(mytarget ${GTK_LIBRARIES}) (or however that is 
  called)
 
  The only thing you need to export upwards in this case would be the
  GTK_LIBRARIES variable.
 
  Eike

 This is good advice, however, in most cases, since you're using
 pkgconfig directly (which is not the recommended way), that will cause
 more failure.  Best thing to do is to create/find a cmake module for
 each of those packages, that might use pkgconfig for help finding the
 library, but that doesn't just use what it returns verbatim.

 Ryan


 As it turns out, my problems are probably not cmake related. Thanks for
 the help anyway.

 Maybe it's my limited understanding of C++. So here's the problem. The
 project structure is as before. I've got a ui directory that uses
 classes from the geometry directory. I've set up a simple test class in
 the geometry directory that I use in some file in ui.

 // Test.h
 class Test
 {
        public:
                static void test();
 };

 // Test.cpp
 #include Test.h
 #include iostream
 void Test::test()
 {
        std::cout  Hello World!  std::endl;
 }

 With these two files it works perfectly fine. Everything compiles, links
 and runs without problems. Unfortunately, as soon as I add templates the
 situation is different:

 // Test.h
 templateclass T
 class Test
 {
 public:
 static void test();
 };

 // Test.cpp
 #include Test.h
 #include iostream
 templateclass T
 void TestT::test()
 {
 std::cout  Hello World!  std::endl;
 }

 results in the following error (I've left out the name spaces above for
 clarity):

 domi...@dmac:Pixels$ make
 Scanning dependencies of target Ui
 [ 33%] Building CXX object ui/CMakeFiles/Ui.dir/MainWindow.cpp.o
 Linking CXX static library libUi.a
 [ 33%] Built target Ui
 [ 66%] Built target Geometry
 Linking CXX executable Pixels
 ui/libUi.a(MainWindow.cpp.o): In function
 `UI::MainWindow::start_application(int, char**)':
 MainWindow.cpp:(.text+0x9e1): undefined reference to
 `GE::Testdouble::test()'
 collect2: ld returned 1 exit status
 make[2]: *** [Pixels] Error 1
 make[1]: *** [CMakeFiles/Pixels.dir/all] Error 2
 make: *** [all] Error 2

 I don't get it, can anyone explain this to me?


Start reading here:

http://stackoverflow.com/questions/115703/storing-c-template-function-definitions-in-a-cpp-file

John
___
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] Beginner's Question: Organizing Projects

2010-10-28 Thread John Drescher
On Thu, Oct 28, 2010 at 8:29 AM, John Drescher dresche...@gmail.com wrote:
 On Thu, Oct 28, 2010 at 8:23 AM, Dominik Gabi dkgis...@gmail.com wrote:
 On Wed, 2010-10-27 at 10:54 -0500, Ryan Pavlik wrote:
 On Wed, Oct 27, 2010 at 9:04 AM, Rolf Eike Beer e...@sf-mail.de wrote:
  Thanks. The way I understand this is that now instead of
 
  include_directories(${GTKMM_INCLUDE_DIRS})
 
  i would write something like
 
  include_directories(${GTKMM_INCLUDE_DIRS})
  # and at the end of the file
  set(INCLUDE_DIRECTORIES ${INCLUDE_DIRECTORIES} PARENT_SCOPE)
 
  ? I'd do the same with the LINK_DIRECTORIES, LINK_LIBRARIES property and
  for all other libraries?
 
  Don't set LINK_DIRECTORIES and LINK_LIBRARIES. When you are a beginner
  probably every usage of them is wrong.
 
  You simply do
 
  TARGET_LINK_LIBRARIES(mytarget ${GTK_LIBRARIES}) (or however that is 
  called)
 
  The only thing you need to export upwards in this case would be the
  GTK_LIBRARIES variable.
 
  Eike

 This is good advice, however, in most cases, since you're using
 pkgconfig directly (which is not the recommended way), that will cause
 more failure.  Best thing to do is to create/find a cmake module for
 each of those packages, that might use pkgconfig for help finding the
 library, but that doesn't just use what it returns verbatim.

 Ryan


 As it turns out, my problems are probably not cmake related. Thanks for
 the help anyway.

 Maybe it's my limited understanding of C++. So here's the problem. The
 project structure is as before. I've got a ui directory that uses
 classes from the geometry directory. I've set up a simple test class in
 the geometry directory that I use in some file in ui.

 // Test.h
 class Test
 {
        public:
                static void test();
 };

 // Test.cpp
 #include Test.h
 #include iostream
 void Test::test()
 {
        std::cout  Hello World!  std::endl;
 }

 With these two files it works perfectly fine. Everything compiles, links
 and runs without problems. Unfortunately, as soon as I add templates the
 situation is different:

 // Test.h
 templateclass T
 class Test
 {
 public:
 static void test();
 };

 // Test.cpp
 #include Test.h
 #include iostream
 templateclass T
 void TestT::test()
 {
 std::cout  Hello World!  std::endl;
 }

 results in the following error (I've left out the name spaces above for
 clarity):

 domi...@dmac:Pixels$ make
 Scanning dependencies of target Ui
 [ 33%] Building CXX object ui/CMakeFiles/Ui.dir/MainWindow.cpp.o
 Linking CXX static library libUi.a
 [ 33%] Built target Ui
 [ 66%] Built target Geometry
 Linking CXX executable Pixels
 ui/libUi.a(MainWindow.cpp.o): In function
 `UI::MainWindow::start_application(int, char**)':
 MainWindow.cpp:(.text+0x9e1): undefined reference to
 `GE::Testdouble::test()'
 collect2: ld returned 1 exit status
 make[2]: *** [Pixels] Error 1
 make[1]: *** [CMakeFiles/Pixels.dir/all] Error 2
 make: *** [all] Error 2

 I don't get it, can anyone explain this to me?


 Start reading here:

 http://stackoverflow.com/questions/115703/storing-c-template-function-definitions-in-a-cpp-file

 John


Here is a second link:
http://www.parashift.com/c++-faq-lite/templates.html#faq-35.12


-- 
John M. Drescher
___
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] cannot include txx files using CMake

2010-10-20 Thread John Drescher
On Wed, Oct 20, 2010 at 12:05 PM, Prathamesh Kulkarni
prathameshmkulka...@gmail.com wrote:

 Hello all,

 I want to interface VTK and ITK. Hence I copied the required 4 files (2 txx
 and 2 cpp) in InsightApplications/Auxilliary/vtk to a common source
 directory which I want to include in all my other project source
 directories. In doing this, I am using the following CMake commands:

 SET(IMPORTED_SRCS
  ${Common1_SOURCE_DIR}/src/*.cpp
  ${Common2_SOURCE_DIR}/src/Common.cpp
  ${Common2_SOURCE_DIR}/src/*.txx
  )


 SET(IMPORTED_HDRS
   ${Common1_SOURCE_DIR}/include/*.h
   ${Common2_SOURCE_DIR}/include/*.h
  )


 FILE(GLOB SRCS src/*.cpp src/*.c src/*.txx ${IMPORTED_SRCS})
 FILE(GLOB HDRS include/*.h ${IMPORTED_HDRS})

 ADD_EXECUTABLE(Project1 ${SRCS} ${HDRS})


 However, this is not helping me to include Common2 source and header files
 in Project1's respective files. What am I doing wrong here?


I would avoid using GLOB like this it causes more problems then it is worth.

John
___
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] cannot include txx files using CMake

2010-10-20 Thread John Drescher
On Wed, Oct 20, 2010 at 12:19 PM, Prathamesh Kulkarni
prathameshmkulka...@gmail.com wrote:
 Okay, could you please suggest an alternative over this issue?


I add each file one by one in variables. The following is from an app
used for unit testing my Qt SQLITE database for my current
application.

SET( DEMO_SRCS
./src/main.cxx
./src/MainWindow.cxx
./src/CmdCreateDB.cxx
./src/CmdAddUser.cxx
./src/CmdAddStudy.cxx
./src/CmdAddCase.cxx
./src/CmdAddImage.cxx
./src/CmdAddCaseAltID.cxx
#./src/CmdAddCaseLocation.cxx
./src/CmdAddImageSeries.cxx
./src/CmdAddStudyMode.cxx
./src/CmdAddSRSMPart.cxx
./src/CmdAddSRSMCasePart.cxx
#./src/CmdAddStudySMPart.cxx
./src/CmdUpdateRSSSMCompletion.cxx
./src/CmdSetCurrentReaderStudyMode.cxx
./src/CmdGetStudyModeReaderParticipation.cxx
./src/CmdGetReaderTotalCaseCount.cxx
./src/CmdGetReaderTotalCaseList.cxx
./src/CmdGetReaderCompletedCaseCount.cxx
./src/CmdGetReaderCompletedCaseList.cxx
./src/CmdGetReaderRecentCaseCount.cxx
./src/CmdGetReaderRecentCaseList.cxx
./src/CmdCounterBalanceStudyModes.cxx
./src/CmdUpdateAdmin.cxx
./src/CmdLstReadersInStudy.cxx
./src/CmdAddReaderStudyModeCompletion.cxx
./src/CmdAddReaderCaseCompletion.cxx
./src/CmdTestImageSeriesCosines.cxx
./src/CmdVerifyDB.cxx
)

SET( DEMO_HDRS
./Include/CmdCreateDB.h
./Include/CmdAddUser.h
./Include/CmdAddStudy.h
./Include/CmdAddCase.h
./Include/CmdAddImage.h
./Include/CmdAddCaseAltID.h
#   ./Include/CmdAddCaseLocation.h
./Include/CmdAddImageSeries.h
./Include/CmdAddStudyMode.h
./Include/CmdAddSRSMPart.h
#./Include/CmdAddStudySMPart.h
./Include/CmdAddSRSMCasePart.h
./Include/CmdUpdateRSSSMCompletion.h
./Include/CmdSetCurrentReaderStudyMode.h
./Include/CmdGetStudyModeReaderParticipation.h
./Include/CmdGetReaderTotalCaseCount.h
./Include/CmdGetReaderTotalCaseList.h
./Include/CmdGetReaderCompletedCaseCount.h
./Include/CmdGetReaderCompletedCaseList.h
./Include/CmdGetReaderRecentCaseCount.h
./Include/CmdGetReaderRecentCaseList.h
./Include/CmdCounterBalanceStudyModes.h
./Include/CmdUpdateAdmin.h
./Include/CmdLstReadersInStudy.h
./Include/CmdAddReaderStudyModeCompletion.h
./Include/CmdAddReaderCaseCompletion.h
./Include/CmdTestImageSeriesCosines.h
./Include/CmdVerifyDB.h
)

SET( DEMO_MOC_HDRS
./Include/MainWindow.h
)

# some .ui files
SET( DEMO_UIS
)

# and finally an resource file
SET( DEMO_RCS

)

# this command will generate rules that will run rcc on all files from DEMO_RCS
# in result DEMO_RC_SRCS variable will contain paths to files produced by rcc
QT4_ADD_RESOURCES( DEMO_RC_SRCS ${DEMO_RCS} )

# and finally this will run moc:
QT4_WRAP_CPP( DEMO_MOC_SRCS ${DEMO_MOC_HDRS} )

# this will run uic on .ui files:
QT4_WRAP_UI( DEMO_UI_HDRS ${DEMO_UIS} )

add_executable(dbDev0 ${DEMO_SRCS}
${DEMO_MOC_SRCS}
${DEMO_HDRS}
${DEMO_MOC_HDRS}
${DEMO_UI_HDRS}
${DEMO_RC_SRCS}
)

target_link_libraries(dbDev0
${QT_LIBRARIES}
${UPMC_EXTERNAL_LIBS}
)
___
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] How to compile as release with /MT /GS in cmake?

2010-10-12 Thread John Drescher
On Tue, Oct 12, 2010 at 8:06 AM, Mr Shore shore.cl...@gmail.com wrote:
 I'm using cl.exe if that matters,thanks in advance!


CMAKE_CXX_FLAGS_RELEASE is the variable you want.

I believe this will do what you want:

SET(CMAKE_CXX_FLAGS_RELEASE /MT /GS )

John
___
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] How to compile as release with /MT /GS in cmake?

2010-10-12 Thread John Drescher
On Tue, Oct 12, 2010 at 8:58 AM, Mr Shore shore.cl...@gmail.com wrote:
 Hi John

 Can I restrict the scope so that this setting is only for one specific
 target?


If the targets are in their own subdirectory yes. Just set the
variable in the CMakeLists.txt file in that target after all
add_subdirectory lines so it does not pick up other projects.

If the targets are all in 1 CMakeLists.txt I am not sure how to do
that. I am not saying its not possible I just never had to look into
that since every project I create is in its own folder /
CMakeLists.txt file.

John
___
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] Reusing configuration

2010-10-11 Thread John Drescher
On Mon, Oct 11, 2010 at 9:32 AM, Fred Fred stan1...@hotmail.fr wrote:
 Hello,
 I suppose this question has already been asked here but I did not find any
 trace of it, including in the wiki.
 My students want to install PV at home and they need to build it from source
 in order to extend it.
 They do have a version installed at the university and, since configuring
 and choosing the right options is not that easy, I wonder if there is a way
 to give them a configuration file so as for them to have the options
 selection list prefilled?


The big problem with that is the install must be in the same folder
and the dependencies must be the same. It may be easier to create a
script to start cmake-gui with a command line containing the options
you will have as default.

John
___
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 Visual Studio 64bit flag?

2010-10-08 Thread John Drescher
On Fri, Oct 8, 2010 at 12:50 PM,  aaron.mead...@thomsonreuters.com wrote:
 Seems to work correctly from my tests:



 CMakeLists.txt:

 cmake_minimum_required (VERSION 2.8)



 project(test CXX)

 message( STATUS CMAKE_GENERATOR: ${CMAKE_GENERATOR})

 message( STATUS CMAKE_CL_64: ${CMAKE_CL_64})







 c:\dev2\Builds\test\x64cmake -G Visual Studio 8 2005 ../.

 -- Check for working CXX compiler using: Visual Studio 8 2005

 -- Check for working CXX compiler using: Visual Studio 8 2005 -- works

 -- Detecting CXX compiler ABI info

 -- Detecting CXX compiler ABI info - done

 -- CMAKE_GENERATOR: Visual Studio 8 2005

 -- CMAKE_CL_64: 0

 -- Configuring done

 -- Generating done

 -- Build files have been written to: C:/dev2/Builds/test/x64





 c:\dev2\Builds\test\x86cmake -G Visual Studio 8 2005 Win64 ../.

 -- Check for working CXX compiler using: Visual Studio 8 2005 Win64

 -- Check for working CXX compiler using: Visual Studio 8 2005 Win64 -- works

 -- Detecting CXX compiler ABI info

 -- Detecting CXX compiler ABI info - done

 -- CMAKE_GENERATOR: Visual Studio 8 2005 Win64

 -- CMAKE_CL_64: 1

 -- Configuring done

 -- Generating done

 -- Build files have been written to: C:/dev2/Builds/test/x86



I believe you got your folder names backwards.
John
___
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] Stopping the VS build when configure fails

2010-10-05 Thread John Drescher
On Fri, Oct 1, 2010 at 2:57 PM, John Drescher dresche...@gmail.com wrote:
 I just hit Build Solution which caused ZERO_CHECK project to run because
 my CMakeLists.txt file had changed.  ZERO_CHECK ran CMake which attempted to
 generate a new solution.  Typically this results in a good new project and
 the VS plugin detects this and asks me to load the new project files.
 However in this case, the new project files could not be generated due to
 the error.  For whatever reason VS keeps going even though the ZERO_CHECK
 target failed.


 I see. Now I am having some similar problems with 2.8.3-rc1 and
 reloads. I did not notice that until today. After I change my
 CMakeList.txt  in a subproject (not sure about the root project) and
 click build in visual studio 2008 I am no longer getting prompted for
 the reload but the build appears to never finish. I have to hit cancel
 on the build then windows prompts me to reload the project. No dialog
 appeared.


Okay. Here is a weird one. I killed Outlook 2007 in task manager
because it was not showing up. After it terminated I got an instant
CMake prompt to reload the solution file. The thing is I was not
configuring my application and I was also not compiling my app. I have
not started coding today yet..

John
___
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] Stopping the VS build when configure fails

2010-10-05 Thread John Drescher
 CMake iterates over the Windows running object table (a COM thing) to find
 Visual Studio instances to ping to call the reload macro. When something is
 dead and stuck in the running object table (which happens occasionally, but
 thankfully not frequently) then CMake hangs in that iteration loop waiting
 forever for that dead thing to respond. The only way out of that situation
 is a reboot or actually killing the process that's really hung. As soon as
 that's killed, CMake continues its iteration happily, not realizing it's
 been waiting for hours or days... :-)

 So there's an explanation for such mad behavior... even though it's not
 going to make anybody happy, at least it's not a mystery. The mystery is why
 Outlook was hung in the first place.

I thought that was COM related but I have not looked into COM in years..


 Have you considered using Thunderbird? :-)


Company policy but I do not usually use the company email system for
even work related matters. I do not check outlook often that is why I
did not notice.. One reason is they automatically throw away most
attachments with no way to get them back and without notifying the
sender. That has burned me more than once with companies sending me
SDKs in zip files.

John
___
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] how to get cmake and custom qt widget to work?

2010-10-05 Thread John Drescher
On Tue, Oct 5, 2010 at 2:59 PM, e...@cs.bgu.ac.il e...@cs.bgu.ac.il wrote:

 hello.
 I have a cmake+qt4 project, I needed to extend a certain gui item to suit my 
 needs, I've been able to insert it into qtcreator and incorporate it into the 
 project's gui, now when I run compilation, I get this:
 /home/dagg/workspace/OSSM/src/GUI/ui_TrainingActivityManager.h:29:28: error: 
 qstringspinbox.h: No such file or directory

 the relevant part of 
 /home/dagg/workspace/OSSM/src/GUI/ui_TrainingActivityManager.h is this:
 /
 ** Form generated from reading UI file 'TrainingActivityManager.ui'
 **
 ** Created: Tue Oct 5 20:29:00 2010
 **      by: Qt User Interface Compiler version 4.6.3
 **
 ** WARNING! All changes made in this file will be lost when recompiling UI 
 file!
 /

 #ifndef UI_TRAININGACTIVITYMANAGER_H
 #define UI_TRAININGACTIVITYMANAGER_H

 #include QtCore/QLocale
 #include QtCore/QVariant
 #include QtGui/QAction
 #include QtGui/QApplication
 #include QtGui/QButtonGroup
 #include QtGui/QDialog
 #include QtGui/QDialogButtonBox
 #include QtGui/QFormLayout
 #include QtGui/QGridLayout
 #include QtGui/QHeaderView
 #include QtGui/QLabel
 #include QtGui/QLineEdit
 #include QtGui/QPushButton
 #include QtGui/QTreeWidget
 #include QtGui/QVBoxLayout
 #include QtGui/QWidget
 #include qstringspinbox.h  // line 28

 QT_BEGIN_NAMESPACE

 class Ui_TrainingActivityManager
 {
 public:
    QTreeWidget *mTrainActManList;
    QWidget *layoutWidget;

 how can I make cmake work with this plugin, I've putted the hpp and cpp of 
 the plugin within one of my sub project's src folder, also the file is called 
 qstringspinbox.hpp.

 any help would be appreciated.

The problem is most likely with your CMakeLists.txt

John
___
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] how to get cmake and custom qt widget to work?

2010-10-05 Thread John Drescher
On Tue, Oct 5, 2010 at 3:41 PM, e...@cs.bgu.ac.il e...@cs.bgu.ac.il wrote:
 nope, like I wrote in the first post, I need a string spinbox so I've 
 extended qspinbox to support strings.
 that is the custom widget in question.


You need to add the path of where ever your custom widget is into one
of the INCLUDE_DIRECTORIES statements in your CMakeLists.txt

John
___
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] Get configuration-dependant LOCATION property

2010-10-04 Thread John Drescher
On Mon, Oct 4, 2010 at 5:15 PM, Mateusz Loskot mate...@loskot.net wrote:
 On 04/10/10 14:24, Michael Hertling wrote:
 On 10/04/2010 10:53 AM, Mateusz Loskot wrote:
 On 04/10/10 07:33, J Decker wrote:
 CMAKE_INSTALL_CONFIG_NAME I don't know if there's a simple flag like
 'project supports multiple targets' so I have an if(MSVC) set(
 MULTI_TARGET) endif()   if( MULTI_TARGET ) Install( targets ...
 ${CMAKE_INSTALL_CONFIG_NAME ) else() isntall( ... ${CMAKE_BUILD_TYPE}


 I need it before firing up install procedures.
 I build.
 I run tests (here I need to know location of build output per target).

 Have you already taken a look at ADD_TEST()'s generator expressions like
 $TARGET_FILE_DIR:tgt? AFAIK, they've been introduced quite exactly to
 meet requirements such as yours.

 Hmm, I've seen this expressions, but I'm not sure how it can be useful
 because the expressions are used to generate test input.

 My problem is about getting property to generate environment
 for test before it is executed:

 In one subtree of my sources, I have mylib target building mylib.dll
 In another subtree, I have test. Next, I build and run test:

 add_executable(mytest test.cpp)

 target_link_libraries(mytest mylib_import.lib)

 add_test(mytest ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/mytest)

 set_tests_properties(mytest PROPERTIES
  ENVIRONMENT PATH=c:\path\to\dir\with\mylib.dll\)

 I need to figure out this: c:\path\to\dir\with\mylib.dll\


If you are inside the CMakeLists.txt file that creates the shared
library then you have full access to the location of the .dll (it
should be in the same location of the import library) that is created
using the CMake variables (there are several of these). If you are in
some other application then put this path a UseProjectName.cmake for
your library.

John
___
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] Stopping the VS build when configure fails

2010-10-01 Thread John Drescher
On Fri, Oct 1, 2010 at 2:21 AM, Rolf Eike Beer e...@sf-mail.de wrote:
 Am Friday 01 October 2010 schrieb John Drescher:
 On Thu, Sep 30, 2010 at 7:47 PM, James Bigler jamesbig...@gmail.com wrote:
  On Thu, Sep 30, 2010 at 5:42 PM, James Bigler jamesbig...@gmail.com
 wrote:
  I'm currently using VS 2008 64 bit with CMake 2.6.3.
 
  This also happens with 2.8.3 RC1.

 That is good. I would be worried if it did not. The error means a file
 (traversal.c) is missing in your source or at least not in the folder
 that CMake is expecting.

 As you can see from James' log CMake did in fact _not_ stop the build but
 continued building even if there was an error in generating. And: yes, I have
 seen MSVC builds e.g. running through INSTALL even if one of the projects
 before failed to build.

Sorry. You are correct. I have never seen this. However I believe the
op is doing a build directly from cmake which I never do.

John
___
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] Stopping the VS build when configure fails

2010-10-01 Thread John Drescher
 I just hit Build Solution which caused ZERO_CHECK project to run because
 my CMakeLists.txt file had changed.  ZERO_CHECK ran CMake which attempted to
 generate a new solution.  Typically this results in a good new project and
 the VS plugin detects this and asks me to load the new project files.
 However in this case, the new project files could not be generated due to
 the error.  For whatever reason VS keeps going even though the ZERO_CHECK
 target failed.


I see. Now I am having some similar problems with 2.8.3-rc1 and
reloads. I did not notice that until today. After I change my
CMakeList.txt  in a subproject (not sure about the root project) and
click build in visual studio 2008 I am no longer getting prompted for
the reload but the build appears to never finish. I have to hit cancel
on the build then windows prompts me to reload the project. No dialog
appeared.

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

2010-09-30 Thread John Drescher
 I use cmake with qt projects for desktop application. Recently I've been
 started developing for symbian.
 I've found a generator for carbide but I use Qt Creator.
 I would like to generate Makefile like qmake does and then build the project
 with the Symbian toolchain.
 Qmake has also the support for build a sis package with the smart
 installer embedded, for signing app, etc.
 Can I do these tasks with cmake?

 Last year at Qt dev days in Munich there was rumors about a collaboration
 between kitware and Qt Software to improve the integration between cmake and
 qt:
 http://labs.qt.nokia.com/2009/10/12/to-make-or-not-to-make-qmake-and-beyond/
 http://labs.qt.nokia.com/2009/10/14/to-make-or-not-to-make-qmake-and-beyond-redux/
 Any News?

Recent versions of Qtcreator support using cmake directly but I don't
think that is what you are looking for.

John
___
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] Stopping the VS build when configure fails

2010-09-30 Thread John Drescher
On Thu, Sep 30, 2010 at 7:47 PM, James Bigler jamesbig...@gmail.com wrote:
 On Thu, Sep 30, 2010 at 5:42 PM, James Bigler jamesbig...@gmail.com wrote:

 I'm currently using VS 2008 64 bit with CMake 2.6.3.

 This also happens with 2.8.3 RC1.

That is good. I would be worried if it did not. The error means a file
(traversal.c) is missing in your source or at least not in the folder
that CMake is expecting.

John
___
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] Stopping the VS build when configure fails

2010-09-30 Thread John Drescher
On Thu, Sep 30, 2010 at 7:42 PM, James Bigler jamesbig...@gmail.com wrote:
 Is CMake supposed to stop the VS build when configure fails?


Yes.

John
___
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] setting Visual Studio solution name

2010-09-29 Thread John Drescher
I am not exactly sure what you are doing but on all my CMake projects
I put only 1 target at the root level project. All other subprojects
are in subdirectories of the root target. The CMakeLists for these
subprojects can have project names but this is not needed. The
solution gets the name from the root project.

John
___
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] VS Plugin error with VS 2010 and CMake 2.8.3 RC1

2010-09-22 Thread John Drescher
On Wed, Sep 22, 2010 at 4:20 PM, James Bigler jamesbig...@gmail.com wrote:
 I tried out CMake 2.8.3 RC1 with my project today.  When I modify a
 CMakeLists.txt file and compile, the reload project dialog starts up and I
 click No for don't start recompiling (because it calls ALL_BUILD instead
 of the one project I want to build), and then I get a the build must be
 stopped before the solution can be closed.  I click OK and then I get a
 dialog that says:

 Operation aborted (Exception from HRESULT: 0x80004004 (E_ABORT))

 Any clues as to why this might be happening or how I can fix it?

Just try building again. You will get comm errors if you take too long
to answer the prompt from when the macro first loaded. I see this
probably 1 time a week on VS2008 and VS2005. I do not have 2010 until
software licencing renews in two months.

John
___
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] FindLibrary only looks for lib under Windows

2010-09-15 Thread John Drescher
 Am Wednesday 15 September 2010 schrieb David Cole:
 find_library always looks for *.lib files on Windows. Those are the ones
 that need to be passed to the linker. The *.dll files are the ones that
 need to be there at runtime in order to run correctly.

 This behavior is intended, by design, and is working correctly.

 IIRC at least newer versions of MinGW can link directly against dll's.


MinGW can do this however all versions of Visual Studio require an
import library. In VS linking to the .lib is necessary even though the
executable code is in the .dlls

John
___
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] using only release versions of QT libraries

2010-09-09 Thread John Drescher
On Thu, Sep 9, 2010 at 3:06 PM, edA-qa mort-ora-y eda...@disemia.com wrote:
 My cmake file has the fairly standard QT setup:

 find_package(Qt4 COMPONENTS QtCore QtGui QtXml QtNetwork QtSvg QtOpenGL
 QtMain REQUIRED)
 include(${QT_USE_FILE})


 and then later use ${QT_LIBRARIES}

 However, this uses the debug libraries when I do a debug build. I don't
 want that. I want to just use the Release libraries for QT. Is there an
 easy way to do this?


Do not do that. Your application will crash (in unexpected ways) if
you mix debug and release libraries in visual studio. You also can not
mix compiler versions.

John
___
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] Windows 64 bit version?

2010-09-05 Thread John Drescher
On Sun, Sep 5, 2010 at 1:26 PM, David Doria daviddo...@gmail.com wrote:
 I don't see a 64 bit Windows binary here:

 http://www.cmake.org/cmake/resources/software.html

 Is the link missing? Or does this not exist for some reason?


It does not exist and it is not needed. The 32 bit cmake executable
will work fine with 64 bit windows and 64 bit compilers.

John
___
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] cpack/nsis behavior

2010-09-03 Thread John Drescher
 I've got this case where I'm using cpack to create nsis packages with a set of
 components that I want packaged.

 If I run the installer, things work.
 But, if I run the installer a second time (without doing an uninstall first),
 it doesn't do anything.  So, if one had manually removed files, the installer
 doesn't put them back.

 I suspect its because there are components, and it assumes it can skip things
 if the component was already installed before (it is saved in the registry
 what components were installed).

 Is there a way to force it to install files again?  Much like a repair
 functionality would do?

 I tried with the cmake installer, and it installs files again just fine.  I
 suspect that is because there are no components in that installer.


I have this as well. I thought it was a nsis bug and filed a bugreport
on their site which instantly got closed as its probably the fault of
CMake.

John
___
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] cpack/nsis behavior

2010-09-03 Thread John Drescher
On Fri, Sep 3, 2010 at 4:36 PM, John Drescher dresche...@gmail.com wrote:
 I've got this case where I'm using cpack to create nsis packages with a set 
 of
 components that I want packaged.

 If I run the installer, things work.
 But, if I run the installer a second time (without doing an uninstall first),
 it doesn't do anything.  So, if one had manually removed files, the installer
 doesn't put them back.

 I suspect its because there are components, and it assumes it can skip things
 if the component was already installed before (it is saved in the registry
 what components were installed).

 Is there a way to force it to install files again?  Much like a repair
 functionality would do?

 I tried with the cmake installer, and it installs files again just fine.  I
 suspect that is because there are no components in that installer.


 I have this as well. I thought it was a nsis bug and filed a bugreport
 on their site which instantly got closed as its probably the fault of
 CMake.


For me it's a little more complicated because I want to allow to
install more than 1 version of the same application at the same time.
On the second go the install folder is created and the bin folder is
created inside that but no the installer ends quickly and nothing gets
installed on the second go. I then uninstall the newly installed
project and the next install will actually install files.

John
___
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] cpack/nsis behavior

2010-09-03 Thread John Drescher
 I see that behavior too.
 So I see this commit introduce that behavior
 http://cmake.org/gitweb?p=cmake.git;a=commit;h=83ec8c35933439305895b8569b2125a7e091fc57

 And the intention was to only install/remove the minimal
  number of files when re-run to update the installation (or by clicking
  Change in Add/Remove programs)

 The Change button doesn't work for me anyway.

 If I remove a few lines of code from cmCPackNSISGenerator.cxx then I get what
 I want:
 -  componentCode +=   IntCmp $ + component-Name
 -    + _was_installed ${SF_SELECTED} noinstall_ + component-Name + \n;
 ...
 -  componentCode +=   noinstall_ + component-Name + :\n;


Thank You. I will look at that when I get a chance.

John
___
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] Debugging CMAKE_SIZEOF_VOID_P

2010-08-31 Thread John Drescher
On Tue, Aug 31, 2010 at 12:01 PM, U.W. Mechatronics Lab
mech...@engr.wisc.edu wrote:
 I am having trouble getting any return value from CMAKE_SIZEOF_VOID_P on one
 particular Win7x64  machine.  If I check out my tree on a different Win7x64
 machine it seems to properly return a value of 8.  I’m looking for a way of
 debugging why it doesn’t seem to be returning a value.  I’m currently using
 cmake-2.8.0-win32-x86 as that is checked into our build tree and being
 executed out of that tree.



Are you launching cmake from a 64 bit visual studio (2005, 2008, 2010)
 command prompt?

If not try that.

John
___
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] Debugging CMAKE_SIZEOF_VOID_P

2010-08-31 Thread John Drescher
On Tue, Aug 31, 2010 at 12:17 PM, John Drescher dresche...@gmail.com wrote:
 On Tue, Aug 31, 2010 at 12:01 PM, U.W. Mechatronics Lab
 mech...@engr.wisc.edu wrote:
 I am having trouble getting any return value from CMAKE_SIZEOF_VOID_P on one
 particular Win7x64  machine.  If I check out my tree on a different Win7x64
 machine it seems to properly return a value of 8.  I’m looking for a way of
 debugging why it doesn’t seem to be returning a value.  I’m currently using
 cmake-2.8.0-win32-x86 as that is checked into our build tree and being
 executed out of that tree.



 Are you launching cmake from a 64 bit visual studio (2005, 2008, 2010)
  command prompt?

 If not try that.


Also I would use the latest cmake 2.8.2 instead of 2.8.0. There were a
few bugs in the initial 2.8.0 version fixed.

John
___
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] Debugging CMAKE_SIZEOF_VOID_P

2010-08-31 Thread John Drescher
 I'm not sure how to do that - the guy that set up our tree/build system has
 a batch file written to extract cmake, setup some directories, then call the
 cmake gui to configure the tree.  What's thoroughly confusing is that this
 seems to work properly on my Win7x64 laptop  on a W2K8x64 Server - just not
 on my Win7x64 desktop.

Are you building with visual studio?

John
___
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] Debugging CMAKE_SIZEOF_VOID_P

2010-08-31 Thread John Drescher
 Yes but this is an issue even before actually compiling code... so VS is not
 in the picture at this point in the process.


Yes it is. CMake specifically detects the compiler and uses it to
compile test programs to fills in the information for
MAKE_SIZEOF_VOID_P.

John
___
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] Debugging CMAKE_SIZEOF_VOID_P

2010-08-31 Thread John Drescher
 Cmake specifically is using Visual Studio 9 2008 Win64 as the generator (via
 the cmakegui)


Open a Visual Studio 2008 x64 Win64 Command Prompt. This should
exist in the Tools menu for Visual Studio 2008. Then run your batch
file inside that. If that fails clear the build folder first.

John
___
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] several questions about cmake

2010-08-26 Thread John Drescher
On Thu, Aug 26, 2010 at 6:47 AM, Hickel, Kelly kelly_hic...@bmc.com wrote:


 -Original Message-
 From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On
 Behalf Of Mike McQuaid
 Sent: Thursday, August 26, 2010 1:12 AM
 To: Mark Roden
 Cc: cmake@cmake.org
 Subject: Re: [CMake] several questions about cmake

 On 26 August 2010 01:34, Mark Roden mmro...@gmail.com wrote:
  I'm starting to get deep into CMake, and I have a few questions as I
  try to convert the socket++ library such that it can be compiled by
  CMake on Windows.
 
  1) The default install directory on Windows is C:\Program Files, or
  C:\Program Files (x86) on 64 bit.  This default will not work on
  Windows 7 (and perhaps Vista), because the user isn't running as
  administrator anymore, and only administrators can modify that
  directory.  There should probably be a warning to that effect on
  windows systems; otherwise, there are painful ways to run install,
 but
  they are painful.

 Most developers run as administrator so I don't think there should be a
 warning.


 In Windows 7 and Windows 2008 server, being logged in as a user in the 
 Administrators
 group is not sufficient, you have to elevate the privs of your process to 
 write in those directories.
 Another possibility is turning off UAC all together.

 So the warning might still be a good idea.

I agree. Installing on these systems even as administrator to the
default location C:\Program Files\  fails. I usually have CMake
install elsewhere by changing the CMAKE_INSTALL_PREFIX

John
___
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] Boost lib error when linking executable

2010-08-24 Thread John Drescher
On Tue, Aug 24, 2010 at 9:57 AM, Oenen, Jodi van
jodi.vanoe...@tass-safe.com wrote:
 Hi,

 We are migrating an 'old' Make project into the CMake world, and I am 
 encountering a problem during the link phase of one of our executables: the 
 linker cannot open a boost library.

 I am using CMake 2.8.2 on WinXP x64, Boost regex library 1.33.1, with Intel 
 C++/Fortran 9.1 compilers (icl/ifort), and Visual Studio 2005 (VS80) for 
 linking. I am not using a FindBOOST module (yet); I'm just replicating the 
 current Make environment for now, i.e. I have hardcoded the boost include 
 directory and the library which should be statically linked into the 
 executable. In the current Make system this works fine.

 However, this is what CMake says:

 snip
 C:\build\src\bsafc:\Program Files (x86)\Microsoft Visual Studio 
 8\vc\bin\nmake
 .exe bsaf_exe/fast VERBOSE=TRUE

 Microsoft (R) Program Maintenance Utility Version 8.00.50727.42
 Copyright (C) Microsoft Corporation.  All rights reserved.

        cd C:\build
        c:\Program Files (x86)\Microsoft Visual Studio 8\vc\bin\nmake.exe -f 
 s
 rc\bsaf\CMakeFiles\bsaf_exe.dir\build.make /nologo -                   
 src\bsaf\
 CMakeFiles\bsaf_exe.dir\build
 Linking CXX executable \em64t-win_cmake\bin\bsaf.exe
        cd C:\build\src\bsaf
        C:\Program Files (x86)\CMake 2.8\bin\cmake.exe -E vs_link_exe 
 C:\PROGR
 A~2\Intel\Compiler\C__~1\9.1\EM64T\Bin\icl.exe  /nologo 
 @C:\DOCUME~1\ADMINI~1\LO
 CALS~1\Temp\nm6860.tmp
 Visual Studio Non-Incremental Link
 LINK:
 C:\PROGRA~2\Intel\Compiler\C__~1\9.1\EM64T\Bin\icl.exe /nologo -nologo -GX 
 -G7 -
 W1 -D_CONSOLE -D_MBCS @CMakeFiles\bsaf_exe.dir\objects1.rsp 
 /Fe\em64t-win_cmake\
 bin\bsaf.exe -link /implib:bsaf.lib -nologo -subsystem:console 
 -incremental:no -
 stack:6400 /INCREMENTAL:NO /subsystem:console -MACHINE:X64 
 \em64t-win_cmake\
 lib\bsaf\bsaf.lib \em64t-win_cmake\lib\ulib\saf.lib 
 \em64t-win_cmake\lib\ulib\do
 m.lib \em64t-win_cmake\lib\ulib\domf2c.lib 
 \em64t-win_cmake\lib\ulib\mifparser.l
 ib \em64t-win_cmake\lib\ulib\ffilio.lib \em64t-win_cmake\lib\ulib\errmsg.lib 
 \em
 64t-win_cmake\lib\ulib\dynmemmgr.lib \em64t-win_cmake\lib\ulib\strings.lib 
 \em64
 t-win_cmake\lib\bsaf\bsaf.lib \em64t-win_cmake\lib\ulib\system.lib 
 \em64t-win_cm
 ake\lib\ulib\filetb.lib \em64t-win_cmake\lib\ulib\timer.lib 
 \em64t-win_cmake\lib
 \ulib\csys.lib C:\Users\madymo\em64t-win\ext\lib\xerces-c_1.lib 
 C:\Users\madymo\
 em64t-win\ext\boost\lib\libboost_regex-iw-mt-1_33_1.lib -lpthread -lm 
 libifcorem
 t.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib 
 advapi32.lib s
 hell32.lib ole32.lib oleaut32.lib uuid.lib kernel32.lib user32.lib gdi32.lib 
 win
 spool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib 
 uuid.lib
 /MANIFEST
 Fatal error cannot open libboost_regex-iw-mt-s-1_33_1.lib
 icl: error: problem during multi-file optimization compilation (code 1)
 LINK failed. with 1
 NMAKE : fatal error U1077: 'C:\Program Files (x86)\CMake 2.8\bin\cmake.exe' 
 :
 return code '0x'
 Stop.
 NMAKE : fatal error U1077: 'c:\Program Files (x86)\Microsoft Visual Studio 
 8\vc
 \bin\nmake.exe' : return code '0x2'
 Stop.
 /snip

 The linker cannot open libboost_regex-iw-mt-s-1_33_1.lib! I know the 
 libboost_regex-iw-mt-s-1_33_1.lib library is on my disk, at the correct 
 location (I can find it with 'dir 
 C:\Users\madymo\em64t-win\ext\boost\lib\libboost_regex-iw-mt-1_33_1.lib'). I 
 have full permissions on the file. When I change 
 libboost_regex-iw-mt-s-1_33_1.lib to libboost_regex-vc80-mt-s-1_33_1.lib 
 in my CMakeLists.txt file, CMake shows the same error: it complains about not 
 being able to open libboost_regex-iw-mt-s-1_33_1.lib(!!).

 Any ideas on what's going on?


Looks like you are mixing 64 bit and 32 bit libs.

John
___
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] Boost lib error when linking executable

2010-08-24 Thread John Drescher
 True :)

 As I said, I'm just replicating the current Make system, in which those same 
 32 bit libs are used -- and it works. CMake even adds some extra 32 bit libs 
 to the command line; I think they are added in Windows-icl.cmake 
 (CMAKE_C_STANDARD_LIBRARIES_INIT). So I'd say it should also work in CMake :)


I am pretty sure you can not mix 32 bit and 64 bit libraries in the
same application.

John
___
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] Boost lib error when linking executable

2010-08-24 Thread John Drescher
. I guess those X32.lib libraries are 64 bit, even though the names suggest 
otherwise (yay for Microsoft).

I did not know that. Sorry. I admit, I have not looked at the lib
names on my 64 bit builds.

John
___
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.0 problem

2010-08-21 Thread John Drescher
 I've tried to configure InsightToolkit-3.16.0 using CMake 2.8.0 and I'm
 using Visual c++ 2008 Express Edition. what I did, I just select source
 file(InsightToolkit-3.16.0) and binary file and  I've got the following
 message:
 Check for working C compiler: cl

 CMake Error: Remove failed on file: D:/ITK
 18/vc2008/CMakeFiles/CMakeTmp/Debug/cmTryCompileExec.exe: System Error:
 Permission denied

 Check for working C compiler: cl -- broken

 CMake Error at C:/Program Files/CMake
 2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:50 (MESSAGE):

 The C compiler cl is not able to compile a simple test program.

 It fails with the following output:

 Change Dir: D:/ITK 18/vc2008/CMakeFiles/CMakeTmp

 Run Build Command:C:\PROGRA~1\MICROS~1.0\Common7\IDE\VCExpress.exe

 CMAKE_TRY_COMPILE.sln /build Debug /project cmTryCompileExec

 Microsoft (R) Visual C++ Express Edition Version 9.0.30729.1.

 Copyright (C) Microsoft Corp 2007. All rights reserved.

 -- Build started: Project: cmTryCompileExec, Configuration: Debug Win32

 --

 Compiling...

 Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for

 80x86

 Copyright (C) Microsoft Corporation. All rights reserved.

 cl /Od /D WIN32 /D _WINDOWS /D _DEBUG /D CMAKE_INTDIR=\Debug\ /D

 _MBCS /FD /RTC1 /MDd /FocmTryCompileExec.dir\Debug\\ /FdD:/ITK

 18/vc2008/CMakeFiles/CMakeTmp/Debug/cmTryCompileExec.pdb /W3 /c /Zi /TC

 /Zm1000

 .\testCCompiler.c

 testCCompiler.c

 Compiling manifest to resources...

 Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.1

 Copyright (C) Microsoft Corporation. All rights reserved.

 Linking...

 LINK : fatal error LNK1105: cannot close file 'D:\ITK

 18\vc2008\CMakeFiles\CMakeTmp\Debug\cmTryCompileExec.exe'

 Build log was saved at file://d:\ITK

 18\vc2008\CMakeFiles\CMakeTmp\cmTryCompileExec.dir\Debug\BuildLog.htm

 cmTryCompileExec - 1 error(s), 0 warning(s)

 == Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped

 ==

 CMake will not be able to correctly generate this project.

 Call Stack (most recent call first):

 CMakeLists.txt:8 (PROJECT)

 Configuring incomplete, errors occurred!

 I hope to solve this problem, Thanks in advance.


I would first upgrade to cmake-2.8.2. There were a few bugs in 2.8.0
that were fixed months ago with 2.8.2. After that I would check if you
have write permissions on d:\itk. But wait a minute, did you set the
build folder to be d:\Itk with the source to be the same location. Its
much better to not have the build folder and source folder on the same
tree. So for example if your source is in D:\ITK put your build tree
in d:\Build\ITK

John
___
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] Visual Studio Express projects don't inherit from parent

2010-08-16 Thread John Drescher
On Mon, Aug 16, 2010 at 9:53 PM, Tron Thomas tron.tho...@frontier.com wrote:
 On 08/16/2010 10:38 AM, Brian Davis wrote:

 First off, I don't know the answer to your question, but I am curious how
 you are getting CMake to create inherited projects.  What are the commands
 you are suing to create an inherited project in CMake?  This is something I
 think I can use in my projects.


 I'm not creating inherited projects per se.  I used the include_directories
 command to set the path to a directory that contains header files that
 should be used by multiple targets in the project.  In Visual Studio terms
 this is analogous to applying a setting to the solution.  All the sub
 projects in the solution need to inherit the settings of that solution to
 pick up the header file path.  Because this is not happening automatically
 through the CMake script, I having to go through each project individually
 and select the inherit from parent setting to they all pick up this search
 path.

My guess is that you probably are setting the include_directories in
the wrong place in your root CMakeLists.txt. What I mean is you are
setting this variable after you issue the add_subdirectory() instead
of before.

John
___
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] How to write CMakeLists.txt for Qt4 when Q_OBJECT in xxx.cpp file

2010-07-31 Thread John Drescher
 when use QT4_WRAP_CPP( Generated_MOC_SRCS main.cpp ),  moc_main.cxx
 will be generated.
 then I use #include moc_main.cxx instead of #include main.moc

 but ${Generated_MOC_SRCS}  can not be added to  ADD_EXECUTABLE.
 otherwise moc_main.cxx will be compiled too.


I am confused at the problem. I use the same method as Mike Jackson
does and it works fine for my private moc implementations.

John
___
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] How to write CMakeLists.txt for Qt4 when Q_OBJECT in xxx.cpp file

2010-07-31 Thread John Drescher
On Sat, Jul 31, 2010 at 10:50 AM, 1+1=2 dbzhang...@gmail.com wrote:
 I want to use command like this:

 QT4_GENERATE_MOC(${CMAKE_CURRENT_SOURCE_DIR}/main.cpp main.moc)

 but I do not know how to make this run before main.cpp being compiled to 
 main.o

 anyone can help me?


Besides the fact that your syntax is wrong with your QT4_GENERATE_MOC
call the result of the moc has to be included in the target otherwise
it does not run.


John
___
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] Help using CMake Expat in Windows

2010-07-31 Thread John Drescher
On Sat, Jul 31, 2010 at 11:18 AM, Rolf Eike Beer e...@sf-mail.de wrote:
 Am Samstag 31 Juli 2010, 00:59:36 schrieb Stefan Buschmann:

 Am 30.07.2010 22:23, schrieb Clark Taylor:

  ADD_EXECUTABLE(myApp ${Headers} ${Src})

 You should not need to add ${Headers} here (usually only the sources
 should be compiled).

 If you do not include the headers to ADD_EXECUTABLE they will not show up as
 members of the project in MSVC which is quite annoying. So I would strongly
 encourage everyone to add the headers to the targets like Clark did.


Agreed. Specifying the headers will be needed if you use the visual
studio GUI. Without that the headers do not show up as part of the
project and this causes all kind of annoyances like no class view,
harder to get to the header file, searches may fail to find what you
want ...

John
___
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] How to write CMakeLists.txt for Qt4 when Q_OBJECT in xxx.cpp file

2010-07-31 Thread John Drescher
On Sat, Jul 31, 2010 at 9:05 AM, 1+1=2 dbzhang...@gmail.com wrote:
 Thanks for your answer.

 when use QT4_WRAP_CPP( Generated_MOC_SRCS main.cpp ),  moc_main.cxx
 will be generated.
 then I use #include moc_main.cxx instead of #include main.moc

 but ${Generated_MOC_SRCS}  can not be added to  ADD_EXECUTABLE.
 otherwise moc_main.cxx will be compiled too.

You want moc_main.cxx to be compiled otherwise you will have link errors.


John
___
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] How to write CMakeLists.txt for Qt4 when Q_OBJECT in xxx.cpp file

2010-07-31 Thread John Drescher
On Sat, Jul 31, 2010 at 11:28 AM, John Drescher dresche...@gmail.com wrote:
 On Sat, Jul 31, 2010 at 9:05 AM, 1+1=2 dbzhang...@gmail.com wrote:
 Thanks for your answer.

 when use QT4_WRAP_CPP( Generated_MOC_SRCS main.cpp ),  moc_main.cxx
 will be generated.
 then I use #include moc_main.cxx instead of #include main.moc

 but ${Generated_MOC_SRCS}  can not be added to  ADD_EXECUTABLE.
 otherwise moc_main.cxx will be compiled too.

 You want moc_main.cxx to be compiled otherwise you will have link errors.


Wait a minute. I think I did this a different way on one project. I
will try to dig this up later today. I am out to enjoy the weather for
now..

John
___
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] libraryname decoration

2010-07-30 Thread John Drescher
 Please do explain. How would this work? What would the API be? And now it 
 suddenly sounds like CMake isn't supposed to do everything automagically 
 anymore. If that is the case, please RTFM and look into the OUTPUT_NAME 
 target property. It offers exactly what you want!


Or the prefix variables.

I have the following in a file called NamingConvention.cmake.

IF(MSVC)

IF(MSVC90)
SET(CMAKE_DEBUG_POSTFIX _d_2008)
SET(CMAKE_RELEASE_POSTFIX _2008)
SET(CMAKE_RELWITHDEBINFO_POSTFIX _2008)
ENDIF(MSVC90)

IF(MSVC80)
SET(CMAKE_DEBUG_POSTFIX _d_2005)
SET(CMAKE_RELEASE_POSTFIX _2005)
SET(CMAKE_RELWITHDEBINFO_POSTFIX _2005)
ENDIF(MSVC80)

IF(MSVC71)
SET(CMAKE_DEBUG_POSTFIX _d_2003)
SET(CMAKE_RELEASE_POSTFIX _2003)
SET(CMAKE_RELWITHDEBINFO_POSTFIX _2003)
ENDIF(MSVC71)

IF(MSVC70)
SET(CMAKE_DEBUG_POSTFIX _d_2002)
SET(CMAKE_RELEASE_POSTFIX _2002)
SET(CMAKE_RELWITHDEBINFO_POSTFIX _2002)
ENDIF(MSVC70)

IF(MSVC60)
SET(CMAKE_DEBUG_POSTFIX _d_vc6)
SET(CMAKE_RELEASE_POSTFIX _vc6)
SET(CMAKE_RELWITHDEBINFO_POSTFIX _vc6)
ENDIF(MSVC60)

#Name 64bit libaraies differenly
IF(CMAKE_SIZEOF_VOID_P MATCHES 8)
SET(CMAKE_DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX}_x64)
SET(CMAKE_RELEASE_POSTFIX ${CMAKE_RELEASE_POSTFIX}_x64)
SET(CMAKE_RELWITHDEBINFO_POSTFIX 
${CMAKE_RELWITHDEBINFO_POSTFIX}_x64)

IF(DETECT_64BIT_PORTABILITY)
SET(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} /Wp64)
ENDIF(DETECT_64BIT_PORTABILITY)
ENDIF(CMAKE_SIZEOF_VOID_P MATCHES 8)

ENDIF(MSVC)

To activate the naming convention for any of my projects I just call
include(CMake\NamingConvention.cmake) in the top of my CMakeLists.txt
and my libraries all have decorated names that distinguish between
compiler name and 32/64 bit. If I wanted I could spend 5 minutes and
add gcc and other defined compilers to this.

John
___
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] Help using CMake Expat in Windows

2010-07-30 Thread John Drescher
 I have created a very simple CMake file (I am a newbie) that works
 wonderfully in Linux, but am having problems in Windows.  The CMakeLists.txt
 is below

 #I think 2.6 is required for some of things I do below, but I am not sure
 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)

 # This is the CMake file for my application.  This
 # will be my first CMake file of decent size, so please excuse
 # any particularly bad syntax :)
 PROJECT(MyApp)
 FIND_PACKAGE(wxWidgets REQUIRED)
 FIND_PACKAGE(OpenCV REQUIRED)
 FIND_PACKAGE(EXPAT REQUIRED)
 INCLUDE (${wxWidgets_USE_FILE} ${OpenCV_USE_FILE} ${EXPAT_INCLUDE_DIRS})

 SET(Headers myApp.h myAppGUI.h myAppGUImpl.h Coordinates/Coordinates.h)
 SET(Src myApp.cpp myAppGUI.cpp myAppGUImpl.cpp Coordinates/Coordinates.cpp)
 ADD_EXECUTABLE(myApp ${Headers} ${Src})
 TARGET_LINK_LIBRARIES(myApp ${wxWidgets_LIBRARIES} ${OpenCV_LIBS}
 ${EXPAT_LIBRARIES})

 #End of code

 Everything works great in Linux, but when I try to use this in Windows, I
 have series of problems, all inter-related.

 Problem #1.  While wxWidgets and OpenCV work seamlessly, Cmake can't find
 the expat libraries.  (They are installed.  I installed the expat libraries
 using the basic windows download and install package).

CMake rarely finds libraries on windows. The main reason is there is
no OS standard path for libraries or header files. For me its even
less likely to find stuff since I build on X: and not the same drive
as the OS. To fix this normally you run cmake-gui and it tells me it
can not find a package set the projectname_dir variable. After setting
this variable in cmake-gui all is well.


 Problem #2.  While I can overcome problem #1 by hardcoding in where the
 expat include directory and library files are (setting the values in the
 CMake GUI), when I then open up the resulting solution in Visual Studio 2008
 Express and compile my code, the compiler gives the error can't find
 expat.h


That is normally the correct solution.


 Problem #3.  I can fix that problem as well by directly modifying the
 solution properties, but then when I run the project, it dies because it
 can't find libexpat.dll.

In your CMakeLists.txt have it copy the libexpat.dll to your debug,
release .. folder. Do that as a custom build step or an install step.

Here are two ways I do this for Qt libraries (modify this for libexpat):

The first uses an install.

IF (WIN32)
IF (GET_RUNTIME)
INSTALL(FILES
${QT_BINARY_DIR}/QtCored${QT_VERSION_MAJOR}.dll
${QT_BINARY_DIR}/QtXmld${QT_VERSION_MAJOR}.dll
${QT_BINARY_DIR}/QtTestd${QT_VERSION_MAJOR}.dll
${QT_BINARY_DIR}/QtGuid${QT_VERSION_MAJOR}.dll
${QT_BINARY_DIR}/QtNetworkd${QT_VERSION_MAJOR}.dll
${QT_BINARY_DIR}/QtScriptd${QT_VERSION_MAJOR}.dll
DESTINATION ${EXECUTABLE_OUTPUT_PATH}/Debug
)
INSTALL(FILES
${QT_BINARY_DIR}/QtCore${QT_VERSION_MAJOR}.dll
${QT_BINARY_DIR}/QtXml${QT_VERSION_MAJOR}.dll
${QT_BINARY_DIR}/QtTest${QT_VERSION_MAJOR}.dll
${QT_BINARY_DIR}/QtGui${QT_VERSION_MAJOR}.dll
${QT_BINARY_DIR}/QtNetwork${QT_VERSION_MAJOR}.dll
${QT_BINARY_DIR}/QtScript${QT_VERSION_MAJOR}.dll
DESTINATION ${EXECUTABLE_OUTPUT_PATH}/RelWithDebInfo
)
ENDIF(GET_RUNTIME)
ENDIF(WIN32)

The second uses a custom build step:

# Copy the needed Qt libraries into the Build directory. Also add installation
# and CPack code to support installer generation.
# this is a complete hack for Visual Studio to copy the Qt libraries.
if ( NOT Q_WS_MAC)
   if (DEFINED QT_QMAKE_EXECUTABLE)
   SET (QTLIBLIST QtCore QtGui)

   IF (MSVC)
   set(TYPE d)
   FOREACH(qtlib ${QTLIBLIST})
 IF (WIN32)
   GET_FILENAME_COMPONENT(QT_DLL_PATH_tmp
${QT_QMAKE_EXECUTABLE} PATH)
   file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/Debug)
   file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/Release)
   file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/MinSizeRel)
   file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/RelWithDebInfo)
   INSTALL(FILES ${QT_DLL_PATH_tmp}/${qtlib}${type}d4.dll
   DESTINATION ./
   CONFIGURATIONS Debug
   COMPONENT Applications)
   INSTALL(FILES ${QT_DLL_PATH_tmp}/${qtlib}4.dll
   DESTINATION ./
   CONFIGURATIONS Release
   COMPONENT Applications)
   add_custom_target(ZZ_${qtlib}-Debug-Copy ALL
   COMMAND ${CMAKE_COMMAND} -E
copy_if_different 
${QT_DLL_PATH_tmp}/${qtlib}${TYPE}4.dll
   ${PROJECT_BINARY_DIR}/Debug/
   COMMENT Copying ${qtlib}${TYPE}4.dll to
${PROJECT_BINARY_DIR}/Debug/)
   add_custom_target(ZZ_${qtlib}-Release-Copy ALL
   

Re: [CMake] FindQt4 QT_LIBRARIES

2010-07-29 Thread John Drescher
 Hello,I have looked at  FindQt4.cmake module for 2.8.2, but I can't find 
 the code that sets the QT_LIBRARIES variable.Could someone point that 
 out?Regards

It's in UseQt4.cmake.

HTH

Michael

 I am now trying to link against QT debug libariries in the RelWithDebInfo 
 cmake configuation case.
 However, it links against the QT release libs when I follow those lines of 
 help of FindQt4.cmake that describe the typical usage.
 This is the cmake code:
 FIND_PACKAGE(Qt4 4.5.3 COMPONENTS QtCore QtGui QtOpenGL REQUIRED)
 INCLUDE(${QT_USE_FILE})
 TARGET_LINK_LIBRARIES(main ${QT_LIBRARIES})

 1. when CMAKE_BUILD_TYPE is Release, vs2008 shows the release libs of qt
 2. when CMAKE_BUILD_TYPE is Debug, vs2008 shows the debug libs of qt
 3. However when CMAKE_BUILD_TYPE is RelWithDebInfo it picks the release qt 
 libs where I'd want to pick the debug qt libs. Outputting QT_LIBRARIES shows:
 optimized;C:/Qt/4.6.0/lib/QtOpenGL4.lib;debug;C:/Qt/4.6.0/lib/QtOpenGLd4.lib;optimized;C:/Qt/4.6.0/lib/QtGui4.lib;debug;C:/Qt/4.6.0/lib/QtGuid4.lib;optimized;C:/Qt/4.6.0/lib/QtCore4.lib;debug;C:/Qt/4.6.0/lib/QtCored4.lib


That will most likely cause your application to crash. You can not mix
debug and release crt. Well at least I spent days figuring out why my
simple qt dialog was crashing for no apparent reason. Then found that
one of the dependencies was causing a mix of debug and release libs.

John
___
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] FindQt4 QT_LIBRARIES

2010-07-29 Thread John Drescher
 It does crash currently with release libs for relwithdebingfo config. If I
 link against debug libs, it doesn't crash.
 The question is: when config is relwithdebingfo, how can I get
 TARGET_LINK_LIBRARIES to pick the debug version of the libs from
 QT_LIBRARIES?


I use Qt release libs with my RelWithDebInfo all the time (2+ years).
Since that is the only release build that I use with CMake.

I would use depends to verify what .dlls are being used. This one case
with a crash I believe I forgot to build 1 lib for RelWithDebInfo and
that ended up bringing in Qt debug.

John
___
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] [VS gen] Multiple configurations code

2010-07-26 Thread John Drescher
On Mon, Jul 26, 2010 at 1:00 PM, Olaf van der Spek olafvds...@gmail.com wrote:
 Hi,

 Where in the source code does the VS generator generate the multiple
 configurations?


I believe all of that is in the modules. Its actually pretty easy to
edit. I have modified this on my side several times to get CMake to
stop creating so many configurations that I would never use.

CMake 2.8\share\cmake-2.8\Modules\Platform

John
___
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] [VS gen] Multiple configurations code

2010-07-26 Thread John Drescher
On Mon, Jul 26, 2010 at 2:57 PM, Olaf van der Spek olafvds...@gmail.com wrote:
 On Mon, Jul 26, 2010 at 7:07 PM, David Cole david.c...@kitware.com wrote:
 grep for CMAKE_CONFIGURATION_TYPES

 I'm quite sure adding more configuration types here won't suffice.

 IF(NOT CMAKE_NO_BUILD_TYPE AND CMAKE_GENERATOR MATCHES Visual Studio)
  SET (CMAKE_NO_BUILD_TYPE 1)
  SET (CMAKE_CONFIGURATION_TYPES
 Debug;Release;MinSizeRel;RelWithDebInfo CACHE STRING
     Semicolon separated list of supported configuration types, only
 supports Debug, Release, MinSizeRel, and RelWithDebInfo, anything else
 will be ignored.)
  MARK_AS_ADVANCED(CMAKE_CONFIGURATION_TYPES)
 ENDIF(NOT CMAKE_NO_BUILD_TYPE AND CMAKE_GENERATOR MATCHES Visual Studio)


You need to add variables and such. I believe that is done in windows-cl.cmake

John
___
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] [VS gen] Multiple configurations code

2010-07-26 Thread John Drescher
On Mon, Jul 26, 2010 at 3:03 PM, Olaf van der Spek olafvds...@gmail.com wrote:
 On Mon, Jul 26, 2010 at 9:00 PM, John Drescher dresche...@gmail.com wrote:
 You need to add variables and such. I believe that is done in 
 windows-cl.cmake

 I'd like to generate both dynamic and static, x86 and x64 configs.
 CMake already knows how to build those, so it's not about adding
 variables for those.


I believe you still need to fill in the details for the new
configurations. Here is part of Windows-cl.cmake

SET (CMAKE_CXX_FLAGS_INIT /DWIN32 /D_WINDOWS /W3 /Zm1000 /EHsc /GR)
SET (CMAKE_CXX_FLAGS_DEBUG_INIT /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1)
SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT /MD /O1 /Ob1 /D NDEBUG)
SET (CMAKE_CXX_FLAGS_RELEASE_INIT /MD /O2 /Ob2 /D NDEBUG)
SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT /MD /Zi /O2 /Ob1 /D NDEBUG)

As for 64bit / 32 bit I do not think this is a simple modification to
allow 64bit and be 100% correct.

John
___
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] [VS gen] Multiple configurations code

2010-07-26 Thread John Drescher
On Mon, Jul 26, 2010 at 4:24 PM, Olaf van der Spek olafvds...@gmail.com wrote:
 On Mon, Jul 26, 2010 at 10:12 PM, David Cole david.c...@kitware.com wrote:
 Is there a problem with multiple configures / build trees?

 No, not at all. We do this all the time. But again, I thought from your
 questions that you were trying to do it all in one build tree.

 I'm not familiar with the term build tree.

 Let's describe what I'd like:
 I've got a single CMakeLists.txt for a lib named xbt. I've got xbt.h
 and xbt.cpp. I'm using VS (2010).
 With a few simple commands, I should be able to build and package all
 possible configurations of this lib.
 In the ideal case, this would be cmake ., nmake ... or similar.

 It should not be necessary to modify CMakeLists or to have multiple
 copies of the source.


You do not have multiple copies of the source. You have 1 copy of the
source that you build in multiple trees. For me I build 32 and 64 bit
for multiple compilers. They all share the same source tree but have
different build trees.

For example my source is in

X:\CmakeBased

My builds are in

X:\32bit\vs.71
X:\32bit\vs.80
X:\32bit\vs.90

X:\64bit\vs.80
X:\64bit\vs.90

For each build I need to open the appropriate project file in the build tree.

John
___
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] [VS gen] Multiple configurations code

2010-07-26 Thread John Drescher
On Mon, Jul 26, 2010 at 4:35 PM, Olaf van der Spek olafvds...@gmail.com wrote:
 On Mon, Jul 26, 2010 at 10:31 PM, John Drescher dresche...@gmail.com wrote:
 You do not have multiple copies of the source. You have 1 copy of the
 source that you build in multiple trees. For me I build 32 and 64 bit
 for multiple compilers. They all share the same source tree but have
 different build trees.

 For example my source is in

 X:\CmakeBased

 My builds are in

 X:\32bit\vs.71
 X:\32bit\vs.80
 X:\32bit\vs.90

 X:\64bit\vs.80
 X:\64bit\vs.90

 For each build I need to open the appropriate project file in the build tree.

 Isn't it easier to use the command line?
 If this is automated, it's not too bad.
 Does CMake provide a way to automate this?


I do a mix of both.

Additionally I have my projects generate a batch file in the build
tree called Batch\install.bat

calling that from a batch file for each dependent project causes all
projects to build and install and at the end I get a NSIS installer
for the main application.

John
___
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] [VS gen] Multiple configurations code

2010-07-26 Thread John Drescher
On Mon, Jul 26, 2010 at 4:42 PM, John Drescher dresche...@gmail.com wrote:
 On Mon, Jul 26, 2010 at 4:35 PM, Olaf van der Spek olafvds...@gmail.com 
 wrote:
 On Mon, Jul 26, 2010 at 10:31 PM, John Drescher dresche...@gmail.com wrote:
 You do not have multiple copies of the source. You have 1 copy of the
 source that you build in multiple trees. For me I build 32 and 64 bit
 for multiple compilers. They all share the same source tree but have
 different build trees.

 For example my source is in

 X:\CmakeBased

 My builds are in

 X:\32bit\vs.71
 X:\32bit\vs.80
 X:\32bit\vs.90

 X:\64bit\vs.80
 X:\64bit\vs.90

 For each build I need to open the appropriate project file in the build 
 tree.

 Isn't it easier to use the command line?
 If this is automated, it's not too bad.
 Does CMake provide a way to automate this?


 I do a mix of both.

 Additionally I have my projects generate a batch file in the build
 tree called Batch\install.bat

 calling that from a batch file for each dependent project causes all
 projects to build and install and at the end I get a NSIS installer
 for the main application.


Here is one such batch file.
X:\64bit\vc.90\install_la.bat

call Lung\CT_Imaging\Batch\install.bat
call Lung\BZ_Airway\Batch\install.bat
call Lung\SCP_LS\Batch\install.bat
call Lung\JPU_Lobe\Batch\install.bat
call Qt\QtbasicUtils\Batch\install.bat
call Qt\LungAnalysis\Batch\install.bat

This is the same exact file I use for the 32 bit build under vs.80 as
well. Since I used relative paths I just copied the batch file when I
wanted to build 64bit.

Note the build trees have the same structure as the source tree.

John

John
___
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] How to link against a .dll with cmake?

2010-07-24 Thread John Drescher
 I know that target_link_libraries can be used to link a .lib ,

 but how to link a .dll into the project?


You do not link against a .dll in windows ever.

John
___
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] How to link against a .dll with cmake?

2010-07-24 Thread John Drescher
 I know that target_link_libraries can be used to link a .lib ,

 but how to link a .dll into the project?


 You do not link against a .dll in windows ever.

When you create a .dll there is also a small import lib associated
with the dll. You link with that and when the application starts it
searches the path for each dll it needs.

John
___
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] Fwd: How to link against a .dll with cmake?

2010-07-24 Thread John Drescher
Maybe I am misunderstanding the question or response, but I regularly
link to .dll files using mingw.



On Sat, Jul 24, 2010 at 11:00 PM, John Drescher dresche...@gmail.com wrote:
 I know that target_link_libraries can be used to link a .lib ,

 but how to link a .dll into the project?


 You do not link against a .dll in windows ever.

 When you create a .dll there is also a small import lib associated
 with the dll. You link with that and when the application starts it
 searches the path for each dll it needs.

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




-- 
John M. Drescher
___
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] How to link against a .dll with cmake?

2010-07-24 Thread John Drescher
 mingw can link using a .dll


I do not have much mingw experience but I have around 15 of windows
and Visual Studio experience. With Visual Studio you absolutely do not
link your application with .dlls. You use import libs with a .lib
extension the same way you do with a static lib. This import lib is
not a static lib however its much smaller. During the application load
process .dlls linked using import libraries are automatically loaded.
This is not the only way to use .dlls you can use them also without
linking but there is much more work in that.

John
___
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] Windows library target names

2010-07-22 Thread John Drescher
 Shouldn't this be done automatically?

No way. Not all users would want that on all platforms that CMake
supports. Also it is very easy to add a single line to your
CMakeLists.txt file..

 What about shared vs static lib?
 Shared vs static runtime?
 x64 vs x86?

You can do all of that similarly with the possible exception of static
versus shared.


John
___
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] Windows library target names

2010-07-22 Thread John Drescher
 And then what? Having two DLLs with the same name is not going to
 work. Same for import or static libs.

It would work fine if the dlls for multiple configurations were not
all dumped in 1 folder. That is how I have used cmake for 2+ years.

John
___
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] Windows library target names

2010-07-22 Thread John Drescher
On Thu, Jul 22, 2010 at 4:43 PM, Olaf van der Spek olafvds...@gmail.com wrote:
 On Thu, Jul 22, 2010 at 10:41 PM, John Drescher dresche...@gmail.com wrote:
 And then what? Having two DLLs with the same name is not going to
 work. Same for import or static libs.

 It would work fine if the dlls for multiple configurations were not
 all dumped in 1 folder. That is how I have used cmake for 2+ years.

 How will the loader load the correct DLL if they've got the same name?


It loads the .dll in the path of the executable. Since the .dlls for
other configurations are not in the same path it finds the correct dll
and there is no conflict.

John M. Drescher
___
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] Windows library target names

2010-07-22 Thread John Drescher
   You _can_ very easily do this if you want. The code is out there in the
 wild in the form of macros that can be invoked from CMake that will set all
 of this up for you. You just have to look for it (or ask the right person...
 )


I do this for my shared libraries although I do not put them all in 1
folder. I add postfixes for debug and release and for compiler version
in windows since mixing compiler versions is not a good idea.

One example of this is:

IF(MSVC90)
SET(CMAKE_DEBUG_POSTFIX _d_2008)
SET(CMAKE_RELEASE_POSTFIX _2008)
SET(CMAKE_RELWITHDEBINFO_POSTFIX _2008)
ENDIF(MSVC90)

IF(MSVC80)
SET(CMAKE_DEBUG_POSTFIX _d_2005)
SET(CMAKE_RELEASE_POSTFIX _2005)
SET(CMAKE_RELWITHDEBINFO_POSTFIX _2005)
ENDIF(MSVC80)

IF(MSVC71)
SET(CMAKE_DEBUG_POSTFIX _d_2003)
SET(CMAKE_RELEASE_POSTFIX _2003)
SET(CMAKE_RELWITHDEBINFO_POSTFIX _2003)
ENDIF(MSVC71)

IF(MSVC70)
SET(CMAKE_DEBUG_POSTFIX _d_2002)
SET(CMAKE_RELEASE_POSTFIX _2002)
SET(CMAKE_RELWITHDEBINFO_POSTFIX _2002)
ENDIF(MSVC70)

IF(MSVC60)
SET(CMAKE_DEBUG_POSTFIX _d_vc6)
SET(CMAKE_RELEASE_POSTFIX _vc6)
SET(CMAKE_RELWITHDEBINFO_POSTFIX _vc6)
ENDIF(MSVC60)

And then I generate a USE file (using configure_file) for the project
that allows client applications to linking with the correct version
for each configuration configuration.

John
___
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] Windows library target names

2010-07-22 Thread John Drescher
 I'm on the other side of that one. I don't know how many _days_ I have
 wasted because I linked my debug version with a release version of something
 else and had the strangest errors and app crashes. After pulling my hair out
 trying to debug something that does not need to be debugged I finally
 remember that I forgot to swap out libraries. It was at that point where I
 wrote all my own CMake builds for each third party library I use and made
 sure each library was decorated with _debug so I knew I was linking against
 the proper library. Have not had a problem since.


I too had a nasty crash on one machine that I wasted days debugging.
This was until I saw that QtCore and QtCored were both being loaded.
After figuring out what was causing this the problem was easily solved
and no crashes since..

John
___
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] [vtkusers] How to specify the path to VTK in CMake?

2010-07-21 Thread John Drescher
On Wed, Jul 21, 2010 at 10:45 AM, Michael Xanadu
xanadu.mich...@googlemail.com wrote:
 Hi Zack,

 there's no VTK_DIR row in my CMake GUI. That's my problem. ;-)


Do you have the advanced option selected in the cmake-gui?

John
___
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 + UIC files -- Is this a bug with CMake or with me?

2010-07-20 Thread John Drescher
On Tue, Jul 20, 2010 at 2:48 PM, Andreas Pakulat ap...@gmx.de wrote:
 On 20.07.10 13:30:51, kent williams wrote:
 Let's try that again http://www.cornwarning.com/xfer/QTCmakeTest.tar.gz

 Still the same.

Same here. I get a cute image that says Sorry Sam, I can't seem to
find that URL.

John
___
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 + UIC files -- Is this a bug with CMake or with me?

2010-07-20 Thread John Drescher
On Tue, Jul 20, 2010 at 4:09 PM, kent williams
nkwmailingli...@gmail.com wrote:
 Thanks.  I don't know if you've actually tried the project I put up to
 illustrate the project, but while what you say makes sense, it doesn't
 appear to fix the problem.

 It's frustrating for me; apparently, though I'm following exactly the
 pattern that's reputed to work, CMake isn't generating the Makefile
 code to deal with the second .ui file.

 Either there's something wrong in CMake, or I'm somehow missing
 something in what should be a really simple CMakeLists.txt.


I do not do globbing. I just add the result of QT4_WRAP_UI to my target


SET( ${PROJECT_NAME}_SRCS
./src/main.cxx
./src/mainwindow.cxx
./src/textwidget.cxx
./src/upmcLungApp.cxx
./src/AppSettingsDlg.cxx
./src/laFileMenu.cxx
  )

SET( ${PROJECT_NAME}_MOC_HDR
./Include/mainwindow.h
./Include/textwidget.h
./Include/upmcLungApp.h
./Include/AppSettingsDlg.h
./Include/laFileMenu.h
)

SET( ${PROJECT_NAME}_HDRS
./Include/ClickedPointEvent.h
./Include/${PROJECT_NAME}Constants.h
./Include/sliceOrientation.h
)

#

MSVC_PCH_SUPPORT(${PROJECT_NAME})

# some .ui files
SET( ${PROJECT_NAME}_UIS
./rc/AppSettings.ui
)

# and finally an resource file
SET( ${PROJECT_NAME}_RCS
./rc/${PROJECT_NAME}.qrc
)

# this command will generate rules that will run rcc on all files from
${PROJECT_NAME}_RCS
# in result ${PROJECT_NAME}_RC_SRCS variable will contain paths to
files produced by rcc
QT4_ADD_RESOURCES( ${PROJECT_NAME}_RC_SRCS ${${PROJECT_NAME}_RCS} )

# and finally this will run moc:
QT4_WRAP_CPP( ${PROJECT_NAME}_MOC_SRCS ${${PROJECT_NAME}_MOC_HDR} )

# this will run uic on .ui files:
QT4_WRAP_UI( ${PROJECT_NAME}_UI_HDRS ${${PROJECT_NAME}_UIS} )

SOURCE_GROUP(Generated FILES
  ${${PROJECT_NAME}_RC_SRCS}
  ${${PROJECT_NAME}_MOC_SRCS}
  ${${PROJECT_NAME}_UI_HDRS}
)

SOURCE_GROUP(Resources FILES
  ${${PROJECT_NAME}_UIS}
  ${${PROJECT_NAME}_RCS}
)

#


ADD_EXECUTABLE( ${PROJECT_NAME} ${${PROJECT_NAME}_SRCS}
${${PROJECT_NAME}_MOC_SRCS} ${${PROJECT_NAME}_HDRS}
${${PROJECT_NAME}_MOC_HDR} ${${PROJECT_NAME}_RC_SRCS}
${${PROJECT_NAME}_UI_HDRS}
)


Right now I am doing all of my development in Visual Studio. In the
past this project did build under linux.

John
___
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] Fwd: How to add a lib in a target/tool independent way?

2010-07-20 Thread John Drescher
On Tue, Jul 20, 2010 at 5:24 PM, Claus Klein claus.kl...@arcormail.de wrote:
 I have a cpp project with some lib targets and executables, which depends on
 the libs and the header files.
 I want to link the libs from my build/src tree and not the installed
 versions.

 With this snip below from my CMakeFile.txt it works on my MacBook and cygwin
 after a make clean,
 but with MVS2005, it will always try to link the desD.lib and not the
 desD.dll?

This is correct. It should be linking the .lib and not the .dll. The
.lib is an import library which is needed to use the .dll

John



-- 
John M. Drescher
___
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.2 win32: invalid escape sequence when finding fortran compiler

2010-07-14 Thread John Drescher
On Wed, Jul 14, 2010 at 10:16 AM, Verweij, Arjen verwe...@tass-safe.com wrote:

 Hi,



 I’m trying a little F90 example on Windows with cmake. Apparently something 
 is amiss, but I can’t find much on Google about it; at least not about this 
 particular case.



 All I do is cmake ..\f90example and the following appears in my terminal:



 S:\mnt\usr3\people\verweija\buildcmake ..\f90example

 -- Building for: Visual Studio 7 .NET 2003

 -- Check for working C compiler using: Visual Studio 7 .NET 2003

 -- Check for working C compiler using: Visual Studio 7 .NET 2003 -- works

 -- Detecting C compiler ABI info

 -- Detecting C compiler ABI info - done

 -- Check for working CXX compiler using: Visual Studio 7 .NET 2003

 -- Check for working CXX compiler using: Visual Studio 7 .NET 2003 -- works

 -- Detecting CXX compiler ABI info

 -- Detecting CXX compiler ABI info - done

 -- Check for working Fortran compiler using: Visual Studio 7 .NET 2003

 CMake Error at CMakeLists.txt:4 (SET):

   Syntax error in cmake code at



     S:/mnt/usr3/people/verweija/build/CMakeFiles/CMakeTmp/CMakeLists.txt:4



   when parsing string



     C:\Program



   Invalid escape sequence \P





 CMake Error at CMakeLists.txt:4 (SET):

   Syntax error in cmake code at



     S:/mnt/usr3/people/verweija/build/CMakeFiles/CMakeTmp/CMakeLists.txt:4



   when parsing string



     Files\VNI\CTT5.0\include\IA32 /fpe:3 /nologo   ${COMPILE_DEFINITIONS}



   Invalid escape sequence \V





 CMake Error: Internal CMake error, TryCompile configure of cmake failed

 -- Configuring incomplete, errors occurred!



 Please advise J


You seem to have a path using \ instead of /

John
___
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.2 win32: invalid escape sequence when finding fortran compiler

2010-07-14 Thread John Drescher
On Wed, Jul 14, 2010 at 11:15 AM, Verweij, Arjen verwe...@tass-safe.com wrote:
 Hi,


You seem to have a path using \ instead of /


 Isn't that to be expected of a PATH setting on a Windows computer?
 Anyway, the path to the Visual Studio compiler is of the same format and 
 cmake deals with it just fine.


I use / for all paths inside my CMakeLists.txt files even on windows
computers. If I am grabbing paths from the environment I use a string
replace in the CMakeLists.txt

string (REPLACE \\ / PGM_FILES $ENV{PROGRAMFILES})

John
___
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.2 win32: invalid escape sequence when finding fortran compiler

2010-07-14 Thread John Drescher
 Be careful with your use of $ENV{PROGRAMFILES} - it might not give you what
 you expect on a 64-bit computer. Since the CMake binary is by default
 32-bit, you need some logic to make sure you're looking where you think
 you're looking.


I had that covered. I just shortened the example not to confuse the OP.

IF(CMAKE_SIZEOF_VOID_P MATCHES 4)
string (REPLACE \\ / PGM_FILES $ENV{PROGRAMFILES})
ELSE(CMAKE_SIZEOF_VOID_P MATCHES 4)
# On WIN64 use the 64 bit program files..
string (REPLACE \\ / PGM_FILES $ENV{ProgramW6432})
ENDIF(CMAKE_SIZEOF_VOID_P MATCHES 4)

John
___
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] Building a Version Header

2010-07-07 Thread John Drescher
On Wed, Jul 7, 2010 at 9:44 PM, Clark Gaebel cg.wowus...@gmail.com wrote:
 I would like to generate file that looks something like this:

    // version.h
    #define VERSION v0.1-345-ga77ede8

 where the version string is the result of running git describe --tags
 --dirty. How can I auto-generate this file, include it in my project,
 and have it regenerate as a pre-build event?


You want to do that with configure_file

The following is an example that grabs the subversion rev and puts
that into a version header file.

In CMakeLists.txt for the LungAnalysis project

set (${PROJECT_NAME}_VERSION_MAJOR 0)
set (${PROJECT_NAME}_VERSION_MINOR 25)
set (${PROJECT_NAME}_VERSION_PATCH 3)

FIND_PACKAGE(Subversion)
IF(Subversion_FOUND)
#Use the FindSubversion.cmake module to get the svn rev and append
that to the patch version.
Subversion_WC_INFO(${PROJECT_SOURCE_DIR} Project)
MESSAGE(Current revision is ${Project_WC_REVISION})
Subversion_WC_LOG(${PROJECT_SOURCE_DIR} Project)
MESSAGE(Last changed log is ${Project_LAST_CHANGED_LOG})

set (${PROJECT_NAME}_VERSION_PATCH
${${PROJECT_NAME}_VERSION_PATCH}.${Project_WC_REVISION})

ENDIF(Subversion_FOUND)

configure_file (
${PROJECT_SOURCE_DIR}/${PROJECT_NAME}Config.h.in
${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.h
)

LungAnalysisConfig.h.in:
//The configured settings for the project
#define LungAnalysis_VERSION_MAJOR @LungAnalysis_VERSION_MAJOR@
#define LungAnalysis_VERSION_MINOR @LungAnalysis_VERSION_MINOR@
#define LungAnalysis_VERSION_PATCH @LungAnalysis_VERSION_PATCH@


So then in the binary folder the LungAnalysisConfig.h will look like

#define LungAnalysis_VERSION_MAJOR 0
#define LungAnalysis_VERSION_MINOR 25
#define LungAnalysis_VERSION_PATCH 3.903

for svn revision 903

John
___
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] Building a Version Header

2010-07-07 Thread John Drescher
 1) I'm using git

I know. You have some work to do..
On top of the minor differences in what you want the FindGIt.cmake
does not have that option to return the version so you need to adapt
it to get the git version similar to the way the FindSubversion.cmake
module does for subversion repositories.

 2) If it outputs to the build directory, how do I refer to it?

You can include files from your build folder in your project.

Just add
include_directories(${PROJECT_BINARY_DIR})

in your CMakeLists.txt

then use the header as you would any other header in your project.
John
___
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] Building a Version Header

2010-07-07 Thread John Drescher
On Wed, Jul 7, 2010 at 10:59 PM, Clark Gaebel cg.wowus...@gmail.com wrote:
 Is there any way I can use the output from a command-line program (in
 this case, git describe --dirty) instead of using FindGit?


I believe
add_custom_command

but I can not help with an example of that.

John
___
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] Building a Version Header

2010-07-07 Thread John Drescher
On Wed, Jul 7, 2010 at 11:04 PM, John Drescher dresche...@gmail.com wrote:
 On Wed, Jul 7, 2010 at 10:59 PM, Clark Gaebel cg.wowus...@gmail.com wrote:
 Is there any way I can use the output from a command-line program (in
 this case, git describe --dirty) instead of using FindGit?


 I believe
 add_custom_command

 but I can not help with an example of that.

When looking at the source for FindSubversion.cmake this looks pretty
easy to modify. I guess you can put the Macro code inside your
CMakeLists.txt if you do not want to mess with Findgit.cmake.

MACRO(Subversion_WC_INFO dir prefix)
# the subversion commands should be executed with the C locale, otherwise
# the message (which are parsed) may be translated, Alex
SET(_Subversion_SAVED_LC_ALL $ENV{LC_ALL})
SET(ENV{LC_ALL} C)

EXECUTE_PROCESS(COMMAND ${Subversion_SVN_EXECUTABLE} --version
  WORKING_DIRECTORY ${dir}
  OUTPUT_VARIABLE Subversion_VERSION_SVN
  OUTPUT_STRIP_TRAILING_WHITESPACE)

EXECUTE_PROCESS(COMMAND ${Subversion_SVN_EXECUTABLE} info ${dir}
  OUTPUT_VARIABLE ${prefix}_WC_INFO
  ERROR_VARIABLE Subversion_svn_info_error
  RESULT_VARIABLE Subversion_svn_info_result
  OUTPUT_STRIP_TRAILING_WHITESPACE)

IF(NOT ${Subversion_svn_info_result} EQUAL 0)
  MESSAGE(SEND_ERROR Command \${Subversion_SVN_EXECUTABLE} info
${dir}\ failed with output:\n${Subversion_svn_info_error})
ELSE(NOT ${Subversion_svn_info_result} EQUAL 0)

  STRING(REGEX REPLACE ^(.*\n)?svn, version ([.0-9]+).*
\\2 Subversion_VERSION_SVN ${Subversion_VERSION_SVN})
  STRING(REGEX REPLACE ^(.*\n)?URL: ([^\n]+).*
\\2 ${prefix}_WC_URL ${${prefix}_WC_INFO})
  STRING(REGEX REPLACE ^(.*\n)?Revision: ([^\n]+).*
\\2 ${prefix}_WC_REVISION ${${prefix}_WC_INFO})
  STRING(REGEX REPLACE ^(.*\n)?Last Changed Author: ([^\n]+).*
\\2 ${prefix}_WC_LAST_CHANGED_AUTHOR ${${prefix}_WC_INFO})
  STRING(REGEX REPLACE ^(.*\n)?Last Changed Rev: ([^\n]+).*
\\2 ${prefix}_WC_LAST_CHANGED_REV ${${prefix}_WC_INFO})
  STRING(REGEX REPLACE ^(.*\n)?Last Changed Date: ([^\n]+).*
\\2 ${prefix}_WC_LAST_CHANGED_DATE ${${prefix}_WC_INFO})

ENDIF(NOT ${Subversion_svn_info_result} EQUAL 0)

# restore the previous LC_ALL
SET(ENV{LC_ALL} ${_Subversion_SAVED_LC_ALL})

  ENDMACRO(Subversion_WC_INFO)


All the work you need is in the EXECUTE_PROCESS. Replace the
subversion commands with git commands and fixup the output.

John
___
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] Building a Version Header

2010-07-07 Thread John Drescher
On Wed, Jul 7, 2010 at 11:43 PM, Clark Gaebel cg.wowus...@gmail.com wrote:
 Okay, I've almost got it. How do I make configure_file generate
 something like...

 source:
 #cmakedefine VERSION


Some thing like

Version.h.in
#define VERSION @PROJECT_VERSION@


Try to look at my first example for usage.

John
___
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] Building a Version Header

2010-07-07 Thread John Drescher
 Nice. that works. I'm so sorry to be such a bother, but here's my output
 now...

 #define PROJECT_VERSION v0.1-345-ga77ede8-dirty
 

 Needless to say, that's bad :(

 How would I go about removing that trailing newline?


STRING(REGEX REPLACE

on the PROJECT_VERSION in your CMakeLists.txt

there are examples of that command in the Macro I posted a few emails
ago. If you get stuck I will try to figure that out.

John
___
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] Building a Version Header

2010-07-07 Thread John Drescher
On Wed, Jul 7, 2010 at 11:58 PM, John Drescher dresche...@gmail.com wrote:
 Nice. that works. I'm so sorry to be such a bother, but here's my output
 now...

 #define PROJECT_VERSION v0.1-345-ga77ede8-dirty
 

 Needless to say, that's bad :(

 How would I go about removing that trailing newline?



Wait a minute did you use

OUTPUT_STRIP_TRAILING_WHITESPACE

in your

EXECUTE_PROCESS

?

John
___
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] Upgraded to cmake-2.8.2 on windows7 and now it will not work

2010-07-06 Thread John Drescher
I was using 2.8.1 and previous cmake versions for a long time without
any problems. Also 2.8.2 works for the same project on 64 bin xp.

CMake Error: CMake was unable to find a build program corresponding to
Visual Studio 8 2005.  CMAKE_MAKE_PROGRAM is not set.  You probably
need to select a different build tool.
CMake Error: Could not find cmake module file://Radimgws68/c$/Program
Files (x86)/CMake
2.8/share/cmake-2.8/Modules/CMakeDetermineCCompiler.cmake
CMake Error: Could not find cmake module
file:X:/32Bit/VC.80/Qt/LungAnalysis/CMakeFiles/CMakeCCompiler.cmake
CMake Error: Could not find cmake module file://Radimgws68/c$/Program
Files (x86)/CMake
2.8/share/cmake-2.8/Modules/CMakeDetermineCXXCompiler.cmake
CMake Error: Could not find cmake module
file:X:/32Bit/VC.80/Qt/LungAnalysis/CMakeFiles/CMakeCXXCompiler.cmake
CMake Error: Could not find cmake module file://Radimgws68/c$/Program
Files (x86)/CMake
2.8/share/cmake-2.8/Modules/CMakeSystemSpecificInformation.cmake
CMake Error: Could not process cmake module
file://Radimgws68/c$/Program Files (x86)/CMake
2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake
CMake Error: Could not process cmake module
file://Radimgws68/c$/Program Files (x86)/CMake
2.8/share/cmake-2.8/Modules/CMakeCXXInformation.cmake
Configuring incomplete, errors occurred!

-- 
John M. Drescher
___
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] Upgraded to cmake-2.8.2 on windows7 and now it will not work

2010-07-06 Thread John Drescher
On Tue, Jul 6, 2010 at 12:50 PM, John Drescher dresche...@gmail.com wrote:
 I was using 2.8.1 and previous cmake versions for a long time without
 any problems. Also 2.8.2 works for the same project on 64 bin xp.

 CMake Error: CMake was unable to find a build program corresponding to
 Visual Studio 8 2005.  CMAKE_MAKE_PROGRAM is not set.  You probably
 need to select a different build tool.
 CMake Error: Could not find cmake module file://Radimgws68/c$/Program
 Files (x86)/CMake
 2.8/share/cmake-2.8/Modules/CMakeDetermineCCompiler.cmake
 CMake Error: Could not find cmake module
 file:X:/32Bit/VC.80/Qt/LungAnalysis/CMakeFiles/CMakeCCompiler.cmake
 CMake Error: Could not find cmake module file://Radimgws68/c$/Program
 Files (x86)/CMake
 2.8/share/cmake-2.8/Modules/CMakeDetermineCXXCompiler.cmake
 CMake Error: Could not find cmake module
 file:X:/32Bit/VC.80/Qt/LungAnalysis/CMakeFiles/CMakeCXXCompiler.cmake
 CMake Error: Could not find cmake module file://Radimgws68/c$/Program
 Files (x86)/CMake
 2.8/share/cmake-2.8/Modules/CMakeSystemSpecificInformation.cmake
 CMake Error: Could not process cmake module
 file://Radimgws68/c$/Program Files (x86)/CMake
 2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake
 CMake Error: Could not process cmake module
 file://Radimgws68/c$/Program Files (x86)/CMake
 2.8/share/cmake-2.8/Modules/CMakeCXXInformation.cmake
 Configuring incomplete, errors occurred!

 --

Okay, this is weird. If I execute cmake-gui from C:\Program Files
(x86)\CMake 2.8\bin it seems to work but the link on my desktop fails.
I will look into this.

John
___
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] Different configurations with Visual Studio

2010-07-05 Thread John Drescher
 I see, thanks. I intend to write a Python script that adds the extra
 platform solution, because we really need that. Visual Studio and
 Code::Blocks project files are XML files, so it shouldn't be too hard.


What is wrong with different build folders for each compiler / ide?

John
___
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] Generating a combined x86 and x64 Visual Studio project

2010-07-01 Thread John Drescher
 I have recently created a CMake project that I use to generate Visual Studio
 solutions/projects and it works perfectly with one exception.



 After generating a Visual Studio 9 2008 Win64 solution, the solution
 contains only the x64 build specification.  Is it possible to have CMake add
 the win32 build specification to the same solution or must one generate
 separate 32-bit and 64-bit solutions/projects in different directories?


I believe generating the solutions out of source with different build
folders is the only good way at the moment.

John
___
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] One last try

2010-06-21 Thread John Drescher
 1. Is cmake supposed to support Visual Studio 2008 out of the box?

Yes and it works well. I use this combination every day for the last 2 years.

John
___
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] One last try

2010-06-21 Thread John Drescher
On Mon, Jun 21, 2010 at 9:59 AM, Gerry Weaver ger...@compvia.com wrote:
 Hello All,
 Thank you for your replies.
 The cmake command fails when trying to compile the test file. It says it
 cannot find kernel32.lib. I can compile and link without cmake just fine.
 Any ideas?
 Thanks,
 -G

Try running the build and cmake-gui inside a Visual Studio 2008 Command Prompt

John
___
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] [vtkusers] VTK 5.6.0 Cmake Errors

2010-06-17 Thread John Drescher
On Thu, Jun 17, 2010 at 3:16 PM, Scott Johnson
scott.john...@neuwave.com wrote:
 On a whim I totally changed the path to a different drive and naming 
 structure and tried again.  I was able to fully configure and generate the 
 solution.  Even after I set the options I was originally trying.

 I'm not sure where it was picking up the invalid path, but it's gone now.


Is this a network path without short filename support?

John
___
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] Building multiple releases for a visual studio project

2010-06-08 Thread John Drescher
On Tue, Jun 8, 2010 at 2:52 PM, Torri, Stephen CIV NSWCDD, W15
stephen.to...@navy.mil wrote:
 I was wondering if it was possible to have a CMake project that builds a 
 Microsoft Visual Studio Project produce an NSIS installer for each kind of 
 build (e.g. debug, release, RelWithDebug). Right now I can build the project 
 via Visual Studio for all the build types which is great. Now I would like to 
 have one NSIS installer for each type. Is that possible?


Copy the package then switch the build type in visual studio and then
run package. The file overwrites the previous nsis package with the
same name but I am pretty sure it builds for the current
configuration.

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


<    1   2   3   4   5   6   >