[cmake-developers] [CMake 0011301]: FindQt4.cmake: ability to use a new default dir in Qt 4.7: qml imports
The following issue has been SUBMITTED. == http://public.kitware.com/Bug/view.php?id=11301 == Reported By:Marco Martin Assigned To: == Project:CMake Issue ID: 11301 Category: CMake Reproducibility:always Severity: minor Priority: normal Status: new == Date Submitted: 2010-10-07 15:13 EDT Last Modified: 2010-10-07 15:13 EDT == Summary:FindQt4.cmake: ability to use a new default dir in Qt 4.7: qml imports Description: Since Qt 4.7.0 Qt has a new standard directory, is called imports and contains plugins for the QML declarative language. So should be possible to install files in it. since FindQt4.cmake is shared between KDE and upstrea cmake i'm reporting the issue also there. a proposed patch is at http://svn.reviewboard.kde.org/r/5541/ == Issue History Date ModifiedUsername FieldChange == 2010-10-07 15:13 Marco Martin New Issue == ___ cmake-developers mailing list cmake-developers@cmake.org http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Re: [CMake] What does find_package(COMPONENTS) do? and
On 06.10.10 22:47:15, Stephen Kelly wrote: Hi, The documentation says A package-specific list of components may be listed after the REQUIRED option or after the COMPONENTS option if no REQUIRED option is given. http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:find_package But it doesn't say why you would want to do that. At first I thought it was to specify that only the components specified would be used to fill cmake variables. However, find_package(Qt COMPONENTS QtCore) also results in ${QT_QTGUI_LIBRARY} being defined for example. So then I thought maybe the semantic is that if one of the components can not be found, the find_package fails. So I tried find_package(Qt REQUIRED QtCore QtDoesNotExist) which works without error. What am I missing? The reason I ask is that I finally figured out why the tests in my library needed to be linked to QtGui, even though it only uses QtCore. The reason is that find_package(Qt) causes QT_GUI_LIB to be defined. Which in turn causes QTEST_MAIN to be defined to expand to use QApplication instead of QCoreApplication as it is if QT_GUI_LIB is not defined. http://qt.gitorious.org/qt/qt/blobs/4.7/src/testlib/qtest.h find_package(Qt REQUIRED QtCore QtScript) does not cause QT_GUI_LIB to be defined. However, some of my targets do need QtGui, so I should specify it, right? So if I do specify it I'll end up having QT_GUI_LIB defined when building my unit tests. I could remove_definitions(-DQT_GUI_LIB), but apart from being a BadHack(tm), it causes my unit tests which *do* require QtGui to fail at runtime because they create QWidgets and by undeffing QT_GUI_LIB I build them to use QCoreApplication instead of QApplication (Not allowed in Qt), so the tests fail at runtime. http://gitorious.org/grantlee/grantlee/blobs/0.1/tests/CMakeLists.txt Is there a solution to all this? What is the point of COMPONENTS if it has no effect on what I can include or link to? Is it possible to link some of my tests to QtGui but not all of them and still have them all pass? Do I need to just link my core tests to QtGui and use QApplication and quit my complaining? The only way I can see to satisfy all requirements is attached. Is that acceptable or is there a better way? You could just use 2 find_package calls in two different subdirs. One for the case of core-libs+core-tests and the other has gui-libs+gui-tests. Unless I misunderstood something... Andreas -- Excellent day for putting Slinkies on an escalator. ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Building Texinfo with CMake
On 7. Oct, 2010, at 2:33 , Jashank Jeremy wrote: Hi, I have a Texinfo file in my project, and I'd like to tie it in with my CMake build. How do I do so? Jashank find_program(MAKEINFO_EXECUTABLE makeinfo) set(info_in ${CMAKE_CURRENT_SOURCE_DIR}/bla.texi) set(info_out ${CMAKE_CURRENT_BINARY_DIR}/bla.info) add_custom_command(OUTPUT ${info_out} COMMAND ${MAKEINFO_EXECUTABLE} -o ${info_out} ${info_in} DEPENDS ${info_in} COMMENT Creating Info file ${info_out} VERBATIM) add_custom_target(info ALL DEPENDS ${info_out}) HTH Michael -- There is always a well-known solution to every human problem -- neat, plausible, and wrong. H. L. Mencken PGP.sig Description: This is a digitally signed message part ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Help tracking down a problem
On 7. Oct, 2010, at 4:58 , Travis Jensen wrote: I'm trying to build a project using cmake (firebreath). I am stuck at a particular point (details later). I can build other projects without running into this problem. Other people can build firebreath without running into this problem. The obvious conclusion is that I've got something weird going on with my environment. I'm new to cmake and don't know where to start debugging the problem. Any help I can get would be appreciated. Now the details: I am running on OS X 10.6.4. I am using the precompile cmake binaries, version 2.8.2. I have Xcode 3.2.4 installed. I also use Macports to install various things, but have removed all of the Macports directories from my path to try to remove that variable. Here is the error I'm seeing: -- Looking for include files CMAKE_HAVE_PTHREAD_H -- Looking for include files CMAKE_HAVE_PTHREAD_H - found -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - not found -- Check if compiler accepts -pthread -- Check if compiler accepts -pthread - no CMake Error at /Applications/CMake.app/Contents/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:70 (MESSAGE): Could NOT find Threads (missing: Threads_FOUND) Call Stack (most recent call first): /Applications/CMake.app/Contents/share/cmake-2.8/Modules/FindThreads.cmake:157 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) CMakeLists.txt:37 (find_package) So how do I go about debugging this? libpthread does exist in /usr/lib and is found in other contexts, so something has altered where it is looking. Thanks. tj Try looking into the file CMakeFiles/CMakeOutput.log to see what went wrong. Michael -- There is always a well-known solution to every human problem -- neat, plausible, and wrong. H. L. Mencken PGP.sig Description: This is a digitally signed message part ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check 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] Disallowing in-source builds
On 6. Oct, 2010, at 20:10 , aaron.mead...@thomsonreuters.com aaron.mead...@thomsonreuters.com wrote: Hi all. Is there a good way to disallow in-source builds? Ideally, I'd like to prevent it before any cruft is written into the source tree. I experimented with writing a function into my CMakelists file and calling it. The function checked if CMAKE_BINARY_DIR was equal to CMAKE_SOURCE_DIR and messaged a FATAL_ERROR if that was the case. This works ok, but still generates a CMakeFiles directory and a CMakeCache.txt file. I don't think there's a way to prevent that from happening. The bad thing about this is that if the user doesn't clean away the in-source CMakeCache.txt file, subsequent out-of-source builds will fail. Perhaps you can do something like this: # check for polluted source tree if(EXISTS ${CMAKE_SOURCE_DIR}/CMakeCache.txt OR EXISTS ${CMAKE_SOURCE_DIR}/CMakeFiles) message(FATAL_ERROR CMakeCache.txt or CMakeFiles exists in source directory!) endif() # make sure the user doesn't play dirty with symlinks get_filename_component(srcdir ${CMAKE_SOURCE_DIR} REALPATH) get_filename_component(bindir ${CMAKE_BINARY_DIR} REALPATH) # disallow in-source builds if(${srcdir} STREQUAL ${bindir}) message(FATAL_ERROR In-source builds are forbidden!) endif() The second half of the question is of course, is there an easy way to clean out a source tree if an in-source build was accidentally kicked off? (short of dividing the files by their timestamp and removing the newer ones, etc..) No, simply because CMake cannot. Your build system might have something like the following: execute_process(COMMAND echo BOOM ${CMAKE_BINARY_DIR}/boom.txt VERBATIM) CMake never knows that the file boom.txt is written, and therefor can't clean it away. The only reasonable way I know of is using git (http://git-scm.com): git clean -df will remove all the files and directories that are not part of the repository. With tar-ball builds it's easier. Just wipe the source tree and unpack again. Michael PGP.sig Description: This is a digitally signed message part ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check 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] bug in FindwxWidget.cmake (patch proposed)
Hi all, As mentioned in my previous post, there is a bug in the cmake module FindwxWidgets.cmake that prevents any library using wxWidgets to cross compile for Windows from Linux. Lines 192 to 198 are concerned by this bug: IF(WIN32 AND NOT CYGWIN AND NOT MSYS) SET(wxWidgets_FIND_STYLE win32) ELSE(WIN32 AND NOT CYGWIN AND NOT MSYS) IF(UNIX OR MSYS) SET(wxWidgets_FIND_STYLE unix) ENDIF(UNIX OR MSYS) ENDIF(WIN32 AND NOT CYGWIN AND NOT MSYS) The problem is that, when cross compiling from Linux for Windows, the test WIN32 AND NOT CYGWIN AND NOT MSYS is true but find style should be unix, because the Windows-based wxWidget library is installed in a unix environment. Therefore, the following line replacement corrects this bug: IF(WIN32 AND NOT CYGWIN AND NOT MSYS AND NOT CMAKE_CROSSCOMPILING) SET(wxWidgets_FIND_STYLE win32) ELSE(WIN32 AND NOT CYGWIN AND NOT MSYS AND NOT CMAKE_CROSSCOMPILING) IF(UNIX OR MSYS OR CMAKE_CROSSCOMPILING) SET(wxWidgets_FIND_STYLE unix) ENDIF(UNIX OR MSYS OR CMAKE_CROSSCOMPILING) ENDIF(WIN32 AND NOT CYGWIN AND NOT MSYS AND NOT CMAKE_CROSSCOMPILING) The modified FindwxWidget.cmake module runs fine with the following toolchain cmake file: SET(CMAKE_SYSTEM_NAME Windows) SET(CMAKE_C_COMPILER /usr/bin/i686-pc-mingw32-gcc) SET(CMAKE_CXX_COMPILER /usr/bin/i686-pc-mingw32-g++) SET(CMAKE_FIND_ROOT_PATH /usr/i686-pc-mingw32) SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH) SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) Could this patch be applied in cmake svn, please? All the best, Florent ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check 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] avoiding building test targets
How can I have CMake not build test targets when doing a make install? I'd prefer that test targets are only ever built if make test is called. -- edA-qa mort-ora-y -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- BigTPoker - Poker fun and games http://BigTPoker.com/ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Sign: Please digitally sign your emails. Encrypt: I'm also happy to receive encrypted mail. 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
[CMake] Disallowing in-source builds
is there an easy way to clean out a source tree if an in-source build was accidentally kicked off? (short of dividing the files by their timestamp and removing the newer ones, etc..) My immediate thought was, does make clean not work for you? But I guess you're talking about CMake debris rather than make debris. Ideally, I?d like to prevent it before any cruft is written into the source tree. I suggest an alternative. I think I read about it on this list but I'm not sure. What I do is provide an empty cmake folder in my source tree root, and run all CMake commands in it. This ensures all the CMake cruft is contained in one in-source folder. (I guess you could modify this so it's out-source.) To re-run the rootwards-most CMakeLists.txt file: cd projectx/cmake cmake .. Then, to clear all CMake debris: rm -r projectx/cmake/* (insert usual disclaimer on rm usage) This doesn't prevent anything, but it does at least make it easy to build in-source without cluttering the source tree. Is there a good way to disallow in-source builds? Probably the best way is to circulate an email stating the lead developer has threatened to eat^H^H^H^H fire anyone who builds in-source. You could maybe do something with user permissions and build scripts. Make sure the build scripts only work in one place. Regards, Adam J Richardson ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check 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] avoiding building test targets
On 7. Oct, 2010, at 10:54 , edA-qa mort-ora-y wrote: How can I have CMake not build test targets when doing a make install? I'd prefer that test targets are only ever built if make test is called. -- edA-qa mort-ora-y That needs a bit of trickery: function(add_test_executable name) add_executable(${name} EXCLUDE_FROM_ALL ${ARGN}) if(NOT TARGET test-exes) add_custom_target(test-exes) endif() add_dependencies(test-exes ${name}) endfunction() add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} WORKING_DIRECTORY ${CMAKE_BINARY_DIR} COMMENT Running ctest) add_dependencies(check test-exes) This way you can run make check to build all the test executables and to run ctest afterwards. HTH Michael -- There is always a well-known solution to every human problem -- neat, plausible, and wrong. H. L. Mencken PGP.sig Description: This is a digitally signed message part ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check 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] Disallowing in-source builds
On 07/10/10 10:21, fat...@crackmonkey.us wrote: Then, to clear all CMake debris: rm -r projectx/cmake/* On Unix, if a project is managed by SVN it's easy to clean tree from generated files: $ svn-clean Distributed with Debian, Ubuntu, etc. as well as downloadable [1] I'm sure there are similar commands/tools possible for Git, Mercurial and others. [1] http://websvn.kde.org/*checkout*/trunk/KDE/kdesdk/scripts/svn-clean?pathrev=499176 Best regards, -- Mateusz Loskot, http://mateusz.loskot.net Charter Member of OSGeo, http://osgeo.org Member of ACCU, http://accu.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] Less Noisy Makefiles?
Hi, I was wondering if this is possible or if it would be acceptable to disable progress printout. At the moment building with only minor changes prints a lot of text with CMake Makefiles. eg: [ 4%] Built target bf_intern_audaspace [ 4%] Built target bf_intern_string [ 6%] Built target bf_intern_ghost full log. http://www.pasteall.org/16053 Setting: SET_PROPERTY(GLOBAL PROPERTY RULE_MESSAGES OFF) is no good because I want to see the lines which are running/building, just not the progress lines that do nothing (the reverse really). I found some messages about this but they only refer to RULE_MESSAGES. This may seem silly but its actually one of the reasons we still have hand written makefiles in our project (which Im trying to get replaced with cmake). Would this be acceptable? -- - Campbell ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check 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] Less Noisy Makefiles?
On 7. Oct, 2010, at 11:58 , Campbell Barton wrote: Hi, I was wondering if this is possible or if it would be acceptable to disable progress printout. At the moment building with only minor changes prints a lot of text with CMake Makefiles. eg: [ 4%] Built target bf_intern_audaspace [ 4%] Built target bf_intern_string [ 6%] Built target bf_intern_ghost full log. http://www.pasteall.org/16053 Setting: SET_PROPERTY(GLOBAL PROPERTY RULE_MESSAGES OFF) is no good because I want to see the lines which are running/building, just not the progress lines that do nothing (the reverse really). I found some messages about this but they only refer to RULE_MESSAGES. This may seem silly but its actually one of the reasons we still have hand written makefiles in our project (which Im trying to get replaced with cmake). Would this be acceptable? what happens if you run make VERBOSE=1 or enable CMAKE_VERBOSE_MAKEFILE? Michael -- There is always a well-known solution to every human problem -- neat, plausible, and wrong. H. L. Mencken PGP.sig Description: This is a digitally signed message part ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check 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] visual studio 2010 and assembler files
Hi,I've tried to include assembler-files in one of my projects and with the masm-rule I have included the sourcefiles like normal c++-files in my library and enabled masm-support. But when I generate the visual studio 2010 solution the files are included without a custom command to compile the file or something else.When I understand it right, the files can be included without a custom tool, but you need in the vcproj-file the following:(taken from here: http://blogs.msdn.com/b/vcblog/archive/2010/04/21/quick-help-on-vs2010-custom-build-rule.aspx )but to make visual studio compile it with masm the has to be DocumentI've already patched the extensionsettings and -targets in cmVisualStudio10TargetGenerator.cxx, but I don't know how to patch the sources for the second needed change(ClInclude to MASM). Could anybody help here?And is this the prefered solution to include assembler-files into cmake? (this patch only works with vs2010, what's with the other versions or ides...)As a sidenote: I've tried to include the obj-file in the normal file-list like:ADD_LIBRARY(foobar1.cppbar2.cppasmcode.obj)but the generated visual-studio-2010-project contained an error (the asmcode.obj is now listed two times and can't be loaded from visual studio)regardskai___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check 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] avoiding building test targets
On 10/07/2010 11:28 AM, Michael Wild wrote: function(add_test_executable name) add_executable(${name} EXCLUDE_FROM_ALL ${ARGN}) if(NOT TARGET test-exes) add_custom_target(test-exes) endif() add_dependencies(test-exes ${name}) endfunction() add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} WORKING_DIRECTORY ${CMAKE_BINARY_DIR} COMMENT Running ctest) add_dependencies(check test-exes) That's great. Thank you. -- edA-qa mort-ora-y -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- BigTPoker - Poker fun and games http://BigTPoker.com/ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Sign: Please digitally sign your emails. Encrypt: I'm also happy to receive encrypted mail. 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
[CMake] CMake rebuilding too much
I've got a reasonably big project with 30+ shared libraries and 70+ executables all in one cmake-based project. Today I changed one line in a CMakeLists.txt in a sub-directory to link boost program_options in one particular executable, and it caused cmake to decide that it needed to recompile everything. Why does it do that? Is there a way that I can have cmake tell me the reason? This is the rather innocuous change that caused CMake to rebuild a lot more than 'srscrubber'. target_link_libraries(srscrubber camutility) target_link_libraries(srscrubber camutility ${Boost_PROGRAM_OPTIONS_LIBRARY}) I'm using cmake version 2.6-patch 4 on centos linux 5.5 with the default makefile generator. Thanks, Thomas ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check 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 rebuilding too much
On 10/7/2010 8:21 AM, Thomas Sondergaard wrote: I've got a reasonably big project with 30+ shared libraries and 70+ executables all in one cmake-based project. Today I changed one line in a CMakeLists.txt in a sub-directory to link boost program_options in one particular executable, and it caused cmake to decide that it needed to recompile everything. Why does it do that? Is there a way that I can have cmake tell me the reason? This is the rather innocuous change that caused CMake to rebuild a lot more than 'srscrubber'. target_link_libraries(srscrubber camutility) target_link_libraries(srscrubber camutility ${Boost_PROGRAM_OPTIONS_LIBRARY}) I'm using cmake version 2.6-patch 4 on centos linux 5.5 with the default makefile generator. You are going to have to give more information or a small example that shows the problem. It should not be doing that. You could try running make -d to figure out why make is thinking it needs to do that. -Bill ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Disallowing in-source builds
On Thu, Oct 7, 2010 at 3:19 AM, Michael Wild them...@gmail.com wrote: On 6. Oct, 2010, at 20:10 , aaron.mead...@thomsonreuters.com aaron.mead...@thomsonreuters.com wrote: Hi all. Is there a good way to disallow in-source builds? Ideally, I'd like to prevent it before any cruft is written into the source tree. I experimented with writing a function into my CMakelists file and calling it. The function checked if CMAKE_BINARY_DIR was equal to CMAKE_SOURCE_DIR and messaged a FATAL_ERROR if that was the case. This works ok, but still generates a CMakeFiles directory and a CMakeCache.txt file. I don't think there's a way to prevent that from happening. The bad thing about this is that if the user doesn't clean away the in-source CMakeCache.txt file, subsequent out-of-source builds will fail. Perhaps you can do something like this: # check for polluted source tree if(EXISTS ${CMAKE_SOURCE_DIR}/CMakeCache.txt OR EXISTS ${CMAKE_SOURCE_DIR}/CMakeFiles) message(FATAL_ERROR CMakeCache.txt or CMakeFiles exists in source directory!) endif() # make sure the user doesn't play dirty with symlinks get_filename_component(srcdir ${CMAKE_SOURCE_DIR} REALPATH) get_filename_component(bindir ${CMAKE_BINARY_DIR} REALPATH) # disallow in-source builds if(${srcdir} STREQUAL ${bindir}) message(FATAL_ERROR In-source builds are forbidden!) endif() The second half of the question is of course, is there an easy way to clean out a source tree if an in-source build was accidentally kicked off? (short of dividing the files by their timestamp and removing the newer ones, etc..) No, simply because CMake cannot. Your build system might have something like the following: execute_process(COMMAND echo BOOM ${CMAKE_BINARY_DIR}/boom.txt VERBATIM) CMake never knows that the file boom.txt is written, and therefor can't clean it away. I think this is a bit of a red herring. CMake could be perfectly capable of cleaning up after itself (i.e. its own files). If the user is doing things like making a bunch of files that CMake isn't aware of (that aren't generated), these could be added to ADDITIONAL_MAKE_CLEAN_FILES, or a new property could be added for custom files that are to be deleted on a distclean. -- Philip Lowman ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Disallowing in-source builds
Two things: You should have your source code under version control, for many reasons, but in this context: 1. The VC system can tell you which files are unknown to it, i.e. those CMake pooped all over your source tree. 2. You can make sure your work is checked in, then delete the source directory and start fresh. Second: The post-CMake cleanup is by no means straightforward, because of what CMake's capabilities. You can have it generate blizzards of thousands of new files if that's what you want. CMake would, in effect, to run its configure process in reverse to truly clean up from any arbitrary set of CMakeLists.txt instructions. This would be a huge effort, and all to solve a problem that is actually between the chair and the keyboard. Software -- especially software for developers -- can't prevent every dumb thing a user can do. If it tries, it will end up tied in knots, and become inflexible and annoying to use. ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check 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 a tool pretty much like cmake for Java?
On Sunday 22 August 2010 22:11:28 Alexander Neundorf wrote: CMake supports Java, but that support is ... needs some work, there are some issues (I think this had to do with the location of the compiled files and the java packages or something). I assume patches to improve the situation would be accepted :-) Hi, I'm currently helping a project written in Java and C to improve the build system. I've already improved the Java .cmake files and got some stuff compiling. As soon as more of the projects builds and the file are in a state to be used by other I will post them. My current problem is with javah (C header file generator). This generator works on the class files. The class files aren't in CMAKE_CURRENT_BINARY_DIR they are located in: ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/project.dir/some/directory/foobar.class So my current problem is how to point the generator there ... Alex Cheers, -- andreas ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check 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 a tool pretty much like cmake for Java?
On Thursday 07 October 2010 16:45:49 Andreas Schneider wrote: My current problem is with javah (C header file generator). This generator works on the class files. The class files aren't in CMAKE_CURRENT_BINARY_DIR they are located in: ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/project.dir/some/directory/foo bar.class So my current problem is how to point the generator there ... In the language information file, this is OBJECT_DIR so is there something like CMAKE_CURRENT_OBJECT_DIR? -- andreas ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check 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 would I use parallel make on ExternalProjects?
On Wed, Oct 6, 2010 at 5:01 PM, Clifford Yapp cliffy...@gmail.com wrote: I use $(MAKE) in my BUILD_COMMAND and that seems to do OK, although I don't know if it works universally. That's an environment variable, as near as I can tell and isn't mentioned in the current CMake documentation. So it's probably not the best thing to do. upon reflection, this would be a little safer: if(${CMAKE_GENERATOR} STREQUAL Unix Makefiles) set(BUILD_COMMAND_STRING ${CMAKE_MAKE_PROGRAM} -j4) else() set(BUILD_COMMAND_STRING $(CMAKE_MAKE_PROGRAM)) endif() ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check 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 would I use parallel make on ExternalProjects?
On 10/7/2010 11:25 AM, kent williams wrote: On Wed, Oct 6, 2010 at 5:01 PM, Clifford Yappcliffy...@gmail.com wrote: I use $(MAKE) in my BUILD_COMMAND and that seems to do OK, although I don't know if it works universally. That's an environment variable, as near as I can tell and isn't mentioned in the current CMake documentation. So it's probably not the best thing to do. upon reflection, this would be a little safer: if(${CMAKE_GENERATOR} STREQUAL Unix Makefiles) set(BUILD_COMMAND_STRING ${CMAKE_MAKE_PROGRAM} -j4) else() set(BUILD_COMMAND_STRING $(CMAKE_MAKE_PROGRAM)) endif() By using $(MAKE), the toplevel -j N option should be passed down. The 2.8.3 RC that is out now has some fixes in this area. -Bill ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] How would I use parallel make on ExternalProjects?
1. Is that $(MAKE) or is it ${MAKE} ? One thing missing from the CMake documentation -- unless I'm mistaken there's not much explanation of CMake syntax in the documentation. 2. I think it's probably not what one intends to have 'make -j4' (for example) used every time make is invoked. If you configure a program that includes several ExternalProjects, then it would spawn 4 concurrent builds of those ExternalProjects, and then each of those builds would spawn 4 make steps at once, for 16 concurrent processes. On Thu, Oct 7, 2010 at 10:36 AM, Bill Hoffman bill.hoff...@kitware.com wrote: On 10/7/2010 11:25 AM, kent williams wrote: On Wed, Oct 6, 2010 at 5:01 PM, Clifford Yappcliffy...@gmail.com wrote: I use $(MAKE) in my BUILD_COMMAND and that seems to do OK, although I don't know if it works universally. That's an environment variable, as near as I can tell and isn't mentioned in the current CMake documentation. So it's probably not the best thing to do. upon reflection, this would be a little safer: if(${CMAKE_GENERATOR} STREQUAL Unix Makefiles) set(BUILD_COMMAND_STRING ${CMAKE_MAKE_PROGRAM} -j4) else() set(BUILD_COMMAND_STRING $(CMAKE_MAKE_PROGRAM)) endif() By using $(MAKE), the toplevel -j N option should be passed down. The 2.8.3 RC that is out now has some fixes in this area. -Bill ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] How would I use parallel make on ExternalProjects?
If you use $(MAKE) in a BUILD_COMMAND, then the literal $(MAKE) appears in the generated makefiles. That tells the top level make to spawn sub-makes with the job controller from the top level make. Then you do not need to specify any -j flags anywhere except at the top level. And then, the top level job controller makes sure there are only N concurrent things happening regardless of the level of sub-makes... Does that make sense? :-) David On Thu, Oct 7, 2010 at 11:52 AM, kent williams nkwmailingli...@gmail.comwrote: 1. Is that $(MAKE) or is it ${MAKE} ? One thing missing from the CMake documentation -- unless I'm mistaken there's not much explanation of CMake syntax in the documentation. 2. I think it's probably not what one intends to have 'make -j4' (for example) used every time make is invoked. If you configure a program that includes several ExternalProjects, then it would spawn 4 concurrent builds of those ExternalProjects, and then each of those builds would spawn 4 make steps at once, for 16 concurrent processes. On Thu, Oct 7, 2010 at 10:36 AM, Bill Hoffman bill.hoff...@kitware.com wrote: On 10/7/2010 11:25 AM, kent williams wrote: On Wed, Oct 6, 2010 at 5:01 PM, Clifford Yappcliffy...@gmail.com wrote: I use $(MAKE) in my BUILD_COMMAND and that seems to do OK, although I don't know if it works universally. That's an environment variable, as near as I can tell and isn't mentioned in the current CMake documentation. So it's probably not the best thing to do. upon reflection, this would be a little safer: if(${CMAKE_GENERATOR} STREQUAL Unix Makefiles) set(BUILD_COMMAND_STRING ${CMAKE_MAKE_PROGRAM} -j4) else() set(BUILD_COMMAND_STRING $(CMAKE_MAKE_PROGRAM)) endif() By using $(MAKE), the toplevel -j N option should be passed down. The 2.8.3 RC that is out now has some fixes in this area. -Bill ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check 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 would I use parallel make on ExternalProjects?
On the other hand, with Visual Studio, it's all a big hairy mess. because the setting for how many parallel projects to build simultaneously is a single top level global setting. So when we spawn sub-VS instances in VS 2008, for example, each one uses N for its parallel setting. In that case, I typically recommend setting that N to be half to a quarter of your processors available, assuming that there will be between 2 and 4 (on average) projects building simultaneously. On Thu, Oct 7, 2010 at 11:55 AM, David Cole david.c...@kitware.com wrote: If you use $(MAKE) in a BUILD_COMMAND, then the literal $(MAKE) appears in the generated makefiles. That tells the top level make to spawn sub-makes with the job controller from the top level make. Then you do not need to specify any -j flags anywhere except at the top level. And then, the top level job controller makes sure there are only N concurrent things happening regardless of the level of sub-makes... Does that make sense? :-) David On Thu, Oct 7, 2010 at 11:52 AM, kent williams nkwmailingli...@gmail.comwrote: 1. Is that $(MAKE) or is it ${MAKE} ? One thing missing from the CMake documentation -- unless I'm mistaken there's not much explanation of CMake syntax in the documentation. 2. I think it's probably not what one intends to have 'make -j4' (for example) used every time make is invoked. If you configure a program that includes several ExternalProjects, then it would spawn 4 concurrent builds of those ExternalProjects, and then each of those builds would spawn 4 make steps at once, for 16 concurrent processes. On Thu, Oct 7, 2010 at 10:36 AM, Bill Hoffman bill.hoff...@kitware.com wrote: On 10/7/2010 11:25 AM, kent williams wrote: On Wed, Oct 6, 2010 at 5:01 PM, Clifford Yappcliffy...@gmail.com wrote: I use $(MAKE) in my BUILD_COMMAND and that seems to do OK, although I don't know if it works universally. That's an environment variable, as near as I can tell and isn't mentioned in the current CMake documentation. So it's probably not the best thing to do. upon reflection, this would be a little safer: if(${CMAKE_GENERATOR} STREQUAL Unix Makefiles) set(BUILD_COMMAND_STRING ${CMAKE_MAKE_PROGRAM} -j4) else() set(BUILD_COMMAND_STRING $(CMAKE_MAKE_PROGRAM)) endif() By using $(MAKE), the toplevel -j N option should be passed down. The 2.8.3 RC that is out now has some fixes in this area. -Bill ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check 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 would I use parallel make on ExternalProjects?
On 10/7/2010 11:52 AM, kent williams wrote: 1. Is that $(MAKE) or is it ${MAKE} ? One thing missing from the CMake documentation -- unless I'm mistaken there's not much explanation of CMake syntax in the documentation. No, this is make syntax not CMake syntax. 2. I think it's probably not what one intends to have 'make -j4' (for example) used every time make is invoked. If you configure a program that includes several ExternalProjects, then it would spawn 4 concurrent builds of those ExternalProjects, and then each of those builds would spawn 4 make steps at once, for 16 concurrent processes. What you want is for make to treat the external projects just like any other library or executable in a build. so, if you run this at the top of the build: make -j4 It should run at most 4 concurrent things at once for the whole thing. By using $(MAKE) in the makefiles make will do that. That said, CMake will do this by default for make based builds and external projects now. From ExternalProject.cmake: get_target_property(cmake_generator ${name} _EP_CMAKE_GENERATOR) if(${CMAKE_GENERATOR} MATCHES Make AND (${cmake_generator} STREQUAL ${CMAKE_GENERATOR} OR NOT cmake_generator)) # The project uses the same Makefile generator. Use recursive make. set(cmd $(MAKE)) if(step STREQUAL INSTALL) set(args install) endif() -Bill ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] How would I use parallel make on ExternalProjects?
On Thu, Oct 7, 2010 at 11:05 AM, Bill Hoffman bill.hoff...@kitware.com wrote: What you want is for make to treat the external projects just like any other library or executable in a build. so, if you run this at the top of the build: make -j4 It should run at most 4 concurrent things at once for the whole thing. By using $(MAKE) in the makefiles make will do that. There is one problem with that, which is what I'm trying to address: load balancing. If your project builds ITK, VTK, and sundry other prerequisite libraries, it will spawn 4 sequential builds. In practice this means everything except ITK (which we build with wrapping on) finishes, and then ITK chugs along doing its sequential build. If I do what I'm talking about, I'd sequentially conduct parallel builds of ITK VTK etc. In which case the big hairy libraries, like ITK with wrapping, get built in parallel. That said, CMake will do this by default for make based builds and external projects now. From ExternalProject.cmake: get_target_property(cmake_generator ${name} _EP_CMAKE_GENERATOR) if(${CMAKE_GENERATOR} MATCHES Make AND (${cmake_generator} STREQUAL ${CMAKE_GENERATOR} OR NOT cmake_generator)) # The project uses the same Makefile generator. Use recursive make. set(cmd $(MAKE)) if(step STREQUAL INSTALL) set(args install) endif() -Bill ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] How would I use parallel make on ExternalProjects?
On 10/7/2010 12:13 PM, kent williams wrote: On Thu, Oct 7, 2010 at 11:05 AM, Bill Hoffmanbill.hoff...@kitware.com wrote: What you want is for make to treat the external projects just like any other library or executable in a build. so, if you run this at the top of the build: make -j4 It should run at most 4 concurrent things at once for the whole thing. By using $(MAKE) in the makefiles make will do that. There is one problem with that, which is what I'm trying to address: load balancing. If your project builds ITK, VTK, and sundry other prerequisite libraries, it will spawn 4 sequential builds. In practice this means everything except ITK (which we build with wrapping on) finishes, and then ITK chugs along doing its sequential build. If I do what I'm talking about, I'd sequentially conduct parallel builds of ITK VTK etc. In which case the big hairy libraries, like ITK with wrapping, get built in parallel. ITK will not do a sequential build. The -j N gets passed down to all the sub projects as well. It will run N build rules at the same time from VTK, ITK and everything else.Just like it was all one big project... -Bill ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Is there a tool pretty much like cmake for Java?
On 10/07/2010 09:57 AM, Andreas Schneider wrote: On Thursday 07 October 2010 16:45:49 Andreas Schneider wrote: My current problem is with javah (C header file generator). This generator works on the class files. The class files aren't in CMAKE_CURRENT_BINARY_DIR they are located in: ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/project.dir/some/directory/foo bar.class So my current problem is how to point the generator there ... In the language information file, this isOBJECT_DIR so is there something like CMAKE_CURRENT_OBJECT_DIR? -- andreas I made a CMake-based build for the VRPN Java bindings, which require a javah call. I have no experience actually using them, so I'm not sure if they work, but they certainly compile. (Of course, I didn't realize there was CMake Java support, so this is all add_custom_command/target driven) Perhaps it will help: http://github.com/rpavlik/vrpn/blob/cmake-java/java_vrpn/CMakeLists.txt Hope this helps! Ryan -- Ryan Pavlik HCI Graduate Student Virtual Reality Applications Center Iowa State University Member, ACM and ACM SIGCHI Member, ASME http://academic.cleardefinition.com ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Disallowing in-source builds
Yeah, I think I'll go with something like what you are saying. I wonder if I can remove the CMakeFiles directory and the CMakeCache.txt file from within the CMakeLists script... Aaron C. Meadows Hi all. Is there a good way to disallow in-source builds? Ideally, I'd like to prevent it before any cruft is written into the source tree. I experimented with writing a function into my CMakelists file and calling it. The function checked if CMAKE_BINARY_DIR was equal to CMAKE_SOURCE_DIR and messaged a FATAL_ERROR if that was the case. This works ok, but still generates a CMakeFiles directory and a CMakeCache.txt file. I don't think there's a way to prevent that from happening. The bad thing about this is that if the user doesn't clean away the in-source CMakeCache.txt file, subsequent out-of-source builds will fail. Perhaps you can do something like this: # check for polluted source tree if(EXISTS ${CMAKE_SOURCE_DIR}/CMakeCache.txt OR EXISTS ${CMAKE_SOURCE_DIR}/CMakeFiles) message(FATAL_ERROR CMakeCache.txt or CMakeFiles exists in source directory!) endif() # make sure the user doesn't play dirty with symlinks get_filename_component(srcdir ${CMAKE_SOURCE_DIR} REALPATH) get_filename_component(bindir ${CMAKE_BINARY_DIR} REALPATH) # disallow in-source builds if(${srcdir} STREQUAL ${bindir}) message(FATAL_ERROR In-source builds are forbidden!) endif() The second half of the question is of course, is there an easy way to clean out a source tree if an in-source build was accidentally kicked off? (short of dividing the files by their timestamp and removing the newer ones, etc..) No, simply because CMake cannot. Your build system might have something like the following: execute_process(COMMAND echo BOOM ${CMAKE_BINARY_DIR}/boom.txt VERBATIM) CMake never knows that the file boom.txt is written, and therefor can't clean it away. The only reasonable way I know of is using git (http://git-scm.com): git clean -df will remove all the files and directories that are not part of the repository. With tar-ball builds it's easier. Just wipe the source tree and unpack again. Michael This email was sent to you by Thomson Reuters, the global news and information company. Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of Thomson Reuters. ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check 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 a tool pretty much like cmake for Java?
On 10/7/2010 12:37 PM, Ryan Pavlik wrote: On 10/07/2010 09:57 AM, Andreas Schneider wrote: On Thursday 07 October 2010 16:45:49 Andreas Schneider wrote: My current problem is with javah (C header file generator). This generator works on the class files. The class files aren't in CMAKE_CURRENT_BINARY_DIR they are located in: ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/project.dir/some/directory/foo bar.class So my current problem is how to point the generator there ... In the language information file, this isOBJECT_DIR so is there something like CMAKE_CURRENT_OBJECT_DIR? -- andreas I made a CMake-based build for the VRPN Java bindings, which require a javah call. I have no experience actually using them, so I'm not sure if they work, but they certainly compile. (Of course, I didn't realize there was CMake Java support, so this is all add_custom_command/target driven) Perhaps it will help: http://github.com/rpavlik/vrpn/blob/cmake-java/java_vrpn/CMakeLists.txt Hope this helps! Ryan The java support was broken a while ago when we re-organized the build trees. I don't have much time to work on this, but I would like to get it fixed. The best approach might be a pure custom command approach. We could model it after the scons java support which is quite simple. I am thinking of adding a module for java building into the Modules directory as java does not really fit our language type that well. Anyone want to help? -Bill -- Bill Hoffman Kitware, Inc. 28 Corporate Drive Clifton Park, NY 12065 bill.hoff...@kitware.com http://www.kitware.com 518 881-4905 (Direct) 518 371-3971 x105 Fax (518) 371-4573 ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check 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] Disallowing in-source builds
You could try, though it makes my brain hurt to think about it. Why go to such lengths to protect users from themselves? On Thu, Oct 7, 2010 at 11:57 AM, aaron.mead...@thomsonreuters.com wrote: Yeah, I think I'll go with something like what you are saying. I wonder if I can remove the CMakeFiles directory and the CMakeCache.txt file from within the CMakeLists script... Aaron C. Meadows Hi all. Is there a good way to disallow in-source builds? Ideally, I'd like to prevent it before any cruft is written into the source tree. I experimented with writing a function into my CMakelists file and calling it. The function checked if CMAKE_BINARY_DIR was equal to CMAKE_SOURCE_DIR and messaged a FATAL_ERROR if that was the case. This works ok, but still generates a CMakeFiles directory and a CMakeCache.txt file. I don't think there's a way to prevent that from happening. The bad thing about this is that if the user doesn't clean away the in-source CMakeCache.txt file, subsequent out-of-source builds will fail. Perhaps you can do something like this: # check for polluted source tree if(EXISTS ${CMAKE_SOURCE_DIR}/CMakeCache.txt OR EXISTS ${CMAKE_SOURCE_DIR}/CMakeFiles) message(FATAL_ERROR CMakeCache.txt or CMakeFiles exists in source directory!) endif() # make sure the user doesn't play dirty with symlinks get_filename_component(srcdir ${CMAKE_SOURCE_DIR} REALPATH) get_filename_component(bindir ${CMAKE_BINARY_DIR} REALPATH) # disallow in-source builds if(${srcdir} STREQUAL ${bindir}) message(FATAL_ERROR In-source builds are forbidden!) endif() The second half of the question is of course, is there an easy way to clean out a source tree if an in-source build was accidentally kicked off? (short of dividing the files by their timestamp and removing the newer ones, etc..) No, simply because CMake cannot. Your build system might have something like the following: execute_process(COMMAND echo BOOM ${CMAKE_BINARY_DIR}/boom.txt VERBATIM) CMake never knows that the file boom.txt is written, and therefor can't clean it away. The only reasonable way I know of is using git (http://git-scm.com): git clean -df will remove all the files and directories that are not part of the repository. With tar-ball builds it's easier. Just wipe the source tree and unpack again. Michael This email was sent to you by Thomson Reuters, the global news and information company. Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of Thomson Reuters. ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check 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] Is there a tool pretty much like cmake for Java?
On Thursday 07 October 2010 18:57:50 Bill Hoffman wrote: The java support was broken a while ago when we re-organized the build trees. I don't have much time to work on this, but I would like to get it fixed. The best approach might be a pure custom command approach. Hi Bill, with some modifications, the Java support works just fine. I just have some minor issues which I need to address. We could model it after the scons java support which is quite simple. I am thinking of adding a module for java building into the Modules directory as java does not really fit our language type that well. First I tought about doing that, but getting it to work in CMake made more sense do me. I is especally easier to work with CMake functions cause auf the dependencies then doing everything with Modules which provide functions for the Java language. Here are my modifications to the Java files: http://git.cynapses.org/users/asn/pki.git/tree/cmake/Modules?h=cmake This is still work in progress but it works just fine atm. The only thing is that is is ugly to get the OBJECT_DIR :) -Bill -- andreas ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check 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 a tool pretty much like cmake for Java?
On 10/7/2010 2:37 PM, Andreas Schneider wrote: On Thursday 07 October 2010 18:57:50 Bill Hoffman wrote: The java support was broken a while ago when we re-organized the build trees. I don't have much time to work on this, but I would like to get it fixed. The best approach might be a pure custom command approach. Hi Bill, with some modifications, the Java support works just fine. I just have some minor issues which I need to address. We could model it after the scons java support which is quite simple. I am thinking of adding a module for java building into the Modules directory as java does not really fit our language type that well. First I tought about doing that, but getting it to work in CMake made more sense do me. I is especally easier to work with CMake functions cause auf the dependencies then doing everything with Modules which provide functions for the Java language. Here are my modifications to the Java files: http://git.cynapses.org/users/asn/pki.git/tree/cmake/Modules?h=cmake This is still work in progress but it works just fine atm. The only thing is that is is ugly to get the OBJECT_DIR :) The other issue is VS builds. At one point, I had some magic, cmake language to custom command converter thing going for this, but I am thinking it might be broken. If we did a pure custom-command version, it would work in the IDE's (Xcode and VS) with no problem. Right now, your stuff will likely only work with makefiles. -Bill ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Is there a tool pretty much like cmake for Java?
On Thursday 07 October 2010 21:32:51 Bill Hoffman wrote: The other issue is VS builds. At one point, I had some magic, cmake language to custom command converter thing going for this, but I am thinking it might be broken. If we did a pure custom-command version, it would work in the IDE's (Xcode and VS) with no problem. Right now, your stuff will likely only work with makefiles. I see your point. So you want a UseJava.cmake file which provides functions like: add_jar add_jni_headers I think if you do it like that you will loose some nice features like add_definitions include_directories Or is it possible to use them? If you can guide me a bit I would implement it. At the moment it looks much harder to use functions with custom commands to me. -- andreas ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check 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 determine the number of processors available from CMake code
I just posted a short blog article demonstrating how to figure out the number of processors available for a make -j or a scripted ctest_build call (with the Unix Makefiles generator) on Linux, Mac and Windows. Please let me know if you have any ideas for how it might be improved or extended. http://www.kitware.com/blog/home/post/63 Cheers, David Blog text copied here, too, for search-ability on the mailing list archives: == At the end of this script snippet, the CMake variable PROCESSOR_COUNT has a value appropriate for passing to make's -j for parallel builds. When used in a ctest -S script, you can call... if(PROCESSOR_COUNT) set(CTEST_BUILD_FLAGS -j${PROCESSOR_COUNT}) endif() ...to enable parallel builds with Unix Makefiles and the ctest_build command. Here's the snippet: if(NOT DEFINED PROCESSOR_COUNT) # Unknown: set(PROCESSOR_COUNT 0) # Linux: set(cpuinfo_file /proc/cpuinfo) if(EXISTS ${cpuinfo_file}) file(STRINGS ${cpuinfo_file} procs REGEX ^processor.: [0-9]+$) list(LENGTH procs PROCESSOR_COUNT) endif() # Mac: if(APPLE) find_program(cmd_sys_pro system_profiler) if(cmd_sys_pro) execute_process(COMMAND ${cmd_sys_pro} OUTPUT_VARIABLE info) string(REGEX REPLACE ^.*Total Number Of Cores: ([0-9]+).*$ \\1 PROCESSOR_COUNT ${info}) endif() endif() # Windows: if(WIN32) set(PROCESSOR_COUNT $ENV{NUMBER_OF_PROCESSORS}) endif() endif() ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check 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] Disallowing in-source builds
I'd rather make it as hard as possible to form bad habits. It would also be helpful to me. I've moved to the console and typed cmake . several times thinking I was in the build directory, and then cussed quite a bit while digging through removing cruft. (Points on Version Control taken, I'll take care of that shortly...) Aaron C. Meadows -Original Message- From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf Of kent williams Sent: Thursday, October 07, 2010 12:55 PM To: CMake ML Subject: Re: [CMake] Disallowing in-source builds You could try, though it makes my brain hurt to think about it. Why go to such lengths to protect users from themselves? On Thu, Oct 7, 2010 at 11:57 AM, aaron.mead...@thomsonreuters.com wrote: Yeah, I think I'll go with something like what you are saying. I wonder if I can remove the CMakeFiles directory and the CMakeCache.txt file from within the CMakeLists script... Aaron C. Meadows Hi all. Is there a good way to disallow in-source builds? Ideally, I'd like to prevent it before any cruft is written into the source tree. I experimented with writing a function into my CMakelists file and calling it. The function checked if CMAKE_BINARY_DIR was equal to CMAKE_SOURCE_DIR and messaged a FATAL_ERROR if that was the case. This works ok, but still generates a CMakeFiles directory and a CMakeCache.txt file. I don't think there's a way to prevent that from happening. The bad thing about this is that if the user doesn't clean away the in-source CMakeCache.txt file, subsequent out-of-source builds will fail. Perhaps you can do something like this: # check for polluted source tree if(EXISTS ${CMAKE_SOURCE_DIR}/CMakeCache.txt OR EXISTS ${CMAKE_SOURCE_DIR}/CMakeFiles) message(FATAL_ERROR CMakeCache.txt or CMakeFiles exists in source directory!) endif() # make sure the user doesn't play dirty with symlinks get_filename_component(srcdir ${CMAKE_SOURCE_DIR} REALPATH) get_filename_component(bindir ${CMAKE_BINARY_DIR} REALPATH) # disallow in-source builds if(${srcdir} STREQUAL ${bindir}) message(FATAL_ERROR In-source builds are forbidden!) endif() The second half of the question is of course, is there an easy way to clean out a source tree if an in-source build was accidentally kicked off? (short of dividing the files by their timestamp and removing the newer ones, etc..) No, simply because CMake cannot. Your build system might have something like the following: execute_process(COMMAND echo BOOM ${CMAKE_BINARY_DIR}/boom.txt VERBATIM) CMake never knows that the file boom.txt is written, and therefor can't clean it away. The only reasonable way I know of is using git (http://git-scm.com): git clean -df will remove all the files and directories that are not part of the repository. With tar-ball builds it's easier. Just wipe the source tree and unpack again. Michael This email was sent to you by Thomson Reuters, the global news and information company. Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of Thomson Reuters. ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check 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 This email was sent to you by Thomson Reuters, the global news and information company. Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of Thomson Reuters. ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check 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] Less Noisy Makefiles?
On Thu, Oct 7, 2010 at 8:48 PM, Campbell Barton ideasma...@gmail.com wrote: On Thu, Oct 7, 2010 at 10:44 AM, Michael Wild them...@gmail.com wrote: On 7. Oct, 2010, at 11:58 , Campbell Barton wrote: Hi, I was wondering if this is possible or if it would be acceptable to disable progress printout. At the moment building with only minor changes prints a lot of text with CMake Makefiles. eg: [ 4%] Built target bf_intern_audaspace [ 4%] Built target bf_intern_string [ 6%] Built target bf_intern_ghost full log. http://www.pasteall.org/16053 Setting: SET_PROPERTY(GLOBAL PROPERTY RULE_MESSAGES OFF) is no good because I want to see the lines which are running/building, just not the progress lines that do nothing (the reverse really). I found some messages about this but they only refer to RULE_MESSAGES. This may seem silly but its actually one of the reasons we still have hand written makefiles in our project (which Im trying to get replaced with cmake). Would this be acceptable? what happens if you run make VERBOSE=1 or enable CMAKE_VERBOSE_MAKEFILE? Michael -- There is always a well-known solution to every human problem -- neat, plausible, and wrong. H. L. Mencken using verbose makefiles it gives a lot of output even when running a build with no changes to any C files. http://www.pasteall.org/16061 Im pretty happy with cmake's current output, its just for doing rebuilds during development where only a few files change, the progress gets in the way of seeing output of the files which do rebuild. So I think it would be good to have a RULE_PROGRESS option, since I still want to see RULE_MESSAGES. Im using CMake from GIT, and IIRC RULE_MESSAGES used to disable progress, this link confirms. http://www.itk.org/Bug/bug_view_advanced_page.php?bug_id=8726 but at the moment % progress is enabled whatever its set to. -- - Campbell ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] how to get cmake and custom qt widget to work?
tried that, no go On Tue 05 Oct 21:44 2010 John Drescher wrote: On Tue, Oct 5, 2010 at 3:41 PM, e...@cs.bgu.ac.il e...@cs.bgu.ac.il wrote: nope, like I wrote in the first post, I need a string spinbox so I've extended qspinbox to support strings. that is the custom widget in question. You need to add the path of where ever your custom widget is into one of the INCLUDE_DIRECTORIES statements in your CMakeLists.txt John ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Less Noisy Makefiles?
On Thu, Oct 7, 2010 at 5:34 PM, Campbell Barton ideasma...@gmail.comwrote: On Thu, Oct 7, 2010 at 8:48 PM, Campbell Barton ideasma...@gmail.com wrote: On Thu, Oct 7, 2010 at 10:44 AM, Michael Wild them...@gmail.com wrote: On 7. Oct, 2010, at 11:58 , Campbell Barton wrote: Hi, I was wondering if this is possible or if it would be acceptable to disable progress printout. At the moment building with only minor changes prints a lot of text with CMake Makefiles. eg: [ 4%] Built target bf_intern_audaspace [ 4%] Built target bf_intern_string [ 6%] Built target bf_intern_ghost full log. http://www.pasteall.org/16053 Setting: SET_PROPERTY(GLOBAL PROPERTY RULE_MESSAGES OFF) is no good because I want to see the lines which are running/building, just not the progress lines that do nothing (the reverse really). I found some messages about this but they only refer to RULE_MESSAGES. This may seem silly but its actually one of the reasons we still have hand written makefiles in our project (which Im trying to get replaced with cmake). Would this be acceptable? what happens if you run make VERBOSE=1 or enable CMAKE_VERBOSE_MAKEFILE? Michael -- There is always a well-known solution to every human problem -- neat, plausible, and wrong. H. L. Mencken using verbose makefiles it gives a lot of output even when running a build with no changes to any C files. http://www.pasteall.org/16061 Im pretty happy with cmake's current output, its just for doing rebuilds during development where only a few files change, the progress gets in the way of seeing output of the files which do rebuild. So I think it would be good to have a RULE_PROGRESS option, since I still want to see RULE_MESSAGES. Im using CMake from GIT, and IIRC RULE_MESSAGES used to disable progress, this link confirms. http://www.itk.org/Bug/bug_view_advanced_page.php?bug_id=8726 but at the moment % progress is enabled whatever its set to. -- - Campbell ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake According to the last note in bug #8726, you should run cmake with: -DCMAKE_RULE_MESSAGES=OFF to turn these things off. Have you done that? Or have you only tried the RULE_MESSAGES global property? I have not looked at the code, but the bug says something different than what your email says. -D variables and global properties are 2 different things... If you use -D to set CMAKE_RULE_MESSAGES to OFF does it actually turn them off? ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check 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 determine the number of processors available from CMake code
Thanks! On Thu, Oct 7, 2010 at 6:08 PM, Mark Moll mm...@rice.edu wrote: On OS X, this command might be easier / faster: sysctl -n hw.ncpu On Oct 7, 2010, at 3:50 PM, David Cole wrote: I just posted a short blog article demonstrating how to figure out the number of processors available for a make -j or a scripted ctest_build call (with the Unix Makefiles generator) on Linux, Mac and Windows. Please let me know if you have any ideas for how it might be improved or extended. http://www.kitware.com/blog/home/post/63 Cheers, David Blog text copied here, too, for search-ability on the mailing list archives: == At the end of this script snippet, the CMake variable PROCESSOR_COUNT has a value appropriate for passing to make's -j for parallel builds. When used in a ctest -S script, you can call... if(PROCESSOR_COUNT) set(CTEST_BUILD_FLAGS -j${PROCESSOR_COUNT}) endif() ...to enable parallel builds with Unix Makefiles and the ctest_build command. Here's the snippet: if(NOT DEFINED PROCESSOR_COUNT) # Unknown: set(PROCESSOR_COUNT 0) # Linux: set(cpuinfo_file /proc/cpuinfo) if(EXISTS ${cpuinfo_file}) file(STRINGS ${cpuinfo_file} procs REGEX ^processor.: [0-9]+$) list(LENGTH procs PROCESSOR_COUNT) endif() # Mac: if(APPLE) find_program(cmd_sys_pro system_profiler) if(cmd_sys_pro) execute_process(COMMAND ${cmd_sys_pro} OUTPUT_VARIABLE info) string(REGEX REPLACE ^.*Total Number Of Cores: ([0-9]+).*$ \\1 PROCESSOR_COUNT ${info}) endif() endif() # Windows: if(WIN32) set(PROCESSOR_COUNT $ENV{NUMBER_OF_PROCESSORS}) endif() endif() ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake -- Mark Moll ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check 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] Why drop -D from wxWidgets_DEFINITIONS ?
Hi, The FindwxWidget.cmake module in 2.8 is breaking the build of MRIConvert [1] because it strips -D from the output of wx-config --cxxflags. Is this not a bug? This question was asked here last October [2] but not answered. Thanks, -Steve [1] http://lcni.uoregon.edu/~jolinda/MRIConvert/ [2] http://www.cmake.org/pipermail/cmake/2009-October/032831.html signature.asc Description: 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
[CMake] Can not found CMAKE_C_COMPILER after upgrading to v2.8 on Cygwin
Hi, I used to use CMake v2.6 on Cygwin-1.7 to build codes for MIPS. It works well and my scripts like: - CMakeLists.txt start - CMAKE_MINIMUM_REQUIRED(VERSION 2.6) INCLUDE(CMakeForceCompiler) SET(CMAKE_SYSTEM_NAME Generic) # specify the cross compiler CMAKE_FORCE_C_COMPILER(/cygdrive/c/sde6/bin/sde-gcc GNU) CMAKE_FORCE_CXX_COMPILER(/cygdrive/c/sde6/bin/sde-g++ GNU) # where is the target environment SET(CMAKE_FIND_ROOT_PATH /cygdrive/c/sde6) # search for programs in the build host directories SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) # for libraries and headers in the target directories SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) - CMakeLists.txt end - However, I upgrade cmake packeages to 2.8.2 few days ago. It showes error after typing cmake . - Error start - CMake Error: your C compiler: /cygdrive/c/sde6/bin/sde-gcc was not found. Please set CMAKE_C_COMPILER to a valid compiler path or name. CMake Error: your CXX compiler: /cygdrive/c/sde6/bin/sde-g++ was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name. - Error end - Could anyone kindly give me some hints? Best regards, Sam ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check 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] Less Noisy Makefiles?
On Thu, Oct 7, 2010 at 9:55 PM, David Cole david.c...@kitware.com wrote: On Thu, Oct 7, 2010 at 5:34 PM, Campbell Barton ideasma...@gmail.com wrote: On Thu, Oct 7, 2010 at 8:48 PM, Campbell Barton ideasma...@gmail.com wrote: On Thu, Oct 7, 2010 at 10:44 AM, Michael Wild them...@gmail.com wrote: On 7. Oct, 2010, at 11:58 , Campbell Barton wrote: Hi, I was wondering if this is possible or if it would be acceptable to disable progress printout. At the moment building with only minor changes prints a lot of text with CMake Makefiles. eg: [ 4%] Built target bf_intern_audaspace [ 4%] Built target bf_intern_string [ 6%] Built target bf_intern_ghost full log. http://www.pasteall.org/16053 Setting: SET_PROPERTY(GLOBAL PROPERTY RULE_MESSAGES OFF) is no good because I want to see the lines which are running/building, just not the progress lines that do nothing (the reverse really). I found some messages about this but they only refer to RULE_MESSAGES. This may seem silly but its actually one of the reasons we still have hand written makefiles in our project (which Im trying to get replaced with cmake). Would this be acceptable? what happens if you run make VERBOSE=1 or enable CMAKE_VERBOSE_MAKEFILE? Michael -- There is always a well-known solution to every human problem -- neat, plausible, and wrong. H. L. Mencken using verbose makefiles it gives a lot of output even when running a build with no changes to any C files. http://www.pasteall.org/16061 Im pretty happy with cmake's current output, its just for doing rebuilds during development where only a few files change, the progress gets in the way of seeing output of the files which do rebuild. So I think it would be good to have a RULE_PROGRESS option, since I still want to see RULE_MESSAGES. Im using CMake from GIT, and IIRC RULE_MESSAGES used to disable progress, this link confirms. http://www.itk.org/Bug/bug_view_advanced_page.php?bug_id=8726 but at the moment % progress is enabled whatever its set to. -- - Campbell ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake According to the last note in bug #8726, you should run cmake with: -DCMAKE_RULE_MESSAGES=OFF to turn these things off. Have you done that? Or have you only tried the RULE_MESSAGES global property? I have not looked at the code, but the bug says something different than what your email says. -D variables and global properties are 2 different things... If you use -D to set CMAKE_RULE_MESSAGES to OFF does it actually turn them off? I tried both in latest GIT's cmake, nether turn the progress off also looked into the code and from what I can tell there are no checks supress progress. -- - Campbell ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check 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-commits] CMake branch, next, updated. v2.8.2-1021-g19b37e6
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project CMake. The branch, next has been updated via 19b37e653d1e13b77e02e6f23bec87cda18d0a66 (commit) via 42126aaf6ca83bbfbebab364a026763f62770bf7 (commit) from a692da327906df8bb556844e846316b86eec87eb (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log - http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=19b37e653d1e13b77e02e6f23bec87cda18d0a66 commit 19b37e653d1e13b77e02e6f23bec87cda18d0a66 Merge: a692da3 42126aa Author: Brad King brad.k...@kitware.com AuthorDate: Thu Oct 7 10:11:54 2010 -0400 Commit: CMake Topic Stage kwro...@kitware.com CommitDate: Thu Oct 7 10:11:54 2010 -0400 Merge topic 'find-subversion-foreign-lang' into next 42126aa FindSubversion: Fix for German localized client (#11273) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=42126aaf6ca83bbfbebab364a026763f62770bf7 commit 42126aaf6ca83bbfbebab364a026763f62770bf7 Author: Rolf Eike Beer e...@sf-mail.de AuthorDate: Thu Oct 7 00:24:44 2010 +0200 Commit: Brad King brad.k...@kitware.com CommitDate: Thu Oct 7 10:04:19 2010 -0400 FindSubversion: Fix for German localized client (#11273) On a Win32 system with a German version of SilkSVN I couldn't run CMake again on the working copy as the cache is displayed as corrupted. The cause is that the regular expression to find the version number will not match and put everything from the svn --version output into the cache, which contains umlauts and other funny characters. Fix the regexp to not only match version but also Version as it's in the German output. I have no idea what will happen on a French or Japanese system. This should be easy to test as it happens also on a German Linux system. diff --git a/Modules/FindSubversion.cmake b/Modules/FindSubversion.cmake index daf3d87..61e0253 100644 --- a/Modules/FindSubversion.cmake +++ b/Modules/FindSubversion.cmake @@ -57,7 +57,7 @@ IF(Subversion_SVN_EXECUTABLE) OUTPUT_VARIABLE Subversion_VERSION_SVN OUTPUT_STRIP_TRAILING_WHITESPACE) - STRING(REGEX REPLACE ^(.*\n)?svn, version ([.0-9]+).* + STRING(REGEX REPLACE ^(.*\n)?svn, [Vv]ersion ([.0-9]+).* \\2 Subversion_VERSION_SVN ${Subversion_VERSION_SVN}) MACRO(Subversion_WC_INFO dir prefix) --- Summary of changes: Modules/FindSubversion.cmake |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) hooks/post-receive -- CMake ___ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits
[Cmake-commits] CMake branch, next, updated. v2.8.2-1023-gd99c2b9
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project CMake. The branch, next has been updated via d99c2b95dcc5e8c5234312121dfa0a699bb3c30d (commit) via 973df7c0e94f0bbc0403c6e2038363a75bb81bca (commit) from 19b37e653d1e13b77e02e6f23bec87cda18d0a66 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log - http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d99c2b95dcc5e8c5234312121dfa0a699bb3c30d commit d99c2b95dcc5e8c5234312121dfa0a699bb3c30d Merge: 19b37e6 973df7c Author: Brad King brad.k...@kitware.com AuthorDate: Thu Oct 7 10:14:16 2010 -0400 Commit: CMake Topic Stage kwro...@kitware.com CommitDate: Thu Oct 7 10:14:16 2010 -0400 Merge topic 'vs10-order-dependencies' into next 973df7c VS10: Order .vcxproj dependencies deterministically (#10502) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=973df7c0e94f0bbc0403c6e2038363a75bb81bca commit 973df7c0e94f0bbc0403c6e2038363a75bb81bca Author: Brad King brad.k...@kitware.com AuthorDate: Thu Oct 7 09:54:24 2010 -0400 Commit: Brad King brad.k...@kitware.com CommitDate: Thu Oct 7 09:54:24 2010 -0400 VS10: Order .vcxproj dependencies deterministically (#10502) This avoids needless modification of the project files during regeneration. diff --git a/Source/cmGlobalVisualStudioGenerator.h b/Source/cmGlobalVisualStudioGenerator.h index daa6b3a..c8ea339 100644 --- a/Source/cmGlobalVisualStudioGenerator.h +++ b/Source/cmGlobalVisualStudioGenerator.h @@ -69,14 +69,6 @@ public: i.e. Can I build Debug and Release in the same tree? */ virtual bool IsMultiConfig() { return true; } -protected: - // Does this VS version link targets to each other if there are - // dependencies in the SLN file? This was done for VS versions - // below 8. - virtual bool VSLinksDependencies() const { return true; } - - virtual const char* GetIDEVersion() = 0; - struct TargetCompare { bool operator()(cmTarget const* l, cmTarget const* r) const; @@ -87,6 +79,14 @@ protected: OrderedTargetDependSet(cmGlobalGenerator::TargetDependSet const); }; +protected: + // Does this VS version link targets to each other if there are + // dependencies in the SLN file? This was done for VS versions + // below 8. + virtual bool VSLinksDependencies() const { return true; } + + virtual const char* GetIDEVersion() = 0; + virtual bool ComputeTargetDepends(); class VSDependSet: public std::setcmStdString {}; class VSDependMap: public std::mapcmTarget*, VSDependSet {}; diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 9c0364b..524be8b 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -1479,10 +1479,13 @@ void cmVisualStudio10TargetGenerator::WriteEvent( void cmVisualStudio10TargetGenerator::WriteProjectReferences() { - cmGlobalGenerator::TargetDependSet const depends + cmGlobalGenerator::TargetDependSet const unordered = this-GlobalGenerator-GetTargetDirectDepends(*this-Target); + typedef cmGlobalVisualStudioGenerator::OrderedTargetDependSet +OrderedTargetDependSet; + OrderedTargetDependSet depends(unordered); this-WriteString(ItemGroup\n, 1); - for( cmGlobalGenerator::TargetDependSet::const_iterator i = depends.begin(); + for( OrderedTargetDependSet::const_iterator i = depends.begin(); i != depends.end(); ++i) { cmTarget* dt = *i; --- Summary of changes: Source/cmGlobalVisualStudioGenerator.h | 16 Source/cmVisualStudio10TargetGenerator.cxx |7 +-- 2 files changed, 13 insertions(+), 10 deletions(-) hooks/post-receive -- CMake ___ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits
[Cmake-commits] CMake branch, next, updated. v2.8.2-1027-g7143d44
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project CMake. The branch, next has been updated via 7143d44ef520df02e33ef23ceb57a3f4e99dbfb6 (commit) via d4ee998b61cf3c16e9e04da2173490589790a894 (commit) from 8d5237e469b64faa37c69ef889ee23a46aa18f58 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log - http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7143d44ef520df02e33ef23ceb57a3f4e99dbfb6 commit 7143d44ef520df02e33ef23ceb57a3f4e99dbfb6 Merge: 8d5237e d4ee998 Author: Ben Boeckel ben.boec...@kitware.com AuthorDate: Thu Oct 7 12:24:41 2010 -0400 Commit: CMake Topic Stage kwro...@kitware.com CommitDate: Thu Oct 7 12:24:41 2010 -0400 Merge topic 'dev/strict-mode' into next d4ee998 Hard-code the --no-warn-unused-cli flag http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d4ee998b61cf3c16e9e04da2173490589790a894 commit d4ee998b61cf3c16e9e04da2173490589790a894 Author: Ben Boeckel ben.boec...@kitware.com AuthorDate: Thu Oct 7 12:22:00 2010 -0400 Commit: Ben Boeckel ben.boec...@kitware.com CommitDate: Thu Oct 7 12:22:00 2010 -0400 Hard-code the --no-warn-unused-cli flag diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index a4a79be..ed34569 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -2810,7 +2810,11 @@ int cmMakefile::TryCompile(const char *srcdir, const char *bindir, // if cmake args were provided then pass them in if (cmakeArgs) { -cm.SetArgs(*cmakeArgs, true); +// FIXME: Workaround to ignore unused CLI variables until the +// 'ArgumentExpansion' test succeeds with CMAKE_STRICT on +cm.SetWarnUnusedCli(true); +//cm.SetArgs(*cmakeArgs, true); + cm.SetCacheArgs(*cmakeArgs); } // to save time we pass the EnableLanguage info directly --- Summary of changes: Source/cmMakefile.cxx |6 +- 1 files changed, 5 insertions(+), 1 deletions(-) hooks/post-receive -- CMake ___ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits
[Cmake-commits] CMake branch, next, updated. v2.8.2-1029-g0fe364f
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project CMake. The branch, next has been updated via 0fe364f8aa695630ab52dc5e07da186cc8b3ada2 (commit) via 8dbb2090a2fac15f61710afef9887e224c1c7f72 (commit) from 7143d44ef520df02e33ef23ceb57a3f4e99dbfb6 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log - http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0fe364f8aa695630ab52dc5e07da186cc8b3ada2 commit 0fe364f8aa695630ab52dc5e07da186cc8b3ada2 Merge: 7143d44 8dbb209 Author: Ben Boeckel ben.boec...@kitware.com AuthorDate: Thu Oct 7 12:29:10 2010 -0400 Commit: CMake Topic Stage kwro...@kitware.com CommitDate: Thu Oct 7 12:29:10 2010 -0400 Merge topic 'dev/strict-mode' into next 8dbb209 Wrong boolean value for CLI warnings http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8dbb2090a2fac15f61710afef9887e224c1c7f72 commit 8dbb2090a2fac15f61710afef9887e224c1c7f72 Author: Ben Boeckel ben.boec...@kitware.com AuthorDate: Thu Oct 7 12:28:25 2010 -0400 Commit: Ben Boeckel ben.boec...@kitware.com CommitDate: Thu Oct 7 12:28:25 2010 -0400 Wrong boolean value for CLI warnings diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index ed34569..15c5370 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -2812,7 +2812,7 @@ int cmMakefile::TryCompile(const char *srcdir, const char *bindir, { // FIXME: Workaround to ignore unused CLI variables until the // 'ArgumentExpansion' test succeeds with CMAKE_STRICT on -cm.SetWarnUnusedCli(true); +cm.SetWarnUnusedCli(false); //cm.SetArgs(*cmakeArgs, true); cm.SetCacheArgs(*cmakeArgs); --- Summary of changes: Source/cmMakefile.cxx |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) hooks/post-receive -- CMake ___ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits
[Cmake-commits] CMake branch, next, updated. v2.8.2-1031-g94ed8db
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project CMake. The branch, next has been updated via 94ed8dbe202db1ee68be2e768cbba2a97b8f755a (commit) via fe390a2607afcd8f0985a54990236a3ea16643ab (commit) from 0fe364f8aa695630ab52dc5e07da186cc8b3ada2 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log - http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=94ed8dbe202db1ee68be2e768cbba2a97b8f755a commit 94ed8dbe202db1ee68be2e768cbba2a97b8f755a Merge: 0fe364f fe390a2 Author: Ben Boeckel ben.boec...@kitware.com AuthorDate: Thu Oct 7 13:02:18 2010 -0400 Commit: CMake Topic Stage kwro...@kitware.com CommitDate: Thu Oct 7 13:02:18 2010 -0400 Merge topic 'dev/strict-mode' into next fe390a2 Add 'ArgumentExpansion' test http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fe390a2607afcd8f0985a54990236a3ea16643ab commit fe390a2607afcd8f0985a54990236a3ea16643ab Author: Ben Boeckel ben.boec...@kitware.com AuthorDate: Thu Oct 7 12:29:43 2010 -0400 Commit: Ben Boeckel ben.boec...@kitware.com CommitDate: Thu Oct 7 13:01:32 2010 -0400 Add 'ArgumentExpansion' test diff --git a/Tests/ArgumentExpansion/CMakeLists.txt b/Tests/ArgumentExpansion/CMakeLists.txt new file mode 100644 index 000..bd78169 --- /dev/null +++ b/Tests/ArgumentExpansion/CMakeLists.txt @@ -0,0 +1,59 @@ +cmake_minimum_required(VERSION 2.8) + +project(ArgumentExpansion) + +function (argument_tester expected expected_len) +list(LENGTH ARGN argn_len) +list(LENGTH ${expected} expected_received_len) + +if (NOT ${expected_received_len} EQUAL ${expected_len}) +message(STATUS Error: Expanding expected values isn't working) +endif (NOT ${expected_received_len} EQUAL ${expected_len}) + +if (${argn_len} EQUAL ${expected_len}) +set(i 0) +while (i LESS ${argn_len}) +list(GET ARGN ${i} argn_value) +list(GET ${expected} ${i} expected_value) + +if (NOT ${argn_value} STREQUAL ${expected_value}) +message(STATUS Error: Argument ${i} doesn't match) +message(STATUS Expected: ${expected_value}) +message(STATUS Received: ${argn_value}) +endif (NOT ${argn_value} STREQUAL ${expected_value}) + +math(EXPR i ${i} + 1) +endwhile (i LESS ${argn_len}) +else (${argn_len} EQUAL ${expected_len}) +message(STATUS Error: Lengths of arguments don't match) +message(STATUS Expected: ${expected_len}) +message(STATUS Received: ${argn_len}) +endif (${argn_len} EQUAL ${expected_len}) +endfunction (argument_tester expected) + +set(empty_test) +message(STATUS Test: Empty arguments) +argument_tester(empty_test 0 ${empty_test}) + +set(single_arg_test +single arg) +message(STATUS Test: Single argument) +argument_tester(single_arg_test 1 ${single_arg_test}) + +set(multiple_arg_test +first arg +second arg) +message(STATUS Test: Multiple arguments) +argument_tester(multiple_arg_test 2 ${multiple_arg_test}) + +set(nested_list_arg_test +${multiple_arg_test} +first arg +second arg) +message(STATUS Test: Nested list argument) +argument_tester(nested_list_arg_test 3 ${nested_list_arg_test}) + +set(semicolon_arg_test +pre\;post) +message(STATUS Test: Semicolon argument) +argument_tester(semicolon_arg_test 1 ${semicolon_arg_test}) diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 739dcdf..a725354 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -368,6 +368,21 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ ) LIST(APPEND TEST_BUILD_DIRS ${CMake_BINARY_DIR}/Tests/CustComDepend) + ADD_TEST(ArgumentExpansion ${CMAKE_CTEST_COMMAND} +--build-and-test +${CMake_SOURCE_DIR}/Tests/ArgumentExpansion +${CMake_BINARY_DIR}/Tests/ArgumentExpansion +--build-generator ${CMAKE_TEST_GENERATOR} +--build-project ArgumentExpansion +--build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} +--build-exe-dir ${CMake_BINARY_DIR}/Tests/ArgumentExpansion/bin +) + IF(CMAKE_STRICT) +SET_TESTS_PROPERTIES(ArgumentExpansion PROPERTIES + FAIL_REGULAR_EXPRESSION Error: ) + ENDIF(CMAKE_STRICT) + LIST(APPEND TEST_BUILD_DIRS ${CMake_BINARY_DIR}/Tests/ArgumentExpansion) + ADD_TEST(CustomCommand ${CMAKE_CTEST_COMMAND} --build-and-test ${CMake_SOURCE_DIR}/Tests/CustomCommand --- Summary of changes: Tests/ArgumentExpansion/CMakeLists.txt | 59 Tests/CMakeLists.txt | 15 2 files changed, 74 insertions(+), 0 deletions(-) create