[cmake-developers] [CMake 0011503]: cmake fails to remove non existent file
The following issue has been SUBMITTED. == http://www.cmake.org/Bug/view.php?id=11503 == Reported By:blaudden Assigned To: == Project:CMake Issue ID: 11503 Category: (No Category) Reproducibility:random Severity: major Priority: normal Status: new == Date Submitted: 2010-11-24 07:56 EST Last Modified: 2010-11-24 07:56 EST == Summary:cmake fails to remove non existent file Description: cmake spuriously fails to remove files which it has produced during try compile with error No such file or directory. Since the file does not exist anymore, I think this should be reported as a success to remove the file. Steps to Reproduce: cmake -G Visual Studio 9 2008 Win64 -- Check for working C compiler: cl -- Check for working C compiler: cl -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working CXX compiler: cl -- Check for working CXX compiler: cl -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detected 64-bit platform. snip -- Looking for sys/types.h CMake Error: Remove failed on file: C:/club/bzr_mysql-5.1-telco-7.0/1019/mysql-5.1.51-ndb-7.0.21-pb1019/CMakeFiles/CMakeTmp/Debug/cmTryCompileExec.exe: System Error: No such file or directory Additional Information: Looking in Source/cmCoreTryCompile.cc I see a retry loop which retries the RemoveFile() 5 time with half a second delay. Would suggest that the loop is extended to also check if file still exists. Maybe something like below? cmake-2.8.3$ diff -u Source/cmCoreTryCompile.cxx Source/cmCoreTryCompile.cxx.orig --- Source/cmCoreTryCompile.cxx2010-11-24 09:55:33.0 +0100 +++ Source/cmCoreTryCompile.cxx.orig2010-11-24 09:54:38.0 +0100 @@ -408,7 +408,7 @@ cmSystemTools::Delay(500); if(cmSystemTools::RemoveFile(fullPath.c_str())) { -removed = FileExists(fullPath.c_str()); +removed = true; } numAttempts++; } == Issue History Date ModifiedUsername FieldChange == 2010-11-24 07:56 blaudden New Issue == ___ cmake-developers mailing list cmake-developers@cmake.org http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Re: [CMake] howto re-run file(COPY signature ?
On 11/24/2010 04:44 AM, Dominique Belhachemi wrote: Hello, I am using the following command in my CMakeLists.txt file to copy a directory with all sub-directories from the source tree to a directory in the binary tree. file(COPY ${SRCDIR} DESTINATION ${CMAKE_BINARY_DIR}/${DSTDIR}/ PATTERN .svn EXCLUDE ) After adding this line to CMakeLists.txt and typing 'make' the command is working like expected. But after adding a new file to ${SRCDIR} and typing 'make' again, the new file doesn't get copied. I have to do a 'touch CMakeLists.txt' first. Is there a way to enforce the execution? You might outsource the FILE(COPY ...) command to a CMake script which is invoked by a custom target, e.g. as in the following CMakeLists.txt: CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR) PROJECT(COPYTREE NONE) ADD_CUSTOM_TARGET(copytree ALL ${CMAKE_COMMAND} -DSRC=${CMAKE_SOURCE_DIR} -DDST=/tmp/${PROJECT_NAME} -P ${CMAKE_SOURCE_DIR}/copytree.cmake ) The ${CMAKE_SOURCE_DIR}/copytree.cmake script simply looks like: FILE(COPY ${SRC} DESTINATION ${DST} PATTERN .svn EXCLUDE) Because FILE(COPY ...) copies files and directories only if they are new or have been touched you can probably afford the script's execution each time you build; use ADD_DEPENDENCIES() to ensure that the script runs at the right time. Regards, Michael ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] set CMAKE_INSTALL_PREFIX in CMakeLists
On 23-11-2010 at 15:37, in message 1290523061.2001.8.ca...@gildemeister-2, Micha Renner micha.ren...@t-online.de wrote: Am Dienstag, den 23.11.2010, 15:01 +0100 schrieb Michael Wild: On 11/23/2010 02:33 PM, Micha Renner wrote: Am Dienstag, den 23.11.2010, 14:01 +0100 schrieb tomas...@sbc.su.se: Dear Cmake users, 1) I am trying to set CMAKE_INSTALL_PREFIX in the CMakeLists file with SET(CMAKE_INSTALL_PREFIX, my/path) ^ No comma! greetings Micha And *NEVER EVER* set CMAKE_INSTALL_PREFIX in your CMakeLists.txt file. That is a user-setting and you will make people angry at you if you override their choice in your code. Okay, then this might help: IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) SET(CMAKE_INSTALL_PREFIX /usr/local CACHE PATH Foo install prefix FORCE) ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) Of course, this is not my idea. It had someone from kitware, I don't remember who it was. greetings Micha Hi Micha, I would prefer to use SET(CMAKE_INSTALL_PREFIX /foo/bar CACHE PATH Foo install prefix) So, without the test to CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT, and without the FORCE option. Reason: if someone unsets CMAKE_INSTALL_PREFIX on the command-line with -U, CMAKE_INSTALL_PREFIX will default to /foo/bar (which is the project's default), instead of /usr/local (which is CMake's default). Just my 2cts. Marcel Loose. ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] Linker Flags
Hi all, i am trying to crosscompile one of my projects. Iam using some linker flags for that: SET(CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS} -m5307 -Wl,-elf2flt -Os -lc) The following link command will be generated, but I need the -lc option at the end of the line. /usr/bin/cmake -E cmake_link_script CMakeFiles/ethgate.dir/link.txt -- verbose=1 /usr/local/bin/m68k-elf-gcc -m5307 -Wl,-elf2flt -Os -lc CMakeFiles/ethgate.dir/src/ethgate.c.o CMakeFiles/ethgate.dir/src/serveritf.c.o CMakeFiles/ethgate.dir/src/ident_service.c.o CMakeFiles/ethgate.dir/src/dbgitf.c.o CMakeFiles/ethgate.dir/src/debug.c.o -o ethgate -rdynamic This command works but the above one doesn't. /usr/local/bin/m68k-elf-gcc -m5307 -Wl,-elf2flt -Os CMakeFiles/ethgate.dir/src/ethgate.c.o CMakeFiles/ethgate.dir/src/serveritf.c.o CMakeFiles/ethgate.dir/src/ident_service.c.o CMakeFiles/ethgate.dir/src/dbgitf.c.o CMakeFiles/ethgate.dir/src/debug.c.o -o ethgate -lc So what do I have to change to get that command. And how can I remove - rdynamic ? Many thanks for any help. -- Danke Gruss Reinhard ___ 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] How to resolve conflicts between custom and imported targets?
Hello, I am facing a problem here on conflicts between imported targets and custom targets. Basically I want to override an imported target by a custom target of the same name. A solution like avoiding clashes using NAMESPACE on EXPORT doesn't really work for me as the identical naming is more or less intended (*). Still I've been doing some gymnastics with using NAMESPACE and then 'importing' single targets over into the local 'namespace' . That resulted in a lot of fragile parsing-like code and just didn't work... So I ended up looking into the source code of cmake to see what's going on under the hood. And a new policy like ALLOW_OVERRIDE_IMPORT_TARGETS in cmMakefile would come handy (wouldn't be too different from ALLOW_DUPLICATE_CUSTOM_TARGETS I think). Giving it a quick shot it worked like a charm. Nevertheless I would hope to find a solution using already existing functionality. Maybe you have an idea what to do instead. Thanks, Benedikt (*) The use case is the following: we have a few hundred particle physicists working on a software project with a few MLOC. To facilitate the development we provide a hybrid environment - there is one central installation with a fully built and installed release. And then every user can set up a development area, check out newer package-versions from the repository, which override the ones in the central area, and do his development. At the moment this is handled by a custom build tool which we plan to replace by cmake. For cmake my current approach is having the central area as one project that exports all its targets. And the development area as another project importing these. ___ 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] providing library information, what's the cmake way
In KDE we have a macro MACRO_WRITE_BASIC_CMAKE_VERSION_FILE() which helps with creating a basic version-info file which should be installed along with the Config-file. It consists of MacroWriteBasicCMakeVersionFile.cmake and BasicFindPackageVersion.cmake.in which you can find in http://websvn.kde.org/trunk/KDE/kdelibs/cmake/modules/ . I wonder why you use get_filename_component(_currentListFileDir ${CMAKE_CURRENT_LIST_FILE} PATH) in there instead of CMAKE_CURRENT_LIST_DIR. Eike ___ 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] Linker Flags
On Wednesday 24 November 2010 12:05:49 Reinhard Thies wrote: Hi all, i am trying to crosscompile one of my projects. Iam using some linker flags for that: SET(CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS} -m5307 -Wl,-elf2flt -Os -lc) The following link command will be generated, but I need the -lc option at the end of the line. /usr/bin/cmake -E cmake_link_script CMakeFiles/ethgate.dir/link.txt -- verbose=1 /usr/local/bin/m68k-elf-gcc -m5307 -Wl,-elf2flt -Os -lc CMakeFiles/ethgate.dir/src/ethgate.c.o CMakeFiles/ethgate.dir/src/serveritf.c.o CMakeFiles/ethgate.dir/src/ident_service.c.o CMakeFiles/ethgate.dir/src/dbgitf.c.o CMakeFiles/ethgate.dir/src/debug.c.o -o ethgate -rdynamic This command works but the above one doesn't. /usr/local/bin/m68k-elf-gcc -m5307 -Wl,-elf2flt -Os CMakeFiles/ethgate.dir/src/ethgate.c.o CMakeFiles/ethgate.dir/src/serveritf.c.o CMakeFiles/ethgate.dir/src/ident_service.c.o CMakeFiles/ethgate.dir/src/dbgitf.c.o CMakeFiles/ethgate.dir/src/debug.c.o -o ethgate -lc So what do I have to change to get that command. And how can I remove - rdynamic ? SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS) removes -rdynamic and thr -lc question was a bit stupid TARGET_LINK_LIBRARIES solved it ;-) thx, for not telling me that I was sleering well this morning ;-) -- Danke Gruss Reinhard Thies ___ 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 and no make
On Tuesday 23 November 2010 05:37:39 Michael Hertling wrote: On 11/23/2010 03:25 AM, luxInteg wrote: Greetings I am learning cmake Compiling alglib (http://www.alglib.net/) (cpp) does not use make It is done simply by a command such as g++ -c *.cpp in the src directory QUESTION. If one wants a library from alglib I would like to know if it can it be compiled using CMAKE and if so how so Set up a src/CMakeLists.txt, a tests/CMakeLists.txt and a top-level CMakeLists.txt, use ADD_LIBRARY(), ADD_EXECUTABLE(), ADD_TEST() and ADD_SUBDIRECTORY() along with the usual CMake stuff, and consider to offer the finished CMakeLists.txt files to the alglib folks. I am sure they will eventually get to using cmake. Thanks for the help anyway. ___ 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] an akward preprocessor
On Tuesday 23 November 2010 05:43:17 Michael Hertling wrote: On 11/22/2010 10:39 PM, luxInteg wrote: Greetings I am learning cmake I have a small project to be installed in some directory $INSTALLED =/whatever/installed/directory/is I have some files say fila1.c ..File2.c to compile with a preprocessor that includes a reference to $INSTALL how do I set the compile properties of files with this? do I do :- -DWITH_INSTALL_DIR or -Dwhatever_installed_directory_is (i.e. for example -D/usr/local) or ? Consider ADD_DEFINITIONS(-DWITH_INSTALL_DIR=...); alternatively, you might add WITH_INSTALL_DIR=... to the COMPILE_DEFINITIONS target/ directory/source properties. will give it a try iand report findings, ttnanks for the help ___ 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] providing library information, what's the cmake way
On Wed, Nov 24, 2010 at 6:57 AM, Rolf Eike Beer e...@sf-mail.de wrote: In KDE we have a macro MACRO_WRITE_BASIC_CMAKE_VERSION_FILE() which helps with creating a basic version-info file which should be installed along with the Config-file. It consists of MacroWriteBasicCMakeVersionFile.cmake and BasicFindPackageVersion.cmake.in which you can find in http://websvn.kde.org/trunk/KDE/kdelibs/cmake/modules/ . I wonder why you use get_filename_component(_currentListFileDir ${CMAKE_CURRENT_LIST_FILE} PATH) in there instead of CMAKE_CURRENT_LIST_DIR. Eike ___ 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 Probably because CMAKE_CURRENT_LIST_DIR was just invented and is only in CMake 2.8.3... get_filename_component works with several versions of CMake, and does not require 2.8.3 or later. ___ 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 qt4 for dummies
Greetings, I am learning cmake. I am now having a go at learning to compile a qt4 project wuth cmake. I am starting with qt-4.6.2 and I want to play with compiling a small project into a library. From what I can discern most things seem straightforward but some files seemd to need transforming by the so called MOC:- Lets say I have a project that uses qmake with the following files ../src/file1.cpp ../src/file2.cpp to compile into some library libTESTcpp.a. After running qmake and make the build-log reveals:- compiled file1.cpp cpmpiled file2.cpp compiled moc/moc_file2.cpp then archived *.o ino libTESTcpp.a. SO when porting the setup to cmake:- a) Can the transformation for file2.cpp to moc/moc_file2.cpp be manually done as per:- configure_file(../src/file2.cpp ../src/moc/moc_file2.cpp @COPYONLY) ? OR b) Is it done otherwise and if so how so? The cmake qt4 examples I managed to find on the internet eg ( http://developer.qt.nokia.com/quarterly/view/using_cmake_to_build_qt_projects ) tend to be for executable files the most useful one (linked above) mentioned moc-headers, ui-files qrc files none of which are present in this project. Advice would be appreciated. luxInteg ___ 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 qt4 for dummies
The example that demonstrates how to use BundleUtilities contains a Qt app. See the CMakeLists file in that project for clues about how to structure a Qt application. See also CMake itself, in the CMake/Source/QtDialog. And ParaView, too -- it's a Qt app. Start with the example, though, it's much simpler than either CMake or ParaView. HTH, David On Wed, Nov 24, 2010 at 12:25 PM, luxInteg lux-in...@btconnect.com wrote: Greetings, I am learning cmake. I am now having a go at learning to compile a qt4 project wuth cmake. I am starting with qt-4.6.2 and I want to play with compiling a small project into a library. From what I can discern most things seem straightforward but some files seemd to need transforming by the so called MOC:- Lets say I have a project that uses qmake with the following files ../src/file1.cpp ../src/file2.cpp to compile into some library libTESTcpp.a. After running qmake and make the build-log reveals:- compiled file1.cpp cpmpiled file2.cpp compiled moc/moc_file2.cpp then archived *.o ino libTESTcpp.a. SO when porting the setup to cmake:- a) Can the transformation for file2.cpp to moc/moc_file2.cpp be manually done as per:- configure_file(../src/file2.cpp ../src/moc/moc_file2.cpp @COPYONLY) ? OR b) Is it done otherwise and if so how so? The cmake qt4 examples I managed to find on the internet eg ( http://developer.qt.nokia.com/quarterly/view/using_cmake_to_build_qt_projects ) tend to be for executable files the most useful one (linked above) mentioned moc-headers, ui-files qrc files none of which are present in this project. Advice would be appreciated. luxInteg ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] providing library information, what's the cmake way
On Wed, Nov 24, 2010 at 6:57 AM, Rolf Eike Beer e...@sf-mail.de wrote: In KDE we have a macro MACRO_WRITE_BASIC_CMAKE_VERSION_FILE() which helps with creating a basic version-info file which should be installed along with the Config-file. It consists of MacroWriteBasicCMakeVersionFile.cmake and BasicFindPackageVersion.cmake.in which you can find in http://websvn.kde.org/trunk/KDE/kdelibs/cmake/modules/ . I wonder why you use get_filename_component(_currentListFileDir ${CMAKE_CURRENT_LIST_FILE} PATH) in there instead of CMAKE_CURRENT_LIST_DIR. Probably because CMAKE_CURRENT_LIST_DIR was just invented and is only in CMake 2.8.3... get_filename_component works with several versions of CMake, and does not require 2.8.3 or later. So I think it is _really_ necessary to go through all the CMake documentation items and add a line about when which feature was added. Everyone looks into his local CMake documentation and uses what he finds in there. And then it breaks on older versions. You currently have no chance to know what works but to install all older versions and do a binary search in the documentation. That simply does not scale. Eike ___ 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] providing library information, what's the cmake way
On Wed, Nov 24, 2010 at 11:34 AM, Rolf Eike Beer e...@sf-mail.de wrote: On Wed, Nov 24, 2010 at 6:57 AM, Rolf Eike Beer e...@sf-mail.de wrote: In KDE we have a macro MACRO_WRITE_BASIC_CMAKE_VERSION_FILE() which helps with creating a basic version-info file which should be installed along with the Config-file. It consists of MacroWriteBasicCMakeVersionFile.cmake and BasicFindPackageVersion.cmake.in which you can find in http://websvn.kde.org/trunk/KDE/kdelibs/cmake/modules/ . I wonder why you use get_filename_component(_currentListFileDir ${CMAKE_CURRENT_LIST_FILE} PATH) in there instead of CMAKE_CURRENT_LIST_DIR. Probably because CMAKE_CURRENT_LIST_DIR was just invented and is only in CMake 2.8.3... get_filename_component works with several versions of CMake, and does not require 2.8.3 or later. So I think it is _really_ necessary to go through all the CMake documentation items and add a line about when which feature was added. Everyone looks into his local CMake documentation and uses what he finds in there. And then it breaks on older versions. You currently have no chance to know what works but to install all older versions and do a binary search in the documentation. That simply does not scale. Eike ___ 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 Adding that information in the documentation would be good, I agree. (Although quite time consuming and costly for somebody...) But the best practice should be this: If you are using CMake 2.8.3 exclusively to develop features in your source tree's CMakeLists files (or included .cmake scripts) then you need to say cmake_minimum_required(VERSION 2.8.3) just to be on the safe side. If you want to support CMake 2.6.4 (or whatever previous version you require, for whatever reason), then you should be using *that* version for your local development, and have that be the cmake_minimum_required version. And use that version to look up documentation... David ___ 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 qt4 for dummies
The BundleUtilities example may be found here, by the way: http://www.cmake.org/Wiki/BundleUtilitiesExample (Sorry for forgetting the link on the original reply...) On Wed, Nov 24, 2010 at 11:33 AM, David Cole david.c...@kitware.com wrote: The example that demonstrates how to use BundleUtilities contains a Qt app. See the CMakeLists file in that project for clues about how to structure a Qt application. See also CMake itself, in the CMake/Source/QtDialog. And ParaView, too -- it's a Qt app. Start with the example, though, it's much simpler than either CMake or ParaView. HTH, David On Wed, Nov 24, 2010 at 12:25 PM, luxInteg lux-in...@btconnect.com wrote: Greetings, I am learning cmake. I am now having a go at learning to compile a qt4 project wuth cmake. I am starting with qt-4.6.2 and I want to play with compiling a small project into a library. From what I can discern most things seem straightforward but some files seemd to need transforming by the so called MOC:- Lets say I have a project that uses qmake with the following files ../src/file1.cpp ../src/file2.cpp to compile into some library libTESTcpp.a. After running qmake and make the build-log reveals:- compiled file1.cpp cpmpiled file2.cpp compiled moc/moc_file2.cpp then archived *.o ino libTESTcpp.a. SO when porting the setup to cmake:- a) Can the transformation for file2.cpp to moc/moc_file2.cpp be manually done as per:- configure_file(../src/file2.cpp ../src/moc/moc_file2.cpp @COPYONLY) ? OR b) Is it done otherwise and if so how so? The cmake qt4 examples I managed to find on the internet eg ( http://developer.qt.nokia.com/quarterly/view/using_cmake_to_build_qt_projects ) tend to be for executable files the most useful one (linked above) mentioned moc-headers, ui-files qrc files none of which are present in this project. Advice would be appreciated. luxInteg ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] set CMAKE_INSTALL_PREFIX in CMakeLists
On Wed, Nov 24, 2010 at 12:11:56PM +0100, Micha Renner wrote: SET(CMAKE_INSTALL_PREFIX /foo/bar CACHE PATH Foo install prefix) So, without the test to CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT, and without the FORCE option. No, as I mentioned, there was an article of one the CMake-maintainers who recommended this. Micha is correct. CMAKE_INSTALL_PREFIX is set before your CMakeLists.txt is processed, so the above will never do anything. tyler ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] cmake qt4 for dummies
On Wednesday 24 November 2010 16:33:24 David Cole wrote: The example that demonstrates how to use BundleUtilities contains a Qt app. See the CMakeLists file in that project for clues about how to structure a Qt application. See also CMake itself, in the CMake/Source/QtDialog. And ParaView, too -- it's a Qt app. Start with the example, though, it's much simpler than either CMake or ParaView. Thanks but my interest is how to port from qmake to cmake. The example I gave was a simple project with two files with one file being transformed into another prepended by 'moc' via qmake (Please see below):- --- Lets say I have a project that uses qmake with the following files ../src/file1.cpp ../src/file2.cpp to compile into some library libTESTcpp.a. After running qmake and make the build-log reveals:- compiled file1.cpp cpmpiled file2.cpp compiled moc/moc_file2.cpp then archived *.o ino libTESTcpp.a. I merely wnat to know how to generatemoc/moc_file2.cpp I.E whether:- a) the transformation for file2.cpp to moc/moc_file2.cpp be manually done as per:- configure_file(../src/file2.cpp ../src/moc/moc_file2.cpp @COPYONLY) ? OR b) OR it done otherwise and if so how so? -- ___ 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 qt4 for dummies
On Wed, Nov 24, 2010 at 1:09 PM, luxInteg lux-in...@btconnect.com wrote: On Wednesday 24 November 2010 16:33:24 David Cole wrote: The example that demonstrates how to use BundleUtilities contains a Qt app. See the CMakeLists file in that project for clues about how to structure a Qt application. See also CMake itself, in the CMake/Source/QtDialog. And ParaView, too -- it's a Qt app. Start with the example, though, it's much simpler than either CMake or ParaView. Thanks but my interest is how to port from qmake to cmake. The example I gave was a simple project with two files with one file being transformed into another prepended by 'moc' via qmake (Please see below):- --- Lets say I have a project that uses qmake with the following files ../src/file1.cpp ../src/file2.cpp to compile into some library libTESTcpp.a. After running qmake and make the build-log reveals:- compiled file1.cpp cpmpiled file2.cpp compiled moc/moc_file2.cpp then archived *.o ino libTESTcpp.a. I merely wnat to know how to generate moc/moc_file2.cpp I.E whether:- a) the transformation for file2.cpp to moc/moc_file2.cpp be manually done as per:- configure_file(../src/file2.cpp ../src/moc/moc_file2.cpp @COPYONLY) ? OR b) OR it done otherwise and if so how so? -- I am not a Qt expert. But to the best of my knowledge, dealing with the moc, ui and qrc files and such is best handled by the QT4_* macros as demonstrated in the example that I already pointed you to*. Please read the CMakeLists.txt file from the example before asking more questions. The simple bundle utilities example is a bare-bones Qt app on purpose so that it is easily understood. If it is not obvious how to proceed after that, then by all means, ask for clarification. Peace out, dog... ___ 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 qt4 for dummies
See the qt4_wrap_ui macro Sent from my iPhone On Nov 24, 2010, at 7:09 PM, luxInteg lux-in...@btconnect.com wrote: On Wednesday 24 November 2010 16:33:24 David Cole wrote: The example that demonstrates how to use BundleUtilities contains a Qt app. See the CMakeLists file in that project for clues about how to structure a Qt application. See also CMake itself, in the CMake/Source/QtDialog. And ParaView, too -- it's a Qt app. Start with the example, though, it's much simpler than either CMake or ParaView. Thanks but my interest is how to port from qmake to cmake. The example I gave was a simple project with two files with one file being transformed into another prepended by 'moc' via qmake (Please see below):- --- Lets say I have a project that uses qmake with the following files ../src/file1.cpp ../src/file2.cpp to compile into some library libTESTcpp.a. After running qmake and make the build-log reveals:- compiled file1.cpp cpmpiled file2.cpp compiled moc/moc_file2.cpp then archived *.o ino libTESTcpp.a. I merely wnat to know how to generatemoc/moc_file2.cpp I.E whether:- a) the transformation for file2.cpp to moc/moc_file2.cpp be manually done as per:- configure_file(../src/file2.cpp ../src/moc/moc_file2.cpp @COPYONLY) ? OR b) OR it done otherwise and if so how so? -- ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] cmake qt4 for dummies
Woops, I meant the qt4_wrap_cpp macro. Sent from my iPhone On Nov 24, 2010, at 7:09 PM, luxInteg lux-in...@btconnect.com wrote: On Wednesday 24 November 2010 16:33:24 David Cole wrote: The example that demonstrates how to use BundleUtilities contains a Qt app. See the CMakeLists file in that project for clues about how to structure a Qt application. See also CMake itself, in the CMake/Source/QtDialog. And ParaView, too -- it's a Qt app. Start with the example, though, it's much simpler than either CMake or ParaView. Thanks but my interest is how to port from qmake to cmake. The example I gave was a simple project with two files with one file being transformed into another prepended by 'moc' via qmake (Please see below):- --- Lets say I have a project that uses qmake with the following files ../src/file1.cpp ../src/file2.cpp to compile into some library libTESTcpp.a. After running qmake and make the build-log reveals:- compiled file1.cpp cpmpiled file2.cpp compiled moc/moc_file2.cpp then archived *.o ino libTESTcpp.a. I merely wnat to know how to generatemoc/moc_file2.cpp I.E whether:- a) the transformation for file2.cpp to moc/moc_file2.cpp be manually done as per:- configure_file(../src/file2.cpp ../src/moc/moc_file2.cpp @COPYONLY) ? OR b) OR it done otherwise and if so how so? -- ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] howto re-run file(COPY signature ?
On Wed, 2010-11-24 at 10:55 +0100, Michael Hertling wrote: On 11/24/2010 04:44 AM, Dominique Belhachemi wrote: Hello, I am using the following command in my CMakeLists.txt file to copy a directory with all sub-directories from the source tree to a directory in the binary tree. file(COPY ${SRCDIR} DESTINATION ${CMAKE_BINARY_DIR}/${DSTDIR}/ PATTERN .svn EXCLUDE ) After adding this line to CMakeLists.txt and typing 'make' the command is working like expected. But after adding a new file to ${SRCDIR} and typing 'make' again, the new file doesn't get copied. I have to do a 'touch CMakeLists.txt' first. Is there a way to enforce the execution? You might outsource the FILE(COPY ...) command to a CMake script which is invoked by a custom target, e.g. as in the following CMakeLists.txt: CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR) PROJECT(COPYTREE NONE) ADD_CUSTOM_TARGET(copytree ALL ${CMAKE_COMMAND} -DSRC=${CMAKE_SOURCE_DIR} -DDST=/tmp/${PROJECT_NAME} -P ${CMAKE_SOURCE_DIR}/copytree.cmake ) The ${CMAKE_SOURCE_DIR}/copytree.cmake script simply looks like: FILE(COPY ${SRC} DESTINATION ${DST} PATTERN .svn EXCLUDE) Thanks, I will see if this works for me. Because FILE(COPY ...) copies files and directories only if they are new Does it mean it is a bug if FILE(COPY ...) doesn't copy new files? or have been touched you can probably afford the script's execution each time you build; use ADD_DEPENDENCIES() to ensure that the script runs at the right time. Thanks Dominique ___ 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] providing library information, what's the cmake way
On Wed, Nov 24, 2010 at 11:41:46AM -0500, David Cole wrote: On Wed, Nov 24, 2010 at 11:34 AM, Rolf Eike Beer e...@sf-mail.de wrote: So I think it is _really_ necessary to go through all the CMake documentation items and add a line about when which feature was added. Adding that information in the documentation would be good, I agree. (Although quite time consuming and costly for somebody...) Perhaps a good compromise is simply to add version information to all new CMake commands/variables/properties that are added henceforth? Thanks, tyler ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] providing library information, what's the cmake way
On Wed, Nov 24, 2010 at 12:58 PM, Tyler Roscoe ty...@cryptio.net wrote: On Wed, Nov 24, 2010 at 11:41:46AM -0500, David Cole wrote: On Wed, Nov 24, 2010 at 11:34 AM, Rolf Eike Beer e...@sf-mail.de wrote: So I think it is _really_ necessary to go through all the CMake documentation items and add a line about when which feature was added. Adding that information in the documentation would be good, I agree. (Although quite time consuming and costly for somebody...) Perhaps a good compromise is simply to add version information to all new CMake commands/variables/properties that are added henceforth? Thanks, tyler That does sound like a good idea. ___ 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] howto re-run file(COPY signature ?
2010/11/24 Dominique Belhachemi domi...@cs.tu-berlin.de: The ${CMAKE_SOURCE_DIR}/copytree.cmake script simply looks like: FILE(COPY ${SRC} DESTINATION ${DST} PATTERN .svn EXCLUDE) Thanks, I will see if this works for me. Because FILE(COPY ...) copies files and directories only if they are new Does it mean it is a bug if FILE(COPY ...) doesn't copy new files? Not in this case. FILE( xxx) is CMake-time command (it runs when CMake runs) when you do make your are at Build time at Build time, cmake may be [automatically] invoked again if some target (library, executable, custom etc...) NEEDS a re-run because of a dependency. In your example there is no mean for CMake to know that FILE(COPY ...) generates a build time dependency. So when a new file is added either your re-run cmake yourself or you try Michael proposal which adds this kind of build time dependency using custom target. -- Erk Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] providing library information, what's the cmake way
2010/11/24 David Cole david.c...@kitware.com: On Wed, Nov 24, 2010 at 12:58 PM, Tyler Roscoe ty...@cryptio.net wrote: On Wed, Nov 24, 2010 at 11:41:46AM -0500, David Cole wrote: On Wed, Nov 24, 2010 at 11:34 AM, Rolf Eike Beer e...@sf-mail.de wrote: So I think it is _really_ necessary to go through all the CMake documentation items and add a line about when which feature was added. Adding that information in the documentation would be good, I agree. (Although quite time consuming and costly for somebody...) Perhaps a good compromise is simply to add version information to all new CMake commands/variables/properties that are added henceforth? Thanks, tyler That does sound like a good idea. +1 for this, even if it does not solve all evolution problem like when IF command was added the IF(TARGET ...) or IF(POLICY ...) I don't remember when (may the 2.4 -- 2.6 switch) basically IF command existed before and after the evolution but its capability was enhanced. May be adding a list of version for each command may be covering this like IF -- start, 2.4.8, 2.6.2, 2.8.3 meaning that IF command was there since start and evolved in 2.4.8, 2.6.2, 2.8.3 releases. If ones want to know the difference one can go and pick up each such release in order to generate documentation diff. May looks fancy but not knowing that command has not all the feature it currently has is interesting too. Note with that kind of list I can automatically generate a per-command diff of documentation using my private CMake binary collection :-] -- Erk Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] Error using CMake 2.8.x, Visual Studio 2010, and multiple platform SDKs.
I'm seeing a reproducible failure generating Visual Studio 10 output on a system with the following installed: CMake 2.8.2 CMake 2.8.3 Visual Studio 2005 Visual Studio 2010 Program Files\Microsoft SDKs\Windows v6.1 v7.0A v7.1 To keep everything sane I use command files to set environment variables as needed, beyond the compiler specific command windows. In a VS 2010 command window, with an environment set to point at the V7.0A platform SDK, I can reliably create and build NMake projects. In that same window CMake errors out at Checking for working C compiler using: Visual Studio 10, claiming a broken compiler. Checking the CMakeFiles\CMakeErrors.log shows that while it's using the correct CL.exe, the rc.exe from the v6.1 platform sdk is being used. This rc.exe objects to the command line option /nologo somehow interpreting it as -ologo and terminating with a fatal error. If I move/rename the v6.1 platform sdk directory, CMake completes without issue. Is this a known issue, am I insane, or should I start assembling a sample project and logs? Ted -- ID: 0x9AAE10A5 Keyserver: pool.sks-keyservers.net Fingerprint: E79C 8FB2 D41D FCA3 410D 3D11 B5BD 5130 9AAE 10A5 signature.asc Description: OpenPGP digital signature ___ 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 qt4 for dummies
On Wednesday 24 November 2010 17:35:16 John Clayton wrote: Woops, I meant the qt4_wrap_cpp macro. thanks v helpful ___ 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 qt4 for dummies
On Wednesday 24 November 2010 17:11:52 David Cole wrote: I am not a Qt expert. But to the best of my knowledge, dealing with the moc, ui and qrc files and such is best handled by the QT4_* macros as demonstrated in the example that I already pointed you to*. thanks problem sorted ___ 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