Re: [CMake] CMake hidden files
I tried to install PV on Windows XP with MinGV, without any success. So I decided to go with Visual Studio 10 Express, installed it, selected it as a generator, etc But I get an error message, something like it seems that you try to build on VS with Qt built on MinGW. Ok, right, so I installed a pre-compiled Qt for Windows distribution, That should cause you problems. Qt must be compiled by the same compiler you use. And I believe the precompiled Qt was for vs2008. I have found, windows or linux, usually not a good idea to 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] Linking error with VS2005
On Fri, May 21, 2010 at 8:01 AM, Daanen Vincent daa...@koelis.com wrote: Dear Cmake users, I'm facing to a problem I can't resolve. I'm developping on a windows XP SP3 box with Visual Studio 2005. I have a project using itk which compile fine. For some reason, I try to use cmake to generate the same project and I got linker error (conflict between msvcrtd.lib and libcmtd.lib) - I check that the librairies are declared in the same order in both project and it's ok - Try to ignore either msvcrtd.lib or libcmtd.lib but I does not work : other linker errors appear. I could not find what is specifically added by cmake so that the cmake-generated project fails to build the binray whereas the manually-generated project file succeeds... Is there someone who could help me ? Can you post the exact error. Are all libraries in your project (including itk) compiled by the same compiler version? 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] Linking error with VS2005
On Fri, May 21, 2010 at 10:17 AM, Daanen Vincent daa...@koelis.com wrote: Hello, Can you post the exact error. I would say that these errors are the well-known linker errors about libcmt and msvcrt msvcrtd.lib(ti_inst.obj) : error LNK2005: private: __thiscall type_info::type_info(class type_info const ) (??0type_info@@a...@abv0@@Z) déjà défini(e) dans libcmtd.lib(typinfo.obj) msvcrtd.lib(ti_inst.obj) : error LNK2005: private: class type_info __thiscall type_info::operator=(class type_info const ) (??4type_info@@aaea...@abv0@@Z) déjà défini(e) dans libcmtd.lib(typinfo.obj) msvcrtd.lib(MSVCR80D.dll) : error LNK2005: _sprintf déjà défini(e) dans libcmtd.lib(sprintf.obj) msvcrtd.lib(MSVCR80D.dll) : error LNK2005: _tolower déjà défini(e) dans libcmtd.lib(tolower.obj) msvcrtd.lib(MSVCR80D.dll) : error LNK2005: _printf déjà défini(e) dans libcmtd.lib(printf.obj) msvcrtd.lib(MSVCR80D.dll) : error LNK2005: _malloc déjà défini(e) dans libcmtd.lib(dbgheap.obj) msvcrtd.lib(MSVCR80D.dll) : error LNK2005: _realloc déjà défini(e) dans libcmtd.lib(dbgheap.obj) msvcrtd.lib(MSVCR80D.dll) : error LNK2005: _free déjà défini(e) dans libcmtd.lib(dbgheap.obj) msvcrtd.lib(MSVCR80D.dll) : error LNK2005: _fprintf déjà défini(e) dans libcmtd.lib(fprintf.obj) msvcrtd.lib(MSVCR80D.dll) : error LNK2005: _fclose déjà défini(e) dans libcmtd.lib(fclose.obj) msvcrtd.lib(MSVCR80D.dll) : error LNK2005: _floor déjà défini(e) dans libcmtd.lib(floor_pentium4.obj) msvcrtd.lib(MSVCR80D.dll) : error LNK2005: _fopen déjà défini(e) dans libcmtd.lib(fopen.obj) Are all libraries in your project (including itk) compiled by the same compiler version? Yes, all my libs and application are built with VS2005 compiler V -Message d'origine- De : John Drescher [mailto:dresche...@gmail.com] Envoyé : vendredi 21 mai 2010 14:29 À : Daanen Vincent Cc : cmake@cmake.org Objet : Re: [CMake] Linking error with VS2005 On Fri, May 21, 2010 at 8:01 AM, Daanen Vincent daa...@koelis.com wrote: Dear Cmake users, I'm facing to a problem I can't resolve. I'm developping on a windows XP SP3 box with Visual Studio 2005. I have a project using itk which compile fine. For some reason, I try to use cmake to generate the same project and I got linker error (conflict between msvcrtd.lib and libcmtd.lib) - I check that the librairies are declared in the same order in both project and it's ok - Try to ignore either msvcrtd.lib or libcmtd.lib but I does not work : other linker errors appear. I could not find what is specifically added by cmake so that the cmake-generated project fails to build the binray whereas the manually-generated project file succeeds... Is there someone who could help me ? Can you post the exact error. Are all libraries in your project (including itk) compiled by the same compiler version? 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] Newbie: Building multiple configurations (x86/x64, MSVC/MinGW-W64, etc.)
On Fri, May 7, 2010 at 11:53 AM, Alok Govil alokgo...@hotmail.com wrote: Hi all, I am trying to use CMake to build my code under multiple configurations: 1. x86 and x64 2. MSVC various versions and MinGW-W64 mainly 3. Debug and release (optional) In each case I would like to link the code with a corresponding pre-compiled version of UnitTest++. (There is always an option to include UnitTest++ as a target into the project, but I do not see the point in building UnitTest++ on each run and for each project where UnitTest++ is used. Please let me know if the direction I am taking here is not correct.) The case for MinGW-W64 seems to be more involved since they have two separate toolchains for x86 and x64. How would I even write CMakeLists.txt for these two such that correct paths to x86 and x64 bin folders is recognized? Another thing I would like to do is to specify folders where the output binaries are created using EXECUTABLE_OUTPUT_PATH and LIBRARY_OUTPUT_PATH. This would again be based on the configuration used (MinGW-64 vs. MSVC, and x86 vs. x64) I have looked into the following, but have not been able to figure it all out as yet: From: http://www.elpauer.org/stuff/learning_cmake.pdf TARGET_LINK_LIBRARIES(wakeup RELEASE ${wakeup_SRCS}) TARGET_LINK_LIBRARIES(wakeupd DEBUG ${wakeup_SRCS}) Notes: - This allows specifying different libraries for debug and release, but there does not seem to be an option to use the same method to specify different libraries for x86 vs. x64. From: http://www.cmake.org/pipermail/cmake/2009-June/030072.html # check 64 bit if( CMAKE_SIZEOF_VOID_P EQUALS 4 ) set( HAVE_64_BIT 0 ) else() set( HAVE_64_BIT 1 ) endif() Thanks, You really should not be using the same binary folder for all these different configurations. Use 1 binary folder tree for each build. Or in the case of a multi-configuration generator like visual studio you use 1 binary folder per architecture. Also separate compiler versions in separate build trees since they build incompatible binaries. 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] Is there really any cmake support?
On Sun, Apr 4, 2010 at 5:30 AM, Fred Fred stan1...@hotmail.fr wrote: You are right! Actually I have been confusing with MinGW and Cygwin and I realized that I just need MinGW because I need to compile my plugins on Windows, and MinGW would allow me to generate native Windows dlls, whereas Cygwin would require to add specific dlls to make the generated dll working. So I deleted my Cygwin install and use only MinGW tools. I managed to ccmake the application and started make. But after 79% of the building has been completed, an error occurred: while trying to compile vtkQtView, the included file vtkView.h is not found. I did not find out how to specify a good path, so I tried to copy all the .h files in the Views directory into the GUISupport/Qt directory but as expected the compilation works but there are errors at the link stage. So which mistake did I do? Can you post your 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] Is there really any cmake support?
Which one? I just found a single CMakeLists.txt file in the build hierarchy, actually located in ./VTK/CMakeTmp/TestExplicitInstantiation/CMakeLists.txt, but I suppose you speak about another one. Do you mean a CMakeLists.txt located in the source hierarchy??? From your answer it looks like you are not building your own code which I thought when I read your last reply but vtk. Are you building VTK? 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] CXX incorrectly includes CMakeFortranInformation.cmake for MinGW/MSYS/Wine
On Sun, Apr 4, 2010 at 7:16 PM, Alan W. Irwin ir...@beluga.phys.uvic.ca wrote: Clint (with an old version of MinGW) and I (with MinGW-4.5) have been running into a peculiar CXX error for MinGW/MSYS on Wine. Enabling C++ _sometimes_ fails because it includes CMakeFortranInformation.cmake (why?) which then leads to a get_filename_component called with incorrect number of arguments I had this same problem under wine and using vc2005. I believe the issue is caused by wine pulling in at least some of environment variables from the linux system. The weird thing is this error only occurred with some of my projects. To get around this temporarily disabled the fortran module. 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 target_link_libraries
ADD_EXECUTABLE(tiney ${program_SRCS}) TARGET_LINK_LIBRARIES(program ${program_LIBS}) Are these the exact 2 lines? I mean you have tiney in one and program in the other? 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] MSVC and different link_directories for release and debug
On Wed, Mar 24, 2010 at 1:42 PM, Michael Schildt michael.schi...@ifn-magdeburg.de wrote: Hello, I use GDCM libaries in one project. Unfurtunally, i couldn't find a findGDCM module and i'm not experienced enough to write one. I have seen that GDCM is used in ITK, so there must be a module like this. GDCM is using cmake too, so inclusion should be easy. But i have problems to link the correkt library version depending on the configuration type. IF(WIN32) INCLUDE_DIRECTORIES(C:/Programme/GDCM\ 2.0/include/gdcm-2.0) IF(CMAKE_BUILD_TYPE MATCHES Debug) LINK_DIRECTORIES(C:/Program Files/GDCM/bin/Debug) ELSE(CMAKE_BUILD_TYPE MATCHES Debug) LINK_DIRECTORIES(C:/Program Files/GDCM/bin/Release) ENDIF(CMAKE_BUILD_TYPE MATCHES Debug) SET(GDCM_LIBRARIES gdcmcharls.lib gdcmCommon.lib gdcmDICT.lib gdcmDSED.lib gdcmexpat.lib gdcmgetopt.lib gdcmIOD.lib gdcmjpeg8.lib gdcmjpeg12.lib gdcmjpeg16.lib gdcmMSFF.lib gdcmopenjpeg.lib gdcmzlib.lib) ELSE(WIN32) # Linux INCLUDE_DIRECTORIES(/usr/include/gdcm-2.0) SET(GDCM_LIBRARIES gdcmCommon gdcmDICT gdcmDSED gdcmIOD gdcmjpeg8 gdcmjpeg12 gdcmjpeg16 gdcmMSFF) ENDIF(WIN32) He always includes the Relase Directory. What is a solution for this issue? Build GDCM from source and it will have the necessary finders. Do not INSTALL. Then the usual in your CMakeLists.txt file. Here is an example. CMakeLists.txt cmake_minimum_required(VERSION 2.6) PROJECT(GDCMImageViewer) FIND_PACKAGE(VTK REQUIRED) INCLUDE(${VTK_USE_FILE}) FIND_PACKAGE(GDCM REQUIRED) INCLUDE(${GDCM_USE_FILE}) INCLUDE_DIRECTORIES( ${GDCM_SOURCE_DIR}/Utilities/VTK ) IF(WIN32 AND NOT CYGWIN) ADD_SUBDIRECTORY(getopt) INCLUDE_DIRECTORIES(getopt) ENDIF(WIN32 AND NOT CYGWIN) ADD_EXECUTABLE(GDCMImageViewer gdcmviewer.cxx) TARGET_LINK_LIBRARIES(GDCMImageViewer vtkHybrid vtkInfovis vtkWidgets vtkgdcm getopt) 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] MSVC and different link_directories for release and debug
On Wed, Mar 24, 2010 at 2:10 PM, John Drescher dresche...@gmail.com wrote: On Wed, Mar 24, 2010 at 1:42 PM, Michael Schildt michael.schi...@ifn-magdeburg.de wrote: Hello, I use GDCM libaries in one project. Unfurtunally, i couldn't find a findGDCM module and i'm not experienced enough to write one. I have seen that GDCM is used in ITK, so there must be a module like this. GDCM is using cmake too, so inclusion should be easy. But i have problems to link the correkt library version depending on the configuration type. IF(WIN32) INCLUDE_DIRECTORIES(C:/Programme/GDCM\ 2.0/include/gdcm-2.0) IF(CMAKE_BUILD_TYPE MATCHES Debug) LINK_DIRECTORIES(C:/Program Files/GDCM/bin/Debug) ELSE(CMAKE_BUILD_TYPE MATCHES Debug) LINK_DIRECTORIES(C:/Program Files/GDCM/bin/Release) ENDIF(CMAKE_BUILD_TYPE MATCHES Debug) SET(GDCM_LIBRARIES gdcmcharls.lib gdcmCommon.lib gdcmDICT.lib gdcmDSED.lib gdcmexpat.lib gdcmgetopt.lib gdcmIOD.lib gdcmjpeg8.lib gdcmjpeg12.lib gdcmjpeg16.lib gdcmMSFF.lib gdcmopenjpeg.lib gdcmzlib.lib) ELSE(WIN32) # Linux INCLUDE_DIRECTORIES(/usr/include/gdcm-2.0) SET(GDCM_LIBRARIES gdcmCommon gdcmDICT gdcmDSED gdcmIOD gdcmjpeg8 gdcmjpeg12 gdcmjpeg16 gdcmMSFF) ENDIF(WIN32) He always includes the Relase Directory. What is a solution for this issue? Build GDCM from source and it will have the necessary finders. Do not INSTALL. Then the usual in your CMakeLists.txt file. Here is an example. CMakeLists.txt cmake_minimum_required(VERSION 2.6) PROJECT(GDCMImageViewer) FIND_PACKAGE(VTK REQUIRED) INCLUDE(${VTK_USE_FILE}) FIND_PACKAGE(GDCM REQUIRED) INCLUDE(${GDCM_USE_FILE}) INCLUDE_DIRECTORIES( ${GDCM_SOURCE_DIR}/Utilities/VTK ) IF(WIN32 AND NOT CYGWIN) ADD_SUBDIRECTORY(getopt) INCLUDE_DIRECTORIES(getopt) ENDIF(WIN32 AND NOT CYGWIN) ADD_EXECUTABLE(GDCMImageViewer gdcmviewer.cxx) TARGET_LINK_LIBRARIES(GDCMImageViewer vtkHybrid vtkInfovis vtkWidgets vtkgdcm getopt) BTW when cmake-gui complains it can not find GDCM point it to the place where you built gdcm. Also make sure you build all configurations of GDCM that you want in the same build tree. That is why I said do not install. Since install will try to put the binaries in the same folder and since they are named the same it will cause problems. 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] QTCreator project to VS2008 problems
Thanks for the reply - I added mainwindow.h to the automoc but I get the same thing - I thought it might be the QMetaobject header or library it was looking for, looking at the the error messages, but I checked and the header is there, and the search paths are correct. I built the QTProject with a mingw compiled version of QTCreator - this wouldn't matter would it? No part of Qt or any other library can be built with a different compiler for this to work. You must build all code with the same compiler (even service packs can cause problems). 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] QTCreator project to VS2008 problems
I may have worded that badly, so just to clarify - the QT I am using to create the VS2008 project (the one used with cmake) was compiled with VS2008, it's just the original code that was created in a mingw compiled QTCreator. I thought the point of cmake is to enable porting code from one platform to another - or have I misunderstood completely? Oli CMake will generate a build system for your project on lots of different platforms. Whether your code actually compiles on those systems is up to you. I can say that this works. I mean most of my cmake based Qt projects I develop on Visual Studio work on linux without much difficulty. There are some compiler and linker differences that I had to take care of though. 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] ANNOUNCEMENT: Mastering CMake, Fifth Edition.
On Fri, Mar 19, 2010 at 11:07 AM, Luis Ibanez luis.iba...@kitware.com wrote: Kitware is pleased to announce the release of the Fifth Edition of Mastering CMake http://www.kitware.com/products/books/CMakeBook.html This edition features instructions for building your own project with CMake; information on how to update a project for new versions of CMake by explaining the CMake policy system; and a discussion of how to setup and customize a CDash dashboard including the creation of subprojects. As always, Mastering CMake includes: • Instructions for downloading, installing, and running CMake on many platforms including Linux (UNIX), Microsoft Windows, and Mac OSX. • Details on how CMake works and how it impacts your build scripts. • Instructions for running the different GUIs, including command line options. • Information on how to use CTest to perform software testing. • A full reference of CMake's commands and variables with descriptions. The Fifth Edition of Mastering CMake may be purchased through Kitware's secure online store: http://www.kitware.com/products/books/CMakeBook.html or through Amazon (ISBN-13: 978-1-930934-22-1). I have the 4th edition. What version of CMake does this cover up to? 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] Project Folders in Visual Studio
On Mon, Mar 15, 2010 at 2:49 PM, aaron_wri...@selinc.com wrote: I know this has been asked before but I don't think it got an answer. I have a situation where I have over 200 projects in Visual Studio with no organization. Is there anyway to put them under folders? It would really save me some headaches. Thanks. You are talking about class view or solution explorer. I have not seen the ability to do this inside the Visual Studio GUI without using cmake. As a result I break up my large projects to smaller projects so that not everything is in one workspace. 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] Fwd: Project Folders in Visual Studio
for which putting them in solution folders to group them up was a good idea, I see now. I was not aware of solution folders. Sorry for the noise. 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: Project Folders in Visual Studio
On Mon, Mar 15, 2010 at 5:42 PM, Pau Garcia i Quiles pgqui...@elpauer.org wrote: On Mon, Mar 15, 2010 at 7:49 PM, aaron_wri...@selinc.com wrote: I know this has been asked before but I don't think it got an answer. I have a situation where I have over 200 projects in Visual Studio with no organization. Is there anyway to put them under folders? It would really save me some headaches. Thanks. I'm not sure what you are looking for, actually, If you want each project to be in a different folder, CMake creates a different project (thus a folder) each time you use add_library/add_executable. If you are looking to further split the sources in a project, take a look at source_group. It's a grouping of projects in the solution explorer. At the top level you can have folders (called solution folders) instead of all projects dumped into a single view. 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] Qt - Private implementation slot and required cmake special rules
On Wed, Mar 3, 2010 at 1:37 PM, Olaf Peter ope-de...@gmx.de wrote: I try to use Qt's internal Stuff for my own purpose. I want to compile the moc file separately which is with cmake very simple. Anyway, I have to tweak moc for this. I have to add the private type to the moc file generated otherwise I get an compiler error about incomplete type (the public header forwards only the private), in this case simple by e.g. /usr/bin/moc-qt4 -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. slotTest.h -fslotTest_p.h -o moc_slotTest.cpp Note the -fslotTest_p.h Now I've the private header included, but how to say this for cmake for the general case?? QT4_WRAP_CPP allows addition options, but how to get the private header? Use QT4_AUTOMOC in these cases. SET( wwWidgets_SRCS ./widgets/qwwnumpad/qwwnumpad.cpp ./widgets/wwglobal_p.cpp ./widgets/qwwbuttonlineedit.cpp ./widgets/qwwfilechooser/qwwfilechooser.cpp ) SET( wwWidgets_EXT_HDRS ./widgets/qwwnumpad/qwwnumpad.h ./widgets/wwglobal.h ./widgets/wwglobal_p.h ./widgets/qwwbuttonlineedit.h ./widgets/qwwbuttonlineedit_p.h ./widgets/qwwfilechooser/qwwfilechooser.h ) # some .ui files SET( wwWidgets_UIS ) # and finally an resource file SET( wwWidgets_RCS ) SET( wwWidgets_INT_HDRS ) QT4_AUTOMOC(${wwWidgets_SRCS} ${wwWidgets_EXT_HDRS}) include_directories( ${PROJECT_BINARY_DIR} ${PROJECT_BINARY_DIR}/.. ${wwWidgets_TREE_INCLUDE} ) add_library(wwWidgets ${wwWidgets_SRCS} ${wwWidgets_EXT_HDRS} ${wwWidgets_INT_HDRS} ) 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 absolute values in include_directories directive
On Wed, Mar 3, 2010 at 1:44 PM, Felipe Sodre dos Santos felipe.so...@totvs.com.br wrote: Hello all. Im trying to set an include directory which is actually an environment variable inside VC++ , $(QTDIR), and thus I tried the following: … include_directories( $(QTDIR)/include ) … It comes up that in the resulting SLN file, it translates that directive to C:/basedir/$(QTDIR)/include, where basedir is the root directory for the project. However, that wouldn’t work since $(QTDIR) is something like “C:\Qt”. If you need this only for Qt. Why don't you use the proper Qt support in CMake? FIND_PACKAGE(Qt4 REQUIRED) INCLUDE(${QT_USE_FILE}) # Use the include path and library for Qt that is used by VTK. INCLUDE_DIRECTORIES( ${QT_INCLUDE_DIR} ) 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] Can CMake prompt the user for input while it's running?
On Sat, Feb 27, 2010 at 12:23 PM, Naram Qashat cyberb...@cyberbotx.com wrote: I'm wondering if it's possible for CMake to prompt the user for input when it's running, as opposed to relying on passing in arguments for input. Main reason I'm looking for something like this is so we can have optional files that can be enabled or disabled by the user when CMake is run. Ideally this should be able to be done if a certain command-line flag is passed in. Minus the prompting isn't that what options are for in cmake? I believe you can set them either via the gui or by the command line / shell. 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.1 RC 3 is ready to try
On Fri, Feb 19, 2010 at 8:46 AM, Brad King brad.k...@kitware.com wrote: On 2/18/2010 4:35 PM, Ben Medina wrote: I just took it for a spin on the Windows side of my projects. It worked flawlessly with VS2005 and VS2008. Great, thanks for trying it. However, with VS2010, CMake is re-run in the middle of the build. Did this work in CMake 2.8.0? I tried some test cases that seem similar to yours but I was unable to reproduce this problem. Perhaps the generate.stamp file is removed by whatever goes wrong with the Qt custom commands. It happens as soon as I hit a project that depends on Qt, and running of moc fails. [snip] Is there a way to tell what commands it's giving to moc? You can either open the build properties in the IDE to inspect the command lines, or ask the IDE to show more verbose output during the build: Tools - Options - Projects and Solutions - Build and Run - MSBuild project build output verbosity Please try to reproduce this problem in a small test case so that we can try it, fix it, and test it. I have seen this problem (under visual studio 2005) with moc and cmake-2.6.X versions on a few occasions however moving to cmake-2.8.0 I have not had that 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
[CMake] FindSubversion on windows problem and solution.
Recently I have moved to appending the svn rev to the end of my patch version. An example of this is the following: set (StudyManager_VERSION_MAJOR 0) set (StudyManager_VERSION_MINOR 0) set (StudyManager_VERSION_PATCH 0) #- # If subversion is found append the svn rev to the patch version. # FIND_PACKAGE(Subversion) IF(Subversion_FOUND) 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 (StudyManager_VERSION_PATCH ${StudyManager_VERSION_PATCH}.${Project_WC_REVISION}) ENDIF(Subversion_FOUND) Under windows I am using the cygwin svn executable for this. The find module does not automatically find subversion however if I enter it in cmake-gui in xp64 all is well and I get the expected patch version appended. However trying this with windows 7 results in cmake never completing the configure step. I could not figure that out till I started executing the svn commands cmake would inside my build tree. c:\cygwin\bin\svn info That worked fine and made me think this bug was some incompatibility with windows 7. Eventually I looked at my code again and saw that I was also using the svn log command so trying that in the command window showed the reason for the problem. I got prompted for the password to access the svn server. Since I use TortoiseSVN from explorer I had never set the password for the console svn executable. -- 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] FindSubversion on windows problem and solution.
On Fri, Feb 19, 2010 at 7:30 PM, Tyler Roscoe ty...@cryptio.net wrote: On Fri, Feb 19, 2010 at 06:44:20PM -0500, John Drescher wrote: Under windows I am using the cygwin svn executable for this. The find module does not automatically find subversion however if I enter it in cmake-gui in xp64 all is well and I get the expected patch version appended. However trying this with windows 7 results in cmake never completing the configure step. I could not figure that out till I started executing the svn commands cmake would inside my build tree. c:\cygwin\bin\svn info That worked fine and made me think this bug was some incompatibility with windows 7. Eventually I looked at my code again and saw that I was also using the svn log command so trying that in the command window showed the reason for the problem. I got prompted for the password to access the svn server. Since I use TortoiseSVN from explorer I had never set the password for the console svn executable. I think you might be asking for trouble using the cygwin svn client outside of cygwin (line ending issues are one thing that springs to mind but there may be others). How come you're not using the Collabnet Windows svn command-line instead of Cygwin? Mainly because I already had cygwin installed on my new machine and I did not want to have to search for a free windows svn client. I did not know using the cygwin version could cause problems. When you mention line ending problems, I had just run into a line ending problem but it was not caused by that. I caused this one.. The svn server is on linux and I imported a few old projects from cvs to svn and it appears that changed line endings from windows to unix. I did not know till I tried to open a visual C 6 project and nothing happened. 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] Specifying build directory
On Thu, Feb 18, 2010 at 2:38 AM, Anders Backman ande...@cs.umu.se wrote: Hi all. Im using latest (2.8 CMake) under Windows, VisualStudio 2008. When I mix x86 and x64 builds, I would like to separate the actual output directory for the builds so that I dont get problems about mixing build types. Right now, the obj files etc is created in: src\foo.dir\Debug no matter if I build in x86 OR in x64. I would like this to become: src\foo.dir\X86\Debug and src\foo.dir\X64\Debug Is there a way to specify this? I do this all the time. Just create separate build folders by running cmake-gui 2 (or more) times. I put my source code in x:\CMakeBased\SomeProject and then build to 32bit\vc80\SomeProject 32bit\vc90\SomeProject 64bit\vc.90\SomeProject 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 turn off incremental linking for MSVC Debug and RelWithDebInfo targets?
On Thu, Feb 11, 2010 at 6:46 PM, Erwin Coumans erwin.coum...@gmail.com wrote: I can't find where this INCREMENTAL:YES is coming from. Is there a better way than hacking the 'cmLocalVisualStudio7Generator ::GetBuildTypeLinkerFlags' to replace INCREMENTAL:YES by INCREMENTAL:NO? Thanks a lot, Erwin I think it is set in here: cmake-2.8\Modules\Platform\Windows-cl.cmake # add /debug and /INCREMENTAL:YES to DEBUG and RELWITHDEBINFO also add pdbtyp # on versions that support it SET( MSVC_INCREMENTAL_YES_FLAG ) IF(NOT MSVC_INCREMENTAL_DEFAULT) SET( MSVC_INCREMENTAL_YES_FLAG /INCREMENTAL:YES) ENDIF() IF (CMAKE_COMPILER_SUPPORTS_PDBTYPE) SET (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT /debug /pdbtype:sept ${MSVC_INCREMENTAL_YES_FLAG}) SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT /debug /pdbtype:sept ${MSVC_INCREMENTAL_YES_FLAG}) ELSE (CMAKE_COMPILER_SUPPORTS_PDBTYPE) SET (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT /debug ${MSVC_INCREMENTAL_YES_FLAG}) SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT /debug ${MSVC_INCREMENTAL_YES_FLAG}) ENDIF (CMAKE_COMPILER_SUPPORTS_PDBTYPE) # for release and minsize release default to no incremental linking 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 turn off incremental linking for MSVC Debug and RelWithDebInfo targets?
STRING(REPLACE INCREMENTAL:YES INCREMENTAL:NO replacementFlags ${CMAKE_EXE_LINKER_FLAGS_DEBUG}) message (${replacementFlags}) SET(CMAKE_SHARED_LINKER_FLAGS_DEBUG ${replacementFlags}) STRING(REPLACE INCREMENTAL:YES INCREMENTAL:NO replacementFlags2 ${CMAKE_EXE_LINKER_FLAGS}) message (${replacementFlags2}) SET(CMAKE_EXE_LINKER_FLAGS ${replacementFlag2}) Is there a method using CMake 2.8 or CMake 2.8.1 that works? I thought that the following worked in the past since I have this in my CMakeLists.txt: SET(CMAKE_EXE_LINKER_FLAGS /INCREMENTAL:NO /MANIFEST /STACK:1000 ) but it appears that this no longer works with cmake 2.8.0. I believe it worked previously. I do not have a solution for this 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
[CMake] Fwd: Relative (source files) vs Absolute (include files) path
Why I care: Lets say that I someone wants to check the Visual Studio project goop produced by CMake in trunk and check out in a diffrent directory in their branch on another machine. With absolute paths sprinkled all over effectively makes this impossible. Never put any generated parts (including cmake cache and the visual studio project files) in the vcs. They are of no value outside of the machine they are generated on. 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] Would there be a need for Subversion_WC_UPDATE??
On Thu, Jan 28, 2010 at 3:28 AM, Marcel Loose lo...@astron.nl wrote: Hi all, For my project, I'm working on automatic 'svn update' of (parts of) my source tree, prior to building. I was wondering whether someone else might be interested in that kind of functionality. If so, maybe it could be added as a macro to FindSubversion? Yes I could definitely use that feature. -- 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] [vtkusers] Windows: Correctly linking the debug and release libraries in a CMake-based project
When you build VTK using CMake the .lib .dll may have the same name but they are in different folders. CMake understands this and will properly link your application with the correct .lib. This happens if you do build both debug and release vtk. John I think he is talking about having the vtk libs have _debug or _D or D in the name when they are built as debug versus Release builds. What works for ITK is to actually build both the debug and release versions but DO NOT install them. Then set an environment variable VTK_DIR to point to the build directory of VTK. CMake will do the rest. This at least worked for me with ITK and allowed me to switch between debug and release builds in my own project without getting all the linker warnings/errors in MSVC. The other suggestion was to build Release W/Debug Info and install that. Oh I see. I do not INSTALL VTK or ITK I just do as you mention.. 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 define the output location of QT4_WRAP_UI?
On Tue, Jan 26, 2010 at 5:39 PM, e...@cs.bgu.ac.il e...@cs.bgu.ac.il wrote: hello. I've ran into a slight problem, I have a program that uses qt4 gui, I've created classes with ui, my cmakelist.txts looks like this: cmake_minimum_required(VERSION 2.6) PROJECT(Quad) SET(CMAKE_VERBOSE_MAKEFILE ON) SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/build) SET(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/build/libs) SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/modules) SET(Boost_MINIMUM_VERSION 1.33.1) find_package(Qt4 COMPONENTS QtCore QtGui REQUIRED) #INCLUDE(${QT_cd USE_FILE}) INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR} src) SUBDIRS(src) and #this is just a basic CMakeLists.txt, for more information see the cmake manpage SET(SUBDIRS GUI Utilities DataObjects Threads) FOREACH(subdir ${SUBDIRS}) add_subdirectory(${subdir}) ENDFOREACH(subdir) #add definitions, compiler switches, etc. ADD_DEFINITIONS(-g -Wall -O2) #get all cpp files in libs file(GLOB UTIL_CPP Utilities/*.cpp) file(GLOB DATA_CPP DataObjects/*.cpp) file(GLOB THREADS_CPP Threads/*.cpp) file(GLOB GUI_CPP GUI/*.cpp) file(GLOB GUI_UI GUI/*.ui) QT4_WRAP_UI(GUI_UI_H ${GUI_UI}) #build a shared library ADD_LIBRARY(Utilities SHARED ${UTIL_CPP}) ADD_LIBRARY(DataObjects SHARED ${DATA_CPP}) ADD_LIBRARY(Threads SHARED ${THREADS_CPP}) ADD_LIBRARY(GUI SHARED ${GUI_CPP} ${GUI_UI_H}) #add_subdirectory(testUnits) #link libs target_link_libraries(DataObjects) target_link_libraries(Utilities DataObjects) target_link_libraries(Threads Utilities DataObjects) target_link_libraries(GUI ${QT_QTCORE_LIBRARIES} ${QT_QTGUI_LIBRARIES} Utilities DataObjects) #list all source files here ADD_EXECUTABLE(Quad Quad.cpp) #need to link to some other libraries TARGET_LINK_LIBRARIES(Quad DataObjects Utilities Threads GUI) now for some reason the ui_*.h files are created under the bin folder causing compilation to fail because these files are missing in the actual src folder. how can I define the macro's output location? The point of out of source builds is nothing generated goes with the source. I would just add the binary folder as an include using cmake. INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR}) 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] Specifying multiple build threads on windows
Can you please help as how I could specify the number of threads to be used in the command line builds i.e. something like (For nmake) Cmd nmake –j5 (For Visual Studio 2008) cmd cmake –-build . –j5 Use vcbuild or msbuild 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] What activates the fortran module?
I am testing running cmake to generate Visual Studio 2005 projects under wine and things are going good. I have built 2 projects without any problems then the third project had the following error: CMake Error at C:/Program Files/CMake 2.8/share/cmake-2.8/Modules/CMakeFortranInformation.cmake:25 (GET_FILENAME_COMPONENT): get_filename_component called with incorrect number of arguments Call Stack (most recent call first): CMakeLists.txt:1 (PROJECT) this error went away after a few tries and I was able to build the 3rd project however I now have this on the 4th project. The thing is I have no fortran code at all. I suspect that the problem may be due to environment variables being carried over from the linux system to wine. Thanks in advance, 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] Specifying multiple build threads on windows
Thanks but how do I integrate vcbuild or msbuild with cmake ? I never have used the --build option. I am not exactly sure. For my windows projects I have it generate a batch file using cmake configure. This batch file calls devenv with the options from cmake. So to build I call install.bat located in the binary folder of each project. And for dependent projects I call a master install.bat that calls the dependent install.bat files in each 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] Using gcc as an alternative compiler on windows
Navigate to a CLEAN build directory and invoke either cmake or cmake-gui Out of source builds work great here. You keep your source in one tree and your builds in other trees. For me its a choice between 32 and 64 bit builds for different microsoft compilers. I have my source trees inside of x:\CMakeBased\some path\ProjectName Then my binary builds are in: x:\32bit\vc.71\some path\ProjectName x:\32bit\vc.80\some path\ProjectName x:\32bit\vc.90\some path\ProjectName x:\64bit\vc.80\some path\ProjectName x:\64bit\vc.90\some path\ProjectName 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 gcc as an alternative compiler on windows
2010/1/20 Mike Jackson mike.jack...@bluequartz.net: You need to have a valid/correct installation of MinGW or MSYS+MinGW or Cygwin. As a complement to Mike advice you may have a look at Code::Blocks (aka C::B) too, it's a cross-platform IDE working on Windows and there is downloadable installer which comes bundled with MinGW http://www.codeblocks.org/downloads/5 and off course there is a Code::Blocks+MInGW generator supported by CMake. To add an additional option I have successfully used QtCreator (which builds using MinGW) on windows with cmake. It supports CMakeLists.txt files directly. I would call it work in progress as far as the CMake 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] Using gcc as an alternative compiler on windows
To add an additional option I have successfully used QtCreator (which builds using MinGW) on windows with cmake. It supports CMakeLists.txt files directly. I would call it work in progress as far as the CMake support. What's not working ? (it works off the same CodeBlocks files) The building works fine. qtcreator does not seem to handle debug, and release in an easy way and also by default it does an in source build. I know I had other issues but I have not played with this in a few weeks so I do not remember. 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] RoadMap
I haven't found any information about a CMake roadmap. Are there any concrete plans about the release of CMake 2.9 yet? 2.9 is a development build. Even numbers are released while odd ones are development. As for your question I do not know. But I can safely say it will not be in this quarter since 2.8.0 was released recently. 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] Proposal for new generator options
On Sat, Jan 16, 2010 at 11:07 AM, Jochen Wilhelmy j.wilhe...@arcor.de wrote: Hi! the first solution (Manual Replace) in http://www.itk.org/Wiki/CMake_FAQ#How_can_I_build_my_MSVC_application_with_a_static_runtime.3F does not seem to work since in the gui of cmake (2.6 for windows) I don't see any CMAKE_C_FLAGS_DEBUG etc. to modify. the project (svn repository) is http://llvm.org/svn/llvm-project/llvm/trunk Are you in the Grouped View or Advanced View. I do not believe you can see these in Simple View Also you should upgrade to cmake-2.8.0 if possible. It has many improvements over 2.6.X 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] Proposal for new generator options
Now it works, I have upgraded to 2.8.0 and switched to Advanced View. Since I have to start the tool, change it for debug and release and then re-generate I still think it could be done easier, especially without needing to ask in this mailing list. How do all these dummy windows users find out that they have to change /MD to /MT if they are used to changing this with a setting inside the graphical IDE? I would suspect that most users use the default values. I pretty much go with the defaults with the addition of adding the /MP parameter inside my main CMakeLists.txt file. To avoid any problems with other users not having the right .dll runtimes I just have CMake bundle the runtime with the install it generates. Here is what I have in my packaging for my current application: IF(PACKAGE_FOR_INSTALL) SET(CPACK_PACKAGE_VERSION_MAJOR ${StudyManager_VERSION_MAJOR}) SET(CPACK_PACKAGE_VERSION_MINOR ${StudyManager_VERSION_MINOR}) SET(CPACK_PACKAGE_VERSION_PATCH ${StudyManager_VERSION_PATCH}) IF(CMAKE_CL_64) SET(CMAKE_MSVC_ARCH amd64) ELSE(CMAKE_CL_64) SET(CMAKE_MSVC_ARCH x86) ENDIF(CMAKE_CL_64) IF(MSVC80) FIND_PROGRAM(MSVC_REDIST NAMES vcredist_${CMAKE_MSVC_ARCH}/vcredist_${CMAKE_MSVC_ARCH}.exe PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0;InstallDir]/../../SDK/v2.0/BootStrapper/Packages/ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\VisualStudio\\8.0;InstallDir]/../../SDK/v2.0/BootStrapper/Packages/ ) GET_FILENAME_COMPONENT(vcredist_name ${MSVC_REDIST} NAME) INSTALL(PROGRAMS ${MSVC_REDIST} COMPONENT Runtime DESTINATION bin) SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS ExecWait '\\\$INSTDIRbin${vcredist_name}\\\') ENDIF(MSVC80) IF(WIN32) SET(CPACK_NSIS_COMPRESSOR /SOLID lzma) SET(CPACK_PACKAGE_EXECUTABLES StudyManager) 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 ${QT_BINARY_DIR}/QtSql${QT_VERSION_MAJOR}.dll DESTINATION bin COMPONENT Applications ) ENDIF(WIN32) set(CPACK_COMPONENTS_ALL Applications Runtime) INCLUDE(CPack) ENDIF(PACKAGE_FOR_INSTALL) ___ 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] Proposal for new generator options
On Sat, Jan 16, 2010 at 4:11 PM, Jochen Wilhelmy j.wilhe...@arcor.de wrote: I would suspect that most users use the default values. I pretty much go with the defaults with the addition of adding the /MP parameter inside my main CMakeLists.txt file. If you are the author of some software then this is fine. But I have the case where I have to use some existing visual studio projects using /MT and a cmake project, both of which I am not the maintainer and therefore changes cannot be made. So it was quite complicated to get it working. But what is against my proposal of splitting the -G option? for visual studio there are two more platforms except Win32 and Win64, some smartphone and mobile stuff. So the number of generators will explode anyway. with four versions and four platforms this are a whopping number of 16 generators for visual studio alone. You may be able to get this approved if you file a bug report and possibly provide a patch for this. It actually should not be that hard to implement however I assume developers have much higher priorities than 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] Proposal for new generator options
On Sat, Jan 16, 2010 at 6:58 PM, Jochen Wilhelmy j.wilhe...@arcor.de wrote: You may be able to get this approved if you file a bug report and possibly provide a patch for this. It actually should not be that hard to implement however I assume developers have much higher priorities than this. ok, is there a svn where I can check out directly? I at least can have a look. http://www.cmake.org/cmake/resources/software.html 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] FindQt in a Specific place?
On Wed, Jan 13, 2010 at 1:07 PM, James Willis jwill...@lgc.com wrote: Is there any good way of telling findqt (I don't really care about findqt3) where to find Qt? Like say you did: set(QT_QMAKE_LOCATION /home/myself/qt4.6.0/bin) so that I later upgrade and do: set(QT_QMAKE_LOCATION /home/myself/qt4.6.1/bin) later without having to muck with my path, but still have findQt find Qt there? I was looking at writing such a feature, if it's not there, and if you'd be willing to take it as a patch. I am pretty sure you can pass this on the command line to cmake instead of polluting your CMakeLists.txt with installation specific data. 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 cmake on windows - query on existing targets
I noticed that it generates the following output: -- Check if this is a free VC compiler - yes I do not think I am using a free VC compiler, something is wrong here. Is it possible to use nmake with Visual Studio 2008 compiler using cmake 2.8? I just tested this on my build box and similar errors that you had about not finding the compiler. Then I ran cmake-gui from the Visual Studio 2008 Command Prompt and all was well. 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 cmake on windows - query on existing targets
On Mon, Jan 11, 2010 at 3:51 PM, Chauhan, Vikas vikas.chau...@anritsu.com wrote: Actually, when I used the macro I found that though this macro gives a useful functionality it is not exactly what I wanted. What I want to do can be illustrated the following example: I have a main project/dir - projectSystem I have three component/dir - projectcomponent1, projectcomponent2, projectcomponent3. Now on windows from the directory where the cmake generated files are present, at present I issue a command : cmake --build PATH_TO_PROJECTSYSTEM This builds the projectSystem alongwith projectComponent1, projectComponent2 projectComponent3. Now, I want to do two things on command window(from the dir where cmake build files are generated): 1. Query the list of sub-targets(components) available. In this case the result is a list projectComponent1 projectComponent2 projectComponent3 2. Now based on the list in 1, optionally build any component. For example issue a command: cmake --build projectComponent1 Can we achieve this? Or is it asking for too much :) Thanks, Vikas I'm new to CMake too, but it looks like you could do what you want with the option() directive. So I would have in my CMakeLists.txt something like: option(ProjectComponent1 Builds the first project component OFF) etc. And later on: if(ProjectComponent1) add_subdirectory(${ProjectComponent1_DIR}) endif(ProjectComponent1) etc. and then in ccmake set the option to ON when you want to build with it. I'd be surprised if there wasn't a way to define separate make targets somewhere instead though, so you could do make projectComponent1, but I'm not sure about how to do that. I understand what you mean and it is similar to what the macro suggested by Alex does. However, I do not want a developer to have a need to change setting in the cmake GUI for what I need. What I want is that: 1. the user should be able to see a list of components sub-components, using a command from the cmd window from the location where the cmake GUI has generated the build files. 2. the user should be able to choose a sub-component to build without asking to build the whole component. Also, I do not want to be generating build files every time I choose to build a different sub-component. Is this possible? Please note that I am on windows. I guess this is easily possible on Linux. As make allows you to query a list of targets can build specific targets as well. Please correct me if I am wrong. The options method probably solves this the best. 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 cmake on windows - query on existing targets
I am going to only answer 1 part of this. For example: I may have a set of separate directories(each containing a project) and from the top level root directory, I want to selectively build a subset of projects. How can I do it on the command line ? I do this with a batch file. Each project configures an install.bat.in file which generates a install.bat in a Build sudirectory of the projects Build tree. Here is an example for a project called LungAnalysis Here is the install.bat.in [x:\]type X:\CMakeBased\Qt\LungAnalysis\install.bat.in devenv @project_binary_...@\@project_n...@.sln /build @RELEASE_BUILD_NAME@ /project PACKAGE Now the install.bat [x:\]type X:\32Bit\VC.80\Qt\LungAnalysis\Batch\install.bat devenv X:/32Bit/VC.80/Qt/LungAnalysis\LungAnalysis.sln /build RelWithDebInfo /project PACKAGE So then in a the root folder for the build trees for 32 bit vc2005 projects folder I have: [x:\32bit\vc.80]type 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 builds all dependencies for the project by calling each projects install.bat script. I know this probably could be done in a more cross platform way but this was pretty easy to implement on the platform I develop the most. When I build on linux (not that often) I build each project manually. 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
[CMake] Fwd: Compiler Test Failing on Windows 7
On Wed, Jan 6, 2010 at 2:49 PM, Gregory Peele ARA/CFD gpe...@ara.com wrote: Let's stress that the source and binary directories of this build are readable and writable to Joe's account. It is NOT a file permission issue for any files in our build tree. If CMake or Visual Studio generate files outside of our source or binary tree all bets are off of course. Given that Microsoft heavily recommends running Visual Studio 2005 as Administrator in both Vista and Windows 7 - it nags you each time you launch if you don't - and it also fails for Joe on non-CMake-generated solutions, I suspect the real problem is a bug in Visual Studio 2005 on Windows 7. Has anyone on this list successfully built projects using Visual Studio 2005 on Windows 7 without marking CMake and Visual Studio to run as Administrator? Presumably what happens if CMake is not marked to run as Administrator, when it attempts the try-compile stage, it does not honor the run as Administrator marking on devenv or vcbuild or whatever process it uses, and then Visual Studio 2005 does naughty things and fails. I am pretty sure I do that on a VM install of Win7 RC1. I was using 2005 but now I moved to 2008. I have not experienced this issue and I am not logged in as the Admin however I am using family networking on the VM. 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 cmake on windows - query on existing targets
Thanks, however I was looking to do it in a path independent way. For example by just using the directory/vcproj name from top build directory. Please do correct me if I have not understood correctly. With that method there are no hardcoded paths in the batch files. The paths were generated by CMake In my CMakeLists.txt for each project I have configure_file ( ${PROJECT_SOURCE_DIR}/install.bat.in ${PROJECT_BINARY_DIR}/Batch/install.bat ) Either way I would try the other method first.. My method is not crossplatform compatible and also requires more work to setup... 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] restricting Qt include and library linking to 1 library/project
On Thu, Dec 31, 2009 at 3:12 PM, Hicham Mouline hic...@mouline.org wrote: -Original Message- From: Clinton Stimpson [mailto:clin...@elemtech.com] Sent: 31 December 2009 16:08 To: Hicham Mouline Cc: cmake@cmake.org Subject: Re: [CMake] restricting Qt include and library linking to 1 library/project If you have multiple directories with different Qt dependencies, you can do: find_package(Qt4 REQUIRED) in the top directory, then each sub directory can do something like set(QT_USE_QTOPENGL 1) include(${QT_USE_FILE}) But in your case, its only lib3, so just do it in that CMakeLists.txt file. Clint That's what I did at the end. I did this: FIND_PACKAGE(Qt4 4.6.0 COMPONENTS QtCore QtGui QtOpenGL REQUIRED) INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR} ${QT_QTGUI_INCLUDE_DIR}) MESSAGE(STATUS QT_QTCORE_LIBRARY=${QT_QTCORE_LIBRARY}) TARGET_LINK_LIBRARIES(plot $QT_QTCORE_LIBRARY) The include dirs are set correctly, but I'm having trouble with QT_QTCORE_LIBRARY. This appears as : QT_QTCORE_LIBRARY=optimized;C:/Progra~2/Qt/4.6.0/lib/QtCore4.lib;debug;C:/Pr ogra~2/Qt/4.6.0/lib/QtCored4.lib When I open the solution with vs2008, the Librarian doesn't show this libraries as input. Note the help for TARGET_LINK_LIBRARIES displays the syntax as: target_link_libraries(target [item1 [item2 [...]]] [[debug|optimized|general] item] ...) There are no semicolons after the optimized|debug keywords, I wonder if by not using QT_USE_FILE, QT_QTCORE_LIBRARY are others are set incorrecty. If you open cmake-gui does and look at the Qt tab in Grouped View are the debug libraries properly set? 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] restricting Qt include and library linking to 1 library/project
If you open cmake-gui does and look at the Qt tab in Grouped View are the debug libraries properly set? Hmm sorry for the bad wording.. If you open cmake-gui and look at the Qt tab in Grouped View are the debug libraries properly set? 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] restricting Qt include and library linking to 1 library/project
On Thu, Dec 31, 2009 at 5:06 PM, Hicham Mouline hic...@mouline.org wrote: -Original Message- From: John Drescher [mailto:dresche...@gmail.com] Sent: 31 December 2009 20:25 To: Hicham Mouline; CMake mailing list Subject: Re: [CMake] restricting Qt include and library linking to 1 library/project If you open cmake-gui does and look at the Qt tab in Grouped View are the debug libraries properly set? Hmm sorry for the bad wording.. If you open cmake-gui and look at the Qt tab in Grouped View are the debug libraries properly set? John The _DEBUG and _RELEASE version of the cmake variables look properly set in cmake-gui Thanks I asked this because one time I forgot to build the debug version of Qt and cmake supplied the release versions of all the Qt libraries for my projects debug and release 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] [vtkusers] Coexistence of different Win32 libraries
On Tue, Dec 29, 2009 at 10:39 AM, Kenneth Porter sh...@sewingwitch.com wrote: --On Monday, December 28, 2009 10:45 AM -0500 John Drescher dresche...@gmail.com wrote: Here is what I do. [script] Thanks. Must I put that in the project's CMakeLists.txt or can I capture that to a file I can inject each time I run cmake? I'm relatively new to cmake so I don't yet see how build-host-wide defaults are set. I thought I could inject it with -C but that doesn't seem to be affecting the generated cache or project files. I put that in my CMakeLists.txt of the 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] Overriding read-only project's CMakeLists.txt
Where can I put build instructions that are build-host-wide, not project-wide? I'm relatively new to cmake. I want to inject some code before the project's own script, and I'd prefer not to modify the project (since then I'd have to maintain the patch). I want to set the CMAKE_target_PREFIX variables based on the version of Visual Studio used and whether it's a debug or release build. (I've been given code to do this on the VTK list, but I don't see how to use it apart from editing VTK's file.) You can create your own CMakeLists.txt file that drives the build process for the dependencies. This way I believe you can inject these variables. This was discussed recently (in the last 2 to 3 weeks) on the list. Also I think you can pass these on the command line via a batch file that calls cmake or cmake-gui for the user. 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 file in build directory
On Tue, Dec 29, 2009 at 6:01 PM, Hicham Mouline hic...@mouline.org wrote: Hello, I am writing software that uses boost and Qt and other 3rd party libraries for win/mingw, win/msvc2008 and linux/gcc. The location of the 3rd party header files is different on each of the boxes I compile on. Is there a file to put in the build directory? Is such a file automatically read by cmake, or does it need to be included explicitly by the source dir CMakeLists.txt? Does one call the find modules explicitly? or just define for e..g BOOSTROOT ? I call finders in my master CMakeLists.txt file and do not put any files in any of the build trees for any of the compilers I use. On windows (because there is no standard library install location) a lot of times this means I need to either manually find the dependencies when I run cmake-gui or define BOOST_ROOT, ITK_DIR ... in my environment variables. 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] what is the right way to set CMAKE_USE_RELATIVE_PATHS?
On Mon, Dec 21, 2009 at 3:50 PM, Claus Klein claus.kl...@arcormail.de wrote: Hi all, I tried to use: set(CMAKE_USE_RELATIVE_PATHS ON) in my CMakeLists.txt. But I noticed, that some cmake variables can't be changed in that way. In the CMakeCache.txt, it is still OFF? I have no idea about CMAKE_USE_RELATIVE_PATHS since I have never needed/wanted to use that however for the other cases that it appears the CMake does not let me change a value I usually get around this using the following examples: SET (CMAKE_INSTALL_PREFIX ${PGM_FILES}/UPMC/${CMAKE_PROJECT_NAME} CACHE STRING Default Install Path FORCE) IF (MAKE_DEBUGRELEASE) SET (CMAKE_CONFIGURATION_TYPES Debug;RelWithDebInfo CACHE STRING Debug;RelWithDebInfo FORCE) SET (RELEASE_BUILD_NAME RelWithDebInfo) ELSE(MAKE_DEBUGRELEASE) SET (CMAKE_CONFIGURATION_TYPES Debug;Release CACHE STRING Debug;Release FORCE) SET (RELEASE_BUILD_NAME Release) ENDIF (MAKE_DEBUGRELEASE) The keys are CACHE and FORCE. 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] what is the right way to set CMAKE_USE_RELATIVE_PATHS?
There are lots of questions on this CMake variable and the consensus is DO NOT USE IT. PERIOD. The implementation is basically broken for all but the most trivial case. I can tell you one thing. If the original idea of this was an attempt to create a CMake free build that will not work. 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] qt .qrc file modifications require two builds
On Wed, Dec 16, 2009 at 3:27 PM, Glenn Hughes ghughes02...@gmail.com wrote: Removed the globbing, same exact behavior. Any other ideas? Does this normally work for people? Any examples? Works fine for me. Although I rarely update the .qrc 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] (no subject)
On Tue, Dec 15, 2009 at 4:13 AM, Johan Knutzen knutzen_joh...@yahoo.se wrote: Hi! What is the status of scripts enabling precompiled headers for gcc/visual studio? I've tried out PCHSupport_26 from http://www.cmake.org/Bug/view.php?id=1260 but I couldn't get it to work. Does anyone have any up to date script that works with 2.8? I have not bothered in linux since I can use ccache to speed up builds. In windows I use the following macro: # macro( SM_PCH_SUPPORT ProjectName ) if (MSVC) if (USE_MSVC_PCH) set_source_files_properties(${ProjectName}PCH.cxx PROPERTIES COMPILE_FLAGS /Yc${ProjectName}PCH.h ) foreach( src_file ${${ProjectName}_SRCS} ) set_source_files_properties( ${src_file} PROPERTIES COMPILE_FLAGS /Yu${ProjectName}PCH.h ) endforeach( src_file ${${ProjectName}_SRCS} ) list(APPEND ${ProjectName}_SRCS ${ProjectName}PCH.cxx) list(APPEND ${ProjectName}_EXT_HDRS ${ProjectName}PCH.h) endif(USE_MSVC_PCH) endif (MSVC) endmacro (SM_PCH_SUPPORT) # And this requires me to have my source variable named ${ProjectName}_SRCS And my header variable to be named ${ProjectName}_EXT_HDRS and the following files to exist in the same folder as the CMakeLists.txt ${ProjectName}PCH.cxx ${ProjectName}PCH.h I generally put this macro in the main project before my first add_subdirectory so that all subprojects can use the macro as well. Then to activate this in a project. I place the macro call after I define the list variables. SET( smDataManagement_SRCS ./src/smData.cxx ./src/smDataOperation.cxx ./src/smCounterBalanceOperation.cxx ) SET( smDataManagement_EXT_HDRS ./Include/smData.h ./Include/smDataOperation.h ./Include/smCounterBalanceOperation.h ) SET( smDataManagement_MOC_HDRS ) # some .ui files SET( smDataManagement_UIS ) # and finally an resource file SET( smDataManagement_RCS ) SET( smDataManagement_INT_HDRS ) #Add precompiled header support SM_PCH_SUPPORT(smDataManagement) This works in cmake-2.6 and above. 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] qt .qrc file modifications require two builds
The CMake script in question looks more or less like: FILE (GLOB my_RESOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} res/*.qrc ) QT4_ADD_RESOURCES( my_RESOURCES_SOURCES ${my_RESOURCES} ) ... It's always best to not do any file globbing and add each file by hand. I believe this is causing 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
[CMake] CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT returns false when expected true
Under cmake-2.8.0 I have the following section in my CMakeLists.txt 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) SET (DEFAULT_INSTALL_PATH ${PGM_FILES}/UPMC/${CMAKE_PROJECT_NAME} CACHE STRING Default Install Path) if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set (CMAKE_INSTALL_PREFIX ${DEFAULT_INSTALL_PATH} CACHE STRING Install path FORCE) message(CMAKE_INSTALL_PREFIX Initialized to default setting to ${DEFAULT_INSTALL_PATH}) else (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) message(CMAKE_INSTALL_PREFIX not Initialized to default keeping ${CMAKE_INSTALL_PREFIX}) endif (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) ENDIF(WIN32) The expected value for the QtBasicUtils project is if the user did not change CMAKE_INSTALL_PREFIX the path should be C:/Program Files (x86)/UPMC/QtBasicUtils on 64 bit systems or C:/Program Files/UPMC/QtBasicUtils on 32 bit systems However this is not getting set and I get the following message in my log: CMAKE_INSTALL_PREFIX not Initialized to default keeping C:/Program Files (x86)/QtBasicUtils -- 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_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT returns false when expected true
On Mon, Dec 14, 2009 at 12:16 PM, Tyler Roscoe ty...@cryptio.net wrote: On Mon, Dec 14, 2009 at 12:07:33PM -0500, John Drescher wrote: SET (DEFAULT_INSTALL_PATH ${PGM_FILES}/UPMC/${CMAKE_PROJECT_NAME} CACHE STRING Default Install Path) if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set (CMAKE_INSTALL_PREFIX ${DEFAULT_INSTALL_PATH} CACHE STRING Install path FORCE) message(CMAKE_INSTALL_PREFIX Initialized to default setting to ${DEFAULT_INSTALL_PATH}) else (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) message(CMAKE_INSTALL_PREFIX not Initialized to default keeping ${CMAKE_INSTALL_PREFIX}) endif (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) ENDIF(WIN32) The expected value for the QtBasicUtils project is if the user did not change CMAKE_INSTALL_PREFIX the path should be C:/Program Files (x86)/UPMC/QtBasicUtils on 64 bit systems or C:/Program Files/UPMC/QtBasicUtils on 32 bit systems However this is not getting set and I get the following message in my log: CMAKE_INSTALL_PREFIX not Initialized to default keeping C:/Program Files (x86)/QtBasicUtils Clean out your cache? Looks like your cache has CMAKE_INSTALL_PREFIX set to 'C:/Program Files (x86)/QtBasicUtils', which is not the default, so your script is behaving as it should and not clobbering the value. CMAKE_INSTALL_PREFIX is not in the cache. I thought that was default on 64 bit windows. 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_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT returns false when expected true
On Mon, Dec 14, 2009 at 12:21 PM, John Drescher dresche...@gmail.com wrote: On Mon, Dec 14, 2009 at 12:16 PM, Tyler Roscoe ty...@cryptio.net wrote: On Mon, Dec 14, 2009 at 12:07:33PM -0500, John Drescher wrote: SET (DEFAULT_INSTALL_PATH ${PGM_FILES}/UPMC/${CMAKE_PROJECT_NAME} CACHE STRING Default Install Path) if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set (CMAKE_INSTALL_PREFIX ${DEFAULT_INSTALL_PATH} CACHE STRING Install path FORCE) message(CMAKE_INSTALL_PREFIX Initialized to default setting to ${DEFAULT_INSTALL_PATH}) else (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) message(CMAKE_INSTALL_PREFIX not Initialized to default keeping ${CMAKE_INSTALL_PREFIX}) endif (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) ENDIF(WIN32) The expected value for the QtBasicUtils project is if the user did not change CMAKE_INSTALL_PREFIX the path should be C:/Program Files (x86)/UPMC/QtBasicUtils on 64 bit systems or C:/Program Files/UPMC/QtBasicUtils on 32 bit systems However this is not getting set and I get the following message in my log: CMAKE_INSTALL_PREFIX not Initialized to default keeping C:/Program Files (x86)/QtBasicUtils Clean out your cache? Looks like your cache has CMAKE_INSTALL_PREFIX set to 'C:/Program Files (x86)/QtBasicUtils', which is not the default, so your script is behaving as it should and not clobbering the value. CMAKE_INSTALL_PREFIX is not in the cache. I thought that was default on 64 bit windows. Correction. 64 bit windows compiling a 32 bit application using 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] Eclipse tries to build x64 instead of x86
Ok, nevermind, I built again using -DCMAKE_BUILD_TYPE=Release and that worked. I wiped the build directory entirely and did -DCMAKE_BUILD_TYPE=Release and it's working again. Strange. Maybe some files just got screwed up somehow. That seems to have fixed it so please disregard my previous question. I have seen this once on a Visual Studio 2005 C++ project with CMake 2.8.0 and wiping the cache and regenerating the config also fixed the issue. 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: A bug for Code::Blocks MinGW?
On Tue, Dec 8, 2009 at 8:18 PM, Song Zhiwei son...@gmail.com wrote: Thanks. Have done. That is http://public.kitware.com/Bug/view.php?id=10014 for anyone following. -- 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] Source file symlinks on out-of-source builds
On Thu, Dec 3, 2009 at 1:18 PM, Rodolfo Schulz de Lima rodo...@rodsoft.org wrote: Michael Jackson wrote: I'll throw a no vote on that but what I would like to hear is some more detail from Rodolfo explaining why he thinks he needs this? Have you tried embedding the build directory inside the source directory? Some of us use this type of setup and it seems to work really nicely with IDEs, Text Editors, and the terminal? Hi Michael, I've already replied with some 'details' you wanted. Your reply must not have hit the list as I do not see it. 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] Source file symlinks on out-of-source builds
That's one way do deal with it, but since I use xterm I don't have tabs, and my monitor is a 17 4:3, so screen space it rare. Dude... I need some serious tools and hardware upgrades :) install screen http://www.gnu.org/software/screen/ 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: A bug for Code::Blocks MinGW?
-- Forwarded message -- From: John Drescher dresche...@gmail.com Date: Wed, Dec 2, 2009 at 8:44 PM Subject: Re: [CMake] A bug for Code::Blocks MinGW? To: Song Zhiwei son...@gmail.com I use CMake to generate a Code::Blocks MinGW Makefiles for my project Module4Test. Module4Test.cbp contains lines as below: MakeCommands Build command=C:/MinGW/bin/mingw32-make.exe -f C:/Documents\ and\ Settings/Song\ Zhiwei/Desktop/build2/src/Makefile module4test/fast / CompileFile command=C:/MinGW/bin/mingw32-make.exe -f C:/Documents\ and\ Settings/Song\ Zhiwei/Desktop/build2/src/Makefile quot;$filequot; / Clean command=C:/MinGW/bin/mingw32-make.exe -f C:/Documents\ and\ Settings/Song\ Zhiwei/Desktop/build2/src/Makefile clean / DistClean command=C:/MinGW/bin/mingw32-make.exe -f C:/Documents\ and\ Settings/Song\ Zhiwei/Desktop/build2/src/Makefile clean / /MakeCommands As you noticed, no quot; are added around C:/Documents\ /Makefile, so the build fails. Is it a bug? No its actually escaped correctly for *nix but not windows. What version of CMake are you using? 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] NMake Generation Error: machine type 'X86' conflicts with target machine type 'x64'
On Fri, Nov 13, 2009 at 1:15 PM, aaron_wri...@selinc.com wrote: Bill, I think you were right. I took a hard look at my SDK paths and changed a capital I to a lower-case i and everything seems better. Thanks for help. I am confused about that. Windows paths and filenames are not case sensitive. 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] NMake Generation Error: machine type 'X86' conflicts with target machine type 'x64'
On Fri, Nov 13, 2009 at 4:01 PM, aaron_wri...@selinc.com wrote: I'm sorry, I was being a little flippant. I had an un-escaped \ in my perl script that set the INCLUDE environment variable. Apparently, CMake was unable to compile a test program because of this messed up path, and thus assumed the box must be x64. I didn't mean to mislead you. No problem. I only questioned that because I thought that the fix was caused by some other thing you did.. 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 Qt CMake 2.8 build question
On Thu, Nov 12, 2009 at 12:51 PM, Steven Wilson steven.wesley.wil...@gmail.com wrote: Caveat: I am a complete Qt novice. I'm trying to build the 2.8 CVS branch of CMake on Windows and would like to build the Qt GUI. I downloaded and installed the LGPL/Free Windows Qt SDK from the Nokia website. When I use the CMake 2.6.4 or CMake 2.8.0 RC 7 GUI to configure the build for Visual Studio(2008) (with the Qt GUI enabled) I get the following error from CMake: CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindQt4.cmake:771 (MESSAGE): It appears you're trying to use Visual Studio with Qt built by mingw Call Stack (most recent call first): Source/QtDialog/CMakeLists.txt:14 (FIND_PACKAGE) The FindQT4.cmake package indicates that it is looking for a qmake.exe binary to run to configure the rest of the Qt CMake variables. I set my PATH environment variable to point to C:\Qt\2009.4\qt\bin so that the FindQT4.cmake package can find the qmake binary, but it seems to think that qmake is for mingw. I have also tried setting my PATH variable to point to C:\Qt\2009.4\qt\qmake so that it can find the qmake in that directory, but using that one gives errors about temporary library versions of the Qt library not being installed. The FindQT4.cmake file tries to query the qmake binary for QT_INSTALL_LIBS and qt\qmake\qmake.exe from the SDK I installed returns the following: C:/qt-greenhouse/Trolltech/Code_less_create_more/Trolltech/Code_less_create_more /Troll/4.5.0/qt/lib This path of course does not exist on my system and appears to be an artifact of the Qt build process from Nokia. I can not find any other qmake.exe binaries on the system and at this point I do not understand why the configuration does not work. If you have any advice that you can offer, I will greatly appreciate the help. You need to rebuild Qt using 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] [Insight-users] (no subject)
On Thu, Nov 12, 2009 at 7:26 PM, Xiaofeng Z xf10...@hotmail.com wrote: I was trying to build ITK in Window 7. It appears cmake.exe was not able to install the files into “C:\Program Files (x86)\ITK” or “C:\Program Files\ITK” folder. Has anybody experienced the same? Yes. Is it a bug with CMake? I believe this is caused by UAC. I am not sure I would call it a cmake bug 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
[CMake] Fwd: How to build INSTALL project from the command line?
-- Forwarded message -- From: John Drescher dresche...@gmail.com Date: Tue, Nov 10, 2009 at 5:22 PM Subject: Re: [CMake] How to build INSTALL project from the command line? To: aaron_wri...@selinc.com On Tue, Nov 10, 2009 at 5:09 PM, aaron_wri...@selinc.com wrote: I've been trying to build the INSTALL project as part of the solution from the commandline. For example, after running: cmake -G Visual Studio 9 2008 .. I've tried: msbuild /t:INSTALL /p:Configuration=Release solution.sln But this builds ALL_BUILD and then tells me tells me: The project INSTALL is not selected for building in solution configuration Release|Win32 Is there a way to make this work from cmake's end? I've tried every commandline swtich I can think of for msbuild but have had no luck. I can build the INSTALL.vcproj directly, but this looses the dependencies between projects, like INSTALL's dependency on ALL_BUILD. I'd like to get this done with one call if possible. I have each project configure an install.bat.in file that creates an install.bat file in the build folder Here is a sample install.bat.in devenv @project_binary_...@\@project_n...@.sln /build Debug /project INSTALL devenv @project_binary_...@\@project_n...@.sln /build @RELEASE_BUILD_NAME@ /project INSTALL Then the generated install.bat devenv X:/32Bit/VC.80/Qt/QtBasicUtils\QtBasicUtils.sln /build Debug /project INSTALL devenv X:/32Bit/VC.80/Qt/QtBasicUtils\QtBasicUtils.sln /build RelWithDebInfo /project INSTALL And the configuration in my CMakeLists.txt IF (MAKE_DEBUGRELEASE) SET (CMAKE_CONFIGURATION_TYPES Debug;RelWithDebInfo CACHE STRING Debug;RelWithDebInfo FORCE) SET (RELEASE_BUILD_NAME RelWithDebInfo) ELSE(MAKE_DEBUGRELEASE) SET (CMAKE_CONFIGURATION_TYPES Debug;Release CACHE STRING Debug;Release FORCE) SET (RELEASE_BUILD_NAME Release) ENDIF (MAKE_DEBUGRELEASE) configure_file ( ${PROJECT_SOURCE_DIR}/install.bat.in ${PROJECT_BINARY_DIR}/Batch/install.bat ) -- 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
[CMake] Fwd: [Insight-users] Problem with CMakelist
-- Forwarded message -- From: Wen Shi ws...@sfu.ca Date: Sat, Nov 7, 2009 at 2:19 AM Subject: Re: [Insight-users] Problem with CMakelist To: John Drescher dresche...@gmail.com Hi john, Thank you for your reply. But actually I first used INCLUDE(${VXL_USE_FILE}) But when I use CMake to generate the project, there is a error saying that INCLUDE can only take one argument. So I used INCLUDE_DIRECTORIES(${VXL_USE_FILE}). I don't know why it says that. THanks again Wen Shi - 原始邮件 - 发件人: John Drescher dresche...@gmail.com 收件人: Wen Shi ws...@sfu.ca 发送时间: 2009年 11 月 06日, 星期五 下午 6:12:26 GMT -08:00 美国/加拿大太平洋 主题: Re: [Insight-users] Problem with CMakelist On Fri, Nov 6, 2009 at 8:01 PM, Wen Shi ws...@sfu.ca wrote: Hi Guys, I am new to CMake and have little experiences in writing CMakelist files. Currently I want to generate a project which calls VXL libraries. Below is my CMakelist file: CMAKE_MINIMUM_REQUIRED(VERSION 2.4) IF(COMMAND CMAKE_POLICY) CMAKE_POLICY(SET CMP0003 NEW) ENDIF(COMMAND CMAKE_POLICY) PROJECT(Hello) FIND_PACKAGE(VXL REQUIRED) IF(VXL_FOUND) INCLUDE_DIRECTORIES(${VXL_USE_FILE}) ENDIF(VXL_FOUND) ADD_EXECUTABLE(Hello Hello.cpp) TARGET_LINK_LIBRARIES(Hello vbl vcsl vgl vgui vidl vidl1 vidl_vil1 vil vil1 vnl vpl vsl vul) My Hello.cpp is as follows: // Include standard C++ input/output library #include vcl_iostream.h // main is the first function to be called int main() { // send string hello world to the standard // output stream cout. vcl_cout Hello world\n; // Must return something from main return 0; } I used CMake to generate the project files and there is no problems. But When try to run the project, I always receive the error: can't find the include file or directory 'vcl_iostream.h'. I am wondering if some of you can point out the errors. Thanks a lot replace INCLUDE_DIRECTORIES(${VXL_USE_FILE}) with INCLUDE(${VXL_USE_FILE}) 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] Where can i get cmake-gui rpm for RHEL5 (Redhat 5) (download the source code is even better) ?
Still no cmake-gui :-( I have no experience with RHEL but I believe cmake-gui requires Qt 4.4 or greater. What version of Qt do you have installed? 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] Does 2.8.0 rc4 not have the ZERO_CHECK fix?
On Thu, Oct 29, 2009 at 9:45 AM, Kevin Burge kevin.bu...@systemware.com wrote: Thanks, The fix for that is in 2.8.0 rc4. Are you still having this bug? 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: Does 2.8.0 rc4 not have the ZERO_CHECK fix?
-- Forwarded message -- From: Kevin Burge kevin.bu...@systemware.com Date: Thu, Oct 29, 2009 at 10:41 AM Subject: Re: [CMake] Does 2.8.0 rc4 not have the ZERO_CHECK fix? To: John Drescher dresche...@gmail.com I had a possibly related problem according to Bill Hoffman (windows frequently rebuilding targets). I just switched back from 2.9 20091027 to 2.8 and it started building one of the targets unnecessarily, but, I did not clean anything, I only re-ran cmake. I just confirmed - if I touch my CMakeLists.txt in the root of my tree, when I next run nmake it starts rebuilding my targets with 2.8.0 rc4. Now trying 2.9 20091027 the same exact way, to see if it does the same thing. It is doing the same thing. :( I misreported that 20091027 fixed my problem. Here's what I'm doing, building in bld source is in src. * I remove all files in bld * I run: %HOMEDRIVE%\Progra~1\cmake2~1.9\bin\cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=C:/home/kevin/work/run/all -DSWI_BUILD_XDS=ON -G NMake Makefiles ../src * I run nmake * I hit-ctrl C after it builds up to the 5th target or so (the first 3 are downloads, the next 2 are external builds via a custom external build script somewhat adapted from ExternalProject) * if I rerun nmake at this point, it starts building where it should (on the fifth target) * I open src\CMakeLists.txt add a byte, save, remove the byte, save. * I run nmake again, then it starts building all the targets again (after it reconfigures itself). cmake is not in my path, and I've sanitized my PATH variable so it basically only finds perl, ruby, VS2005, and windows system dirs (a requirement for my build). I've attached my Download script that mimics ExternalProject to some degree (I do not do the touch .-done). The first three targets are defined via (basically): set (stamp_dir ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-stamp) sw_add_external_library (${PROJECT_NAME} ${SWI_URL_PREFIX}/tsmapi/${_file} # URL of file to download ${stamp_dir} ) The second two are built by custom targets/commands also. Anyways, maybe I'm just doing something wrong with my custom targets. But, since it works fine on other platforms, it makes me think something is broken on windows. For the download code, that reconfigure step is even deleting my stamp_dir altogether. I have no idea why. I thought it might be because I wasn't explicitly creating it. But adding a make directory to the steps didn't help. Thanks, Kevin John Drescher wrote: On Thu, Oct 29, 2009 at 9:45 AM, Kevin Burge kevin.bu...@systemware.com wrote: Thanks, The fix for that is in 2.8.0 rc4. Are you still having this bug? John -- John M. Drescher # NOTE: DOWNLOAD with LOG is broken (causes timeout reached error) #LOG log if (AIX OR Solaris) # 280rc* crashes on these platforms using internal tar set (SWI_USE_INTERNAL_TAR false CACHE BOOL Use internal tar) else (AIX OR Solaris) set (SWI_USE_INTERNAL_TAR true CACHE BOOL Use internal tar FORCE) endif (AIX OR Solaris) if (NOT SWI_USE_INTERNAL_TAR) if (AIX) find_program(tar_EXECUTABLE gtar) elseif (UNIX) find_program(tar_EXECUTABLE tar) endif (AIX) if (tar_EXECUTABLE MATCHES NOTFOUND) message(FATAL_ERROR suitable tar executable not found) endif (tar_EXECUTABLE MATCHES NOTFOUND) endif (NOT SWI_USE_INTERNAL_TAR) # # simple script to download a file from a URL and copy to the current # binary directory # function (sw_write_download_script _script _url) get_filename_component (filename ${_url} NAME) set (dst ${SWI_DOWNLOAD_DIR}/${filename}) file(WRITE ${_script} if (EXISTS ${dst}) message(STATUS \warning: ${dst} already exists!\) else (EXISTS ${dst}) file ( DOWNLOAD ${_url} ${dst} STATUS status ) # TIMEOUT 30 # cmake280rc3 has a bug where it's using a double for timeout and passing to # long function. This is fixed in next release candidate. # list(GET status 0 status_code) list(GET status 1 status_string) if(NOT status_code EQUAL 0) message(FATAL_ERROR \error: downloading '${_url}' status_code: \${status_code} status_string: \${status_string} log: \${log}\ ) endif(NOT status_code EQUAL 0) endif (EXISTS ${dst}) file(COPY ${dst} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) ) endfunction (sw_write_download_script _script _url) # # simple script to extract a file and delete it after successful # extraction # function (sw_write_extract_script _script _file _tarflags) if (SWI_USE_INTERNAL_TAR) file(WRITE ${_script} execute_process ( COMMAND ${CMAKE_COMMAND} -E tar ${_tarflags} ${_file} RESULT_VARIABLE status OUTPUT_VARIABLE output ERROR_VARIABLE output ) if(NOT status EQUAL 0) message(FATAL_ERROR \error: extracting '${_file}' status: \${status} output: \${output}\ ) endif(NOT status EQUAL 0) file(REMOVE ${_file
Re: [CMake] RC3: Multiple ZERO_CHECK warnings
On Tue, Oct 27, 2009 at 6:35 PM, L.M. de Vries luis.de.vr...@upc.edu wrote: Hi, Running RC3 to generate a VS2008-project on Windows Vista generates the following warning ZERO_CHECK already exists (2 or 3 times). After that it works fine... This did not occur on 2.6. Any ideas? There is a second thread on the same topic today. To summarize, this is fixed in the cvs and will be in the rc4 which should be out in a few days. -- 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] Open Source Memory Checker
On Fri, Oct 23, 2009 at 2:13 PM, Steve Huston shus...@riverace.com wrote: If linux has valgrind which is an open source memory checker, is there any equivalent on Windows? I noticed ctest supports purify, but it looks like that's only a pay solution. Am I out of luck trying to find a memory checker that's open source on Windows? I've not heard of any. But IMO, Purify is worth the money IBM charges for it - you'll save more than that in time spent tracking down memory errors. Does it work well with complex applications? I have used boundschecker in the past (years ago) and now memoryvalidator but I find that these are very difficult to use when there are thousands of memory allocations tracked. I see way too many false positives (stl, boost, qt,mfc ...) and other issues. Also with these the memory corruption testing is way too slow to be helpful. It works fine on a small test project but fails miserably in an application with 1 million lines of code. 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] working around rc.exe too many -I# options
I am trying to add Windows versioning information to my project. I am using CMake 2.6.2 and VS2005. I have crafted a version.rc file which I use with all my libraries and executables. This is working well except for one library which has 94 include directories, one greater than the 93 directory limit (lol) imposed by rc.exe, the Windows resource compiler. Thus, I am running into this issue: http://social.msdn.microsoft.com/forums/en-US/vcgeneral/thread/97be1e3a-82ec-430d-a260-d75ea173b62e Yes, the library probably could/should be refactored to get rid of this excessive number of include dirs, but that's not how it is today and I would prefer not to change it at this time. Has anyone hacked around this problem? I have this in my main project. No, I have not found a good solution. I should have reported this months ago. Since I was busy at the time I just disabled the .rc and I have no icon.. 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] Turning off extra Visual Studio options
On Fri, Oct 16, 2009 at 2:16 PM, Steven Wilson steven.wesley.wil...@gmail.com wrote: Is there a way to turn off all the extra options that CMake tries to append to compiler flags, linker flags, etc for the Visual Studio generators? I have a project that I want to explicity control every option for some of my exes/libs. You can change these either in you CMakeLists.txt file or in cmake-gui or ccmake 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] Turning off extra Visual Studio options
On Fri, Oct 16, 2009 at 4:14 PM, Philip Lowman phi...@yhbt.com wrote: You may want to also look into platform override files. See the FAQ and search for override. Found that: http://www.itk.org/Wiki/CMake_FAQ#Make_Override_Files Thanks. I will have to bookmark 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
[CMake] Any recent guides to adding support for doxygen
I want to add doxygen support to my projects but my google searches are not finding good recent information on how to do this. Or has nothing changed in the last 3 years? -- 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] cpack: add icon to start menu
On Fri, Sep 25, 2009 at 4:36 PM, Dixon, Shane shane.di...@atmel.com wrote: I’m using the NSIS generator to create a package. Is there a CPACK variable that can be set to add a particular executable to the start menu? I noticed that the start menu is populated with “uninstall” only. This works for me. Here is that part of my CMakeLists.txt IF(PACKAGE_FOR_INSTALL) SET(CPACK_PACKAGE_VERSION_MAJOR ${LungAnalysis_VERSION_MAJOR}) SET(CPACK_PACKAGE_VERSION_MINOR ${LungAnalysis_VERSION_MINOR}) SET(CPACK_PACKAGE_VERSION_PATCH ${LungAnalysis_VERSION_PATCH}) IF(CMAKE_CL_64) SET(CMAKE_MSVC_ARCH amd64) ELSE(CMAKE_CL_64) SET(CMAKE_MSVC_ARCH x86) ENDIF(CMAKE_CL_64) IF(MSVC80) FIND_PROGRAM(MSVC_REDIST NAMES vcredist_${CMAKE_MSVC_ARCH}/vcredist_${CMAKE_MSVC_ARCH}.exe PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0;InstallDir]/../../SDK/v2.0/BootStrapper/Packages/ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\VisualStudio\\8.0;InstallDir]/../../SDK/v2.0/BootStrapper/Packages/ ) GET_FILENAME_COMPONENT(vcredist_name ${MSVC_REDIST} NAME) INSTALL(PROGRAMS ${MSVC_REDIST} COMPONENT Runtime DESTINATION bin) SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS ExecWait '\\\$INSTDIRbin${vcredist_name}\\\') ENDIF(MSVC80) IF(UNIX AND NOT APPLE) INSTALL(TARGETS HyvesDesktop DESTINATION bin ) FOREACH(LIB QtCore QtXml QtTest QtGui QtNetwork QtScript) INSTALL(FILES ${QT_LIBRARY_DIR}/lib${LIB}.so.${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH} RENAME lib${LIB}.so.${QT_VERSION_MAJOR} DESTINATION bin ) ENDFOREACH(LIB) ENDIF(UNIX AND NOT APPLE) IF(WIN32) SET(CPACK_NSIS_COMPRESSOR /SOLID lzma) SET(CPACK_PACKAGE_EXECUTABLES LungAnalysis Lung Analysis) INSTALL(FILES ${QT_LIBRARY_DIR}/QtCore${QT_VERSION_MAJOR}.dll ${QT_LIBRARY_DIR}/QtXml${QT_VERSION_MAJOR}.dll ${QT_LIBRARY_DIR}/QtTest${QT_VERSION_MAJOR}.dll ${QT_LIBRARY_DIR}/QtGui${QT_VERSION_MAJOR}.dll ${QT_LIBRARY_DIR}/QtNetwork${QT_VERSION_MAJOR}.dll ${QT_LIBRARY_DIR}/QtScript${QT_VERSION_MAJOR}.dll DESTINATION bin COMPONENT Applications ) ENDIF(WIN32) set(CPACK_COMPONENTS_ALL Applications Runtime) INCLUDE(CPack) ENDIF(PACKAGE_FOR_INSTALL) ___ 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] Win32 multi-platform settings
On Wed, Sep 23, 2009 at 3:36 PM, Steven Wilson steven.wesley.wil...@gmail.com wrote: Visual Studio supports having solution files where the solution can set the supported platform to x64 and yet have individual projects in the solution build for the Win32 platform despite having the solution set to x64. Can I configure CMake to set up projects/solutions in this fashion? No. Check the archives. This was asked a few weeks back. Probably in August. 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.6.4 won't find boost 1.40 on windows
On Fri, Sep 18, 2009 at 5:01 PM, Ingolf Steinbach ingolf.steinb...@googlemail.com wrote: 2009/9/18 John Drescher dresche...@gmail.com: You set BOOST_ROOT in your windows environment variables. Sorry, but I'd consider this just a workaround. From the discussion in this thread, I have the impression that the only purpose of setting the BOOST_ROOT environment variable is to tell FindBoost what the module should be able to do on its own: find Boost. IOW: If I have to tell cmake which exact version I am looking for and where this version is installed, why would I want to FindBoost at all? It's difficult on windows since there is no standard location for stuff like this. A lot of people dump this on C:\ but that is definitely not where I have any source code or libraries. This is not even on C: at all. What is the FindBoost to do search all paths that are valid for the current user? 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.6.4 won't find boost 1.40 on windows
On Thu, Sep 17, 2009 at 6:10 PM, Cristian Adam cristian.a...@gmx.net wrote: James C. Sutherland wrote: From FindBoost.cmake: # These last three variables are available also as environment variables: # # BOOST_ROOT or BOOSTROOT The preferred installation prefix for searching for # Boost. Set this if the module has problems finding # the proper Boost installation. Did you try setting one of these variables? Now I've tried setting BOOST_ROOT, but I don't see a big improvement over BOOST_INCLUDEDIR :) #set(BOOST_INCLUDEDIR c:/boost/include/boost-1_40) set(BOOST_ROOT c:/boost/include/boost-1_40) You set BOOST_ROOT in your windows environment variables. 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] VTK with QT options: VTK_USE_QVTK not available
I'm working with ubuntu 9.04 I compiled QT(4.5.2) doing ./configure, make, make install. Then I downloaded cmake (2.6.4) : sudo apt-get install cmake Now I downloaded the sources of VTK(5.4.2) and VTK Data and I want to compile it. I want to use VTK with QT. so I go in the folder where I want to build VTK (/home/VTK-build) I run ccmake ../VTK . The probleme is that in CMake I don't have the options DESIRED_QT_VERSION and VTK_QT_USE_WEBKIT and VTK_USE_GUISUPPORT and VTK_USE_QVTK so I can't turn it on and I assume that it will engender troubles when I will compile a VTK/QT project... Do you know why this problem appears and do you know if it is really a problem. Thanks a lot, Nicolas I believe VTK_USE_GUISUPPORT should be available on the first run of cmake. After you accept that. VTK_USE_QVTK should be available. Then DESIRED_QT_VERSION. 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] is ccmake reliable?
So assuming that I wanted my CMakeLists.txt file to modify the default install location, but allow the user to change this, wouldn't I do something like: set( CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_BINARY_DIR} CACHE PATH installation path ) This doesn't work - I assume that this is because CMAKE_INSTALL_PREFIX is a special (internally defined) variable? When I run ccmake and configure, the value remains as /usr/local. Here is what I do in my cuurent project: IF(WIN32) #The following command changes \ to / in the Program Files Path so CMake will not complain #about bad escape sequences. 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) SET (CMAKE_INSTALL_PREFIX ${PGM_FILES}/UPMC/${CMAKE_PROJECT_NAME} CACHE STRING Default Install Path FORCE) configure_file ( ${PROJECT_SOURCE_DIR}/install.bat.in ${PROJECT_BINARY_DIR}/Batch/install.bat ) ENDIF(WIN32) 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] is ccmake reliable?
Looks like the default for CMAKE_INSTALL_PREFIX comes from CMakeGenericSystem.cmake: # Set a variable to indicate whether the value of CMAKE_INSTALL_PREFIX # was initialized by the block below. This is useful for user # projects to change the default prefix while still allowing the # command line to override it. IF(NOT DEFINED CMAKE_INSTALL_PREFIX) SET(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT 1) ENDIF(NOT DEFINED CMAKE_INSTALL_PREFIX) IF(CMAKE_HOST_UNIX) SET(CMAKE_INSTALL_PREFIX /usr/local CACHE PATH Install path prefix, prepended onto install directories.) ELSE(CMAKE_HOST_UNIX) [...] The comment above the first stanza is interesting. I guess its intended use is for something like this: if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set (CMAKE_INSTALL_PREFIX myPrefix CACHE FORCE ...) endif () Maybe a more seasoned CMaker can verify if this is the Right Way to do what you want. I am going to have to bookmark this reply since I have no time to play with my CMakeLists files now. That would be a much better solution than me always forcing a value like the way I posted in this thread. Thank You. 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 cmake to configure a 32 bit project on Windows 64 Bit OS
On Wed, Sep 9, 2009 at 2:52 PM, Mike Jackson mike.jack...@bluequartz.net wrote: I tried the following: Open the Visual Studio 2008 Command Prompt Navigate to my project. CMake -G Visual Studio 9 2008 ../ and I get the error that says the C compiler can not compile a simple test program. Looking at the error log it would seem that cl.exe isn't on the path anywhere. I double checked by running vcvars.bat again but nothing. Pretty sure I just did the standard install for VS 2008 Standard Edition. This is on Windows 7 x64. Maybe I can't build 32 bit apps with the standard edition? Dunno but I bet there is someone in CMake land who has hit this problem and I am sure it is something simple that I am missing. Did you run CMake from the 32 bit command prompt or the x64 one? 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 cmake to configure a 32 bit project on Windows 64 Bit OS
On Wed, Sep 9, 2009 at 3:22 PM, Mike Jackson mike.jack...@bluequartz.net wrote: And just to follow up, all I had to do was Add Components to the already installed VC++ tools to add the Visual C# package and now it looks like I am in business.. Sorry for the noise. Actually thanks. I am not using 2008 for my CMake builds yet however I do have that installed on my 64 bit xp development box. So if I do start using 2008, I'd better make sure the 32 bit compiler is installed.. 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 install problem
On Thu, Sep 3, 2009 at 2:13 PM, Dean Inglisdean.ing...@camris.ca wrote: Hi, I originally posted this thread to kwwidgets, but have not had much success and perhaps this is a cpack/cmake issue Im having. I¹m building stand alone applications using VTK, ITK, GDCM, KWWidgets and I I'm recently having problems getting my apps to run on windows (XP, Vista 32 bit) platforms where the installer is generated by cpack (NSIS). The apps/toolkits tcl/tk are all statically built and linked in Release mode using MS Visual Studio Express 2005. I am compiling using the command line tools (nmake). I keep getting: The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log for more detail. Installing vcredist_x86.exe does not help as was suggested on some MS forums. As an example, the installer installs C:\Program Files\MyApp\bin\myKWWidgetsApp.exe C:\Program Files\MyApp\bin\Microsoft.VC80.CRT.manifest C:\Program Files\MyApp\bin\ msvcm80.dll C:\Program Files\MyApp\bin\ msvcp80.dll C:\Program Files\MyApp\bin\ msvcr80.dll BTW, I do not think you can just copy those msvc dlls anymore. I have my CMakeLsts.txt package vcredist and install that automatically for me: So I have this in my CPack setup for my main project: IF(CMAKE_CL_64) SET(CMAKE_MSVC_ARCH amd64) ELSE(CMAKE_CL_64) SET(CMAKE_MSVC_ARCH x86) ENDIF(CMAKE_CL_64) IF(MSVC80) FIND_PROGRAM(MSVC_REDIST NAMES vcredist_${CMAKE_MSVC_ARCH}/vcredist_${CMAKE_MSVC_ARCH}.exe PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0;InstallDir]/../../SDK/v2.0/BootStrapper/Packages/ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\VisualStudio\\8.0;InstallDir]/../../SDK/v2.0/BootStrapper/Packages/ ) GET_FILENAME_COMPONENT(vcredist_name ${MSVC_REDIST} NAME) INSTALL(PROGRAMS ${MSVC_REDIST} COMPONENT Runtime DESTINATION bin) SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS ExecWait '\\\$INSTDIRbin${vcredist_name}\\\') ENDIF(MSVC80) 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 install problem
The fix is to rebuild everything with the same version (SP) of visual studio. A single exe should not have more than one of these things in it. If it does then you have to do the redist thing. If it only has one, which is possible, then you can ship the libraries and not have to install into the system with redist. If there is one .obj or one .dll that was built with a slight different version of VS, then you get this problem, and the side by side manifest will not work. The redist.exe works by installing all of them into the system. It requires administrator rights to do this, and installs them for the whole computer. Bill, Thank You. Good to know, I will rebuild ITK, Qt and VTK probably at the next release of ITK which should be in the next few weeks. 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] weird output with ctest
I have the following command in my CMakeLists.txt and I run the test using the command ctest -VV -R test. However the test results doesn't print anything that I defined on the test code, it just shows the test passed. add_test(test ../build/gbc 0.1 0.3 0.5 0.7 0.9) That is all it is supposed to 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
[CMake] Fwd: weird output with ctest
Well problem is why doesn't it print the std::cout that I've put inside main? while it's running main I believe not printing any stdout from your application is intentional so not to interfere with the CTest output. I prefer it this way. There could be a way to activate this, I do not know. 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 CTest tests
On Fri, Aug 28, 2009 at 12:57 PM, Aditya Herlambangaditya15...@hotmail.com wrote: Hello, I am really a total noob in this CTest stuffs, I read the documentation and it says that I need to use the ADD_TEST method to test an executable right? the format is the following: ADD_TEST(test1 ../build/executable 1) where test1 is the name of the test and 1 is the argument passed to the executable. Question is how do I specify if the test pass then print something, otherwise print the other thing? You should not be printing anything. I mean from your main return 0 for success any thing non zero for failure. 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: generating CTest tests
-- Forwarded message -- From: John Drescher dresche...@gmail.com Date: Fri, Aug 28, 2009 at 1:53 PM Subject: Re: [CMake] generating CTest tests To: Alex H aditya15...@hotmail.com On Fri, Aug 28, 2009 at 1:38 PM, Alex Haditya15...@hotmail.com wrote: Hello, In the ADD_TEST command in the example below I mentioned the test name is test1, is this only a naming thing or does it mean that I have to have an actual file called test1 in the system to be run by the executable? Sorry, I read the documentation several times and still don't understand as somewhere on the documentation it also mentions test files, I am not sure what to put inside this test file though. Should I put this ADD_TEST inside the test file or the CMakeLists.txt? Thanks Alex You make a separate target for this. Here is an example. I have a main project Called QtBasicUtils in that main project I have in the main application CMakeLists.txt option (BUILD_TESTING Build Tests ON) IF(BUILD_TESTING) ENABLE_TESTING() add_subdirectory(Testing) ENDIF(BUILD_TESTING) And then in the CMakeLists.txt file in QtBasicUtils/Testing #This file contains the automated unit testing for QtBasicUtils LINK_LIBRARIES(BasicTest QtBasicUtils ${QT_LIBRARIES}) include_directories( ${PROJECT_BINARY_DIR} ${PROJECT_BINARY_DIR}/.. ${PROJECT_SOURCE_DIR}/include ./include) set(TEST_SRCS ./src/basic.cxx ./src/testxml.cxx ./src/testUserProps.cxx ) set(TEST_HDRS ./include/testxml.h ./include/testUserProps.h ) add_executable(BasicTest ${TEST_SRCS} ${TEST_HDRS}) add_dependencies(BasicTest QtBasicUtils) file(WRITE ${EXECUTABLE_OUTPUT_PATH}/test0.txt +FLOATARGS 1.0 2.0 2.0 2.0 2.0 -S9.0) add_test(FileCMD0 ${EXECUTABLE_OUTPUT_PATH}/BasicTest @${EXECUTABLE_OUTPUT_PATH}/test0.txt) #This will fail because the file should not exist. add_test(FileCMD1 ${EXECUTABLE_OUTPUT_PATH}/BasicTest @${EXECUTABLE_OUTPUT_PATH}/../test11.txt) SET_TESTS_PROPERTIES(FileCMD1 PROPERTIES WILL_FAIL TRUE) ADD_TEST(Test0 ${EXECUTABLE_OUTPUT_PATH}/BasicTest +?) ADD_TEST(Test1 ${EXECUTABLE_OUTPUT_PATH}/BasicTest +Test 1.0) ADD_TEST(StringListArg0 ${EXECUTABLE_OUTPUT_PATH}/BasicTest +STRLSTARG 1 2 3 4 . -S10) ADD_TEST(StringListArg1 ${EXECUTABLE_OUTPUT_PATH}/BasicTest +STRLSTARG 1 2 3 . -S6) ADD_TEST(StringListOpt0 ${EXECUTABLE_OUTPUT_PATH}/BasicTest +STRLSTOPT -I1 2 3 . -S6) ADD_TEST(StringListOpt1 ${EXECUTABLE_OUTPUT_PATH}/BasicTest +STRLSTOPT -I1 2 3 4 . -S10) ADD_TEST(BoolOpt1 ${EXECUTABLE_OUTPUT_PATH}/BasicTest +BOOLOPT -B) ADD_TEST(BoolOpt2 ${EXECUTABLE_OUTPUT_PATH}/BasicTest +BOOLOPT -B-) SET_TESTS_PROPERTIES(BoolOpt2 PROPERTIES WILL_FAIL TRUE) ADD_TEST(ExtBoolOpt1 ${EXECUTABLE_OUTPUT_PATH}/BasicTest +EXTBOOLOPT --use_extended=+) ADD_TEST(ExtBoolOpt2 ${EXECUTABLE_OUTPUT_PATH}/BasicTest +EXTBOOLOPT --use_extended=-) ADD_TEST(ExtBoolOpt3 ${EXECUTABLE_OUTPUT_PATH}/BasicTest +EXTBOOLOPT --use_extended+) ADD_TEST(ExtBoolOpt4 ${EXECUTABLE_OUTPUT_PATH}/BasicTest +EXTBOOLOPT --use_extended-) ADD_TEST(ExtBoolOpt5 ${EXECUTABLE_OUTPUT_PATH}/BasicTest +EXTBOOLOPT --use_extended) SET_TESTS_PROPERTIES(ExtBoolOpt2 PROPERTIES WILL_FAIL TRUE) SET_TESTS_PROPERTIES(ExtBoolOpt4 PROPERTIES WILL_FAIL TRUE) ADD_TEST(FloatArgs0 ${EXECUTABLE_OUTPUT_PATH}/BasicTest +FLOATARGS 1.0 -S5.0) ADD_TEST(FloatArgs1 ${EXECUTABLE_OUTPUT_PATH}/BasicTest +FLOATARGS 2.0 -S6.0) ADD_TEST(FloatArgs2 ${EXECUTABLE_OUTPUT_PATH}/BasicTest +FLOATARGS 1.0 1.0 -S5.0) ADD_TEST(FloatArgs3 ${EXECUTABLE_OUTPUT_PATH}/BasicTest +FLOATARGS 1.0 2.0 -S6.0) ADD_TEST(FloatArgs4 ${EXECUTABLE_OUTPUT_PATH}/BasicTest +FLOATARGS 1.0 1.0 1.0 1.0 1.0 -S5.0) ADD_TEST(FloatArgs5 ${EXECUTABLE_OUTPUT_PATH}/BasicTest +FLOATARGS 2.0 2.0 2.0 2.0 2.0 -S10.0) ADD_TEST(FloatArgs6 ${EXECUTABLE_OUTPUT_PATH}/BasicTest +FLOATARGS -2.0 2.0 2.0 2.0 2.0 -S6.0) ADD_TEST(FloatArgs7 ${EXECUTABLE_OUTPUT_PATH}/BasicTest +FLOATARGS 1.0 2.0 2.0 2.0 2.0 -S10.0) SET_TESTS_PROPERTIES(FloatArgs7 PROPERTIES WILL_FAIL TRUE) ADD_TEST(FloatArgs8 ${EXECUTABLE_OUTPUT_PATH}/BasicTest +FLOATARGS 1.0 2.0 2.0 2.0 2.0 1.0 -S10.0) SET_TESTS_PROPERTIES(FloatArgs8 PROPERTIES WILL_FAIL TRUE) ADD_TEST(DoubleArgs0 ${EXECUTABLE_OUTPUT_PATH}/BasicTest +DOUBLEARGS 1.0 -S5.0) ADD_TEST(DoubleArgs1 ${EXECUTABLE_OUTPUT_PATH}/BasicTest +DOUBLEARGS 2.0 -S6.0) ADD_TEST(DoubleArgs2 ${EXECUTABLE_OUTPUT_PATH}/BasicTest +DOUBLEARGS 1.0 1.0 -S5.0) ADD_TEST(DoubleArgs3 ${EXECUTABLE_OUTPUT_PATH}/BasicTest +DOUBLEARGS 1.0 2.0 -S6.0) ADD_TEST(DoubleArgs4 ${EXECUTABLE_OUTPUT_PATH}/BasicTest +DOUBLEARGS 1.0 1.0 1.0 1.0 1.0 -S5.0) ADD_TEST(DoubleArgs5 ${EXECUTABLE_OUTPUT_PATH}/BasicTest +DOUBLEARGS 2.0 2.0 2.0 2.0 2.0 -S10.0) ADD_TEST(DoubleArgs6
Re: [CMake] Fwd: generating CTest tests
On Fri, Aug 28, 2009 at 2:07 PM, Alex Haditya15...@hotmail.com wrote: Hello, My problem is actually really simple I have a .cpp file and the program just basically take an int as an argument, if the argument is from certain numbers it returns a 1 otherwise 0. Now I need to create a unit test that would allow me to do this... how can I check the return value of the program? The add_test command just adds the test to be performed using a specific argument but it never tests the output... CMake automatically does this for you when you build the RUN_TESTS target on Visual Studio or do a make test on other systems Here is an example of the output of RUN_TESTS under visual studio 2005 for the project I posted the CMakeLists.txt 1Performing Post-Build Event... 1Start processing tests 1Test project X:/32Bit/VC.80/Qt/QtBasicUtils 1 1/ 48 Testing FileCMD0 . Passed0.55 sec 1 2/ 48 Testing FileCMD1 . Passed1.58 sec 1 3/ 48 Testing Test0 Passed0.17 sec 1 4/ 48 Testing Test1 Passed0.16 sec 1 5/ 48 Testing StringListArg0 ... Passed0.06 sec 1 6/ 48 Testing StringListArg1 ... Passed0.06 sec 1 7/ 48 Testing StringListOpt0 ... Passed0.16 sec 1 8/ 48 Testing StringListOpt1 ... Passed0.06 sec 1 9/ 48 Testing BoolOpt1 . Passed0.16 sec 1 10/ 48 Testing BoolOpt2 . Passed0.14 sec 1 11/ 48 Testing ExtBoolOpt1 .. Passed0.25 sec 1 12/ 48 Testing ExtBoolOpt2 .. Passed0.16 sec 1 13/ 48 Testing ExtBoolOpt3 .. Passed0.06 sec 1 14/ 48 Testing ExtBoolOpt4 .. Passed0.16 sec 1 15/ 48 Testing ExtBoolOpt5 .. Passed0.17 sec 1 16/ 48 Testing FloatArgs0 ... Passed0.19 sec 1 17/ 48 Testing FloatArgs1 ... Passed0.06 sec 1 18/ 48 Testing FloatArgs2 ... Passed0.16 sec 1 19/ 48 Testing FloatArgs3 ... Passed0.16 sec 1 20/ 48 Testing FloatArgs4 ... Passed0.16 sec 1 21/ 48 Testing FloatArgs5 ... Passed0.16 sec 1 22/ 48 Testing FloatArgs6 ... Passed0.14 sec 1 23/ 48 Testing FloatArgs7 ... Passed0.16 sec 1 24/ 48 Testing FloatArgs8 ... Passed1.30 sec 1 25/ 48 Testing DoubleArgs0 .. Passed0.16 sec 1 26/ 48 Testing DoubleArgs1 .. Passed0.16 sec 1 27/ 48 Testing DoubleArgs2 .. Passed0.14 sec 1 28/ 48 Testing DoubleArgs3 .. Passed0.19 sec 1 29/ 48 Testing DoubleArgs4 .. Passed0.16 sec 1 30/ 48 Testing DoubleArgs5 .. Passed0.06 sec 1 31/ 48 Testing DoubleArgs6 .. Passed0.14 sec 1 32/ 48 Testing DoubleArgs7 .. Passed0.16 sec 1 33/ 48 Testing DoubleArgs8 .. Passed2.03 sec 1 34/ 48 Testing XMLExport0 ... Passed0.17 sec 1 35/ 48 Testing XMLExport1 ... Passed0.17 sec 1 36/ 48 Testing XMLExport2 ... Passed0.14 sec 1 37/ 48 Testing XMLExport3 ... Passed0.14 sec 1 38/ 48 Testing XMLExport4 ... Passed0.14 sec 1 39/ 48 Testing XMLExport5 ... Passed0.17 sec 1 40/ 48 Testing XMLExport6 ... Passed0.14 sec 1 41/ 48 Testing UserProp0 Passed0.14 sec 1 42/ 48 Testing UserProp1 Passed0.16 sec 1 43/ 48 Testing UserProp2 Passed0.06 sec 1 44/ 48 Testing UserProp3 Passed0.14 sec 1 45/ 48 Testing UserProp4 Passed0.16 sec 1 46/ 48 Testing UserProp5 Passed0.14 sec 1 47/ 48 Testing UserProp6 Passed0.22 sec 1 48/ 48 Testing UserProp7 Passed0.14 sec 1100% tests passed, 0 tests failed out of 48 1Total CPU time = 11.78 sec 1Build log was saved at file://x:\32Bit\VC.80\Qt\QtBasicUtils\RUN_TESTS.dir\RelWithDebInfo\BuildLog.htm 1RUN_TESTS - 0 error(s), 0 warning(s) == Build: 1 succeeded, 0 failed, 1 up-to-date, 0 skipped == ___ 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 build 2 targets from the same source, differing in -D_SWITCHES_ only
On Thu, Aug 27, 2009 at 8:55 AM, Eike Kroemereike-michael.kroe...@atlas-elektronik.com wrote: Hi Marcel, Christian, Am 08/27/2009 01:30 PM Marcel Loose wrote: I think the only safe and reliable way to do this is create several build directories, e.g. build/type_1 and build/type_2. When running cmake in build/type_1, you should add -D_TYPE1_ to the preprocessor flags; same for build/type_2. By 'build directories' you mean to duplicate the library sourcecodes? Not the source just the output. You put your source in a single folder and then create 1 build tree for each different type of build you want. On windows I use this to build my projects with different compilers and on top of that I use this to create separate 32 and 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] linking libraries at many levels
On Tue, Aug 25, 2009 at 9:06 AM, Pol Monsó IRIpmo...@iri.upc.edu wrote: Hello cmake users! I'm quite new to cmake as well as makefiles, and i've bumped the same trouble twice. I'm trying to break a source code into several libraries and a main program. The scenario has one main executable called calClient which uses functions from three libraries, let's say 1A 1B and 2C. Everybody uses library 2C, that is calClient, 1A and 1B. I've stored the source codes of 1A 1C and 2C in a subdirectory called lib/ toghether with a CMakeLists.txt : FIND_PACKAGE(YARP REQUIRED) SET(PROJECT_LIBS 2C.cpp 2C.h 1B.cpp 1B.h 1A.cpp 1A.hpp ) add_library(callibs ${PROJECT_LIBS}) In the upper directory, toghether with the source code of the main program, I have: project(calibration) cmake_minimum_required(VERSION 2.6) set(CMAKE_CXX_FLAGS -g -Wall) set(PROJECT_SRC calClient.cpp calClient.hpp chaser.cpp chaser.hpp ) FIND_PACKAGE(YARP REQUIRED) FIND_PACKAGE(OpenCV REQUIRED) add_subdirectory(lib) INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/lib) link_directories(lib) INCLUDE_DIRECTORIES(${OPENCV_INCLUDE_DIR}) ADD_EXECUTABLE(calClient ${PROJECT_SRC}) TARGET_LINK_LIBRARIES( calClient ${OPENCV_LIBRARIES} ) TARGET_LINK_LIBRARIES( calClient callibs ) Every header includes the headers of the files which contains the functions that it needs. So, calClient.hpp actually includes 1A, 1B and 2C. The output of the make command is then: [ 60%] Built target callibs Linking CXX executable calClient CMakeFiles/calClient.dir/calClient.cpp.o: In function `incrementalCalibrate(yarp::dev::IPositionControl*, yarp::dev::IEncoders*)': /home/pmonso/YARP/Calclient/calClient.cpp:276: undefined reference to `print_double_array(double const*, int)' /home/pmonso/YARP/Calclient/calClient.cpp:277: undefined reference to `print_double_array(double const*, int)' /home/pmonso/YARP/Calclient/calClient.cpp:295: undefined reference to `print_double_array(double const*, int)' CMakeFiles/calClient.dir/calClient.cpp.o: In function `calibrate(yarp::dev::IPositionControl*, yarp::dev::IEncoders*)': /home/pmonso/YARP/Calclient/calClient.cpp:155: undefined reference to `print_double_array(double const*, int)' CMakeFiles/calClient.dir/calClient.cpp.o: In function `randomCalibrate(yarp::dev::IPositionControl*, yarp::dev::IEncoders*)': /home/pmonso/YARP/Calclient/calClient.cpp:207: undefined reference to `print_double_array(double const*, int)' CMakeFiles/calClient.dir/calClient.cpp.o:/home/pmonso/YARP/Calclient/calClient.cpp:208: more undefined references to `print_double_array(double const*, int)' follow collect2: ld returned 1 exit status make[2]: *** [calClient] Error 1 make[1]: *** [CMakeFiles/calClient.dir/all] Error 2 make: *** [all] Error 2 The function print_double_array is located in the 2C source and header files which, as I said, is included in calClient header as well as in headers of 1A and 1B. Does somebody know why linking fails? What I am doing wrong? It's driving me nuts! I do not see you linking to yarp (whatever that is). 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] Cross-compilation related question
On Tue, Aug 25, 2009 at 12:56 PM, Xiangyun Kongxyk...@yahoo.com wrote: Thanks. After I use the new generator, it always looks for the 32 bit cl.exe at vc_root/VC/bin, and complain that the cl.exe does not work, even though I set the PATH as vc_root/VC/bin/x86_amd64. I used to use NMake Makefile, which does not complain about that. Don't you need Visual Studio x64 installed to generate 64 bit code? I did not believe installing that is possible on a 32 bit version of windows. 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] Finding Qt4 binaries under Windows
So, if you compiled to C:\Qt\4.5.1 then you have a couple of options: set QTDIR to C:\Qt\4.5.1 in the environment variables. OR find_package(Qt4 PATHS C:/Qt/4/.5.1) like Pau suggested. If you don't like the version number on there then recompile Qt 4.5.1 so that it has a path of C:\Qt and NOT C:\Qt\4.5.1 I just let cmake-gui try to find it and when it fails I manually set the location of the qmake executable. This way I can have more than 1 Qt version installed and I do not have to play with environment variables to switch between versions. After telling cmake-gui where qmake.exe is for a project it will never ask me again unless I clear the cache. I guess I could create a batch file that launches cmake-gui with a different environment to do this but its not like I do this ever day.. 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