[cmake-developers] [CMake 0012448]: install_manifest.txt syntax incompatible with RPM white space requirements -- easy/concise packaging handling mode not usable
The following issue has been SUBMITTED. == http://www.itk.org/Bug/view.php?id=12448 == Reported By:Andreas Mohr Assigned To: == Project:CMake Issue ID: 12448 Category: CMake Reproducibility:always Severity: major Priority: high Status: new == Date Submitted: 2011-09-06 04:28 EDT Last Modified: 2011-09-06 04:28 EDT == Summary:install_manifest.txt syntax incompatible with RPM white space requirements -- easy/concise packaging handling mode not usable Description: Hi, I'm using the RPM .spec %files -f files.list syntax (see http://www.rpm.org/max-rpm-snapshot/s1-rpm-specref-files-list.html ), (via a set(SPECFILE_INSTALL_MANIFEST_FILE_template ${CMAKE_BINARY_DIR}/install_manifest.txt) to have rpmbuild successfully reach the packaging-tree-external manifest file). Unfortunately, with my awfully Windows-tainted source tree, this fails horribly due to many files with embedded whitespace. For the result, see Re: spaces in file names. http://www.redhat.com/archives/rpm-list/2001-November/msg00051.html Filenames with blanks http://www.redhat.com/archives/rpm-list/2001-November/msg00051.html Note that it does not seem to be an issue on the RPM .spec side - since they support multiple files per line, they use spaces as separators, and since that is a conflict with embedded-space files, they do seem to support the usual quoting convention to properly indicate this. One could argue that specifying an install manifest in %files line is exactly the way that packaging _should_ always be done - it's a manifest file as precisely created by the build/install tree, with all permissions declared via install() statements, and RPM .spec then simply adopting that compiled list and packaging it up. Thus no need to have any hassle whatsoever with manual, bit-rotting and maintenance-prone individual custom lines. Thus it's rather shocking that such a precise way is the one that fails. The question now would be how to fix it. One could add a CMake variable (e.g. CMAKE_INSTALL_MANIFEST_WHITESPACE_QUOTING_MODE) which may support values such as 0 (never quote), 1 (quote intelligently, only for files with embedded whitespace), 2 (always quote). And perhaps one should switch to having quoting activated by _default_ (although I'm sure some UNIX users will violently disagree :). And perhaps this new handling needs to be governed by a new CMake policy. Observed on CMake 2.6.4 (sorry), but from grepping git tree it doesn't seem like there's improved handling in this area. Thanks! Steps to Reproduce: - have a project with files containing spaces - have install() statements for such files - create RPM .spec template - add line %files -f @SPEC_INSTALL_MANIFEST_template@ - set(SPEC_INSTALL_MANIFEST_template ${CMAKE_BINARY_DIR}/install_manifest.txt) - observe rpmbuild failure on cpack -G RPM == Issue History Date ModifiedUsername FieldChange == 2011-09-06 04:28 Andreas Mohr New Issue == ___ cmake-developers mailing list cmake-developers@cmake.org http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
[CMake] 32-bit MinGW and Qt on 64-bit Windows
Hi everyone, I recently installed the 64-bit version of Windows 7 on a computer which had previously been running 32-bit Vista (so, everything got wiped). I develop with Qt so I installed the standard Qt SDK (version 1.1.3 that was released last week; Qt libs version 4.7.4) and downloaded and installed the CMake installer (which is 32-bit). I discovered that I could not get CMake to run; it fails when checking for a working C compiler: -- The C compiler identification is GNU -- The CXX compiler identification is GNU -- Check for working C compiler: C:/QtSDK/mingw/bin/gcc.exe -- Check for working C compiler: C:/QtSDK/mingw/bin/gcc.exe -- broken CMake Error at C:/Program Files x86/CMake 2.8/share/cmake-2.8/Modules/CMakeTestC Compiler.cmake:52 (MESSAGE): The C compiler C:/QtSDK/mingw/bin/gcc.exe is not able to compile a simple test program. It fails with the following output: Change Dir: C:/Users/Yusuf Smith/hg/qtm-1.4/CMakeFiles/CMakeTmp Run Build Command:C:/QtSDK/mingw/bin/mingw32-make.exe cmTryCompileExec/fast C:/QtSDK/mingw/bin/mingw32-make.exe -f CMakeFiles\cmTryCompileExec.dir\build.make CMakeFiles/cmTryCompileExec.dir/build C:/QtSDK/mingw/bin/mingw32-make.exe: Interrupt/Exception caught (code = 0xc005, addr = 0x41f96e) CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:1 (project) -- Configuring incomplete, errors occurred! I found an earlier answer that having a directory containing parentheses in the search path may cause failure, and I had altered the path to include Vim and CMake which are both in c:\Program Files (x86), so I reinstalled these in another directory, c:\Program Files x86 and changed my path accordingly. I still have this failure, however. Also, spaces in directory names have been suggested as a problem, but my home directory had the same name under Vista and my program built fine then. This has all happened since the upgrade. Does anyone know what the problem is? I cannot be the only one having this problem with the standard Qt SDK. Apart from CMake, my whole stack is from the Qt SDK. Regards, Matt Smith -- http://qtm.blogistan.co.uk/ ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check 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] question about Eclipse CDT Generators
Hi cmake list, I'm using cmake to manage a CUDA project, and I'm generating an eclipse project for development. Since CDT doesn't natively understand the output from the nvidia compiler, I've created a new regex error parser (I'm using eclipse 3.7 but I heard 3.6 has this ability as well), however, in the project generated by cmake, I cannot add this error parser. It does not appear in the list of check boxes. I'm trying to figure out why. I've tried creating a new C/C++ makefile project, and my custom error parser does appear in there. I compared the .project and .cproject files from both the cmake generated project and the dummy makefile project from the CDT new project wizard. They look very different. In addition, when I look at the project properties dialog for the cmake generated project, the options available are different then one from an eclipse wizard generated project. They are: C/C++ General C/C++ Include Paths and Symbols C/C++ Make Project C/C++ Project Paths Whereas, when using the new project wizard from CDT I get C/C++ Build C/C++ General In the cmake generated project, error parsers are listed under C/C++ Make Project. In the eclipse generated project, error parsers are listed under C/C++ Build-settings. Does anyone understand why the cmake generated project is different from the eclipse generated project? Is it because cmake is generating project files for an older version of CDT? Is there a way to make it the same and use my custom parser? ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check 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] Bug #12189
Thanks for your work on this Aaron. It looks almost good enough to merge as is -- so close! Just two more things: I want to make sure the test is conditional on MSVC (unless your intent is to make this work everywhere?) and tweak the test slightly: I think it should also verify that _SBCS is defined in addition to checking _UNICODE and _MBCS. Unfortunately, I'm running out of time to apply patches, make sure they work on all platforms, and then get the merged in for the upcoming 2.8.6 release. I'll try to get to this one soon after the 2.8.6 release so that it will be included in the next release. Thanks, David On Thu, Sep 1, 2011 at 11:29 AM, aaron.mead...@thomsonreuters.com wrote: Hi David, I've updated the bug with a patch which adds a test to check that defining _SBCS does set CharacterSet to 0 (Single Byte Character Set). I checked that it works when _SBCS is set and fails when _SBCS is not defined. I looked for where the _UNICODE option is documented, thinking to document _SBCS there, but was unable to find it in the documentation. If you want to point me to the right location to add documentation, I'm happy to write some. (I can write some for _UNICODE as well, if you like.) Aaron Meadows -Original Message- From: David Cole [mailto:david.c...@kitware.com] Sent: Wednesday, August 31, 2011 1:04 PM To: Meadows, Aaron C. Cc: cmake@cmake.org Subject: Re: [CMake] Bug #12189 The CMake/Tests/CMakeLists.txt file lists most of the tests that execute on our dashboards. The directories under CMake/Tests are all the existing test source trees. If you want to modify one of the existing tests to have an _SBCS target compile definition, I'd start by looking at Simple or COnly as a simple basis for a new test. Or you may find another one where the code that's compiled and tested is compatible with _SBCS. You may want to conditionalize it with code like: if (CMAKE_GENERATOR MATCHES Visual Studio) or if (MSVC) since your changes only apply to the Visual Studio generators. It should work with cl and nmake too, though, to have an _SBCS definition. Other compilers may or may not like a -D_SBCS. Let me know if you need further guidance. Thanks, David On Wed, Aug 31, 2011 at 1:33 PM, aaron.mead...@thomsonreuters.com wrote: I'm happy to assist in any way I can. Where do I need to add a test? Also, where would it be appropriate to document this? Aaron Meadows -Original Message- From: David Cole [mailto:david.c...@kitware.com] Sent: Wednesday, August 31, 2011 11:02 AM To: Meadows, Aaron C. Cc: cmake@cmake.org Subject: Re: [CMake] Bug #12189 Your patch has the wrong sense I think It looks like it's removing _SBCS code, but you want to add all that code, correct? I think (as long as my above assumption is correct) that this patch should be ok, even in a backwards compatibility sense, because only people who have _SBCS defined as a target property compile definition will have code generated differently than before. And I suspect your the only person in the world at this point for whom this is true. :-) Of course, to accept it into CMake, it would be nice to have it documented somewhere, and to have a test that exercises the newly added code. Especially now that we've entered the release candidate phase of 2.8.6. Any chance you can add a test (or modify an existing one) to add the _SBCS compile definition as a target property? On Wed, Aug 31, 2011 at 11:38 AM, aaron.mead...@thomsonreuters.com wrote: Any of you CMakers want to comment on this bug and patch? I'd like to be able to switch my company back to the public version of CMake instead of compiling my own flavor every time there is a release... Aaron Meadows From: Meadows, Aaron C. Sent: Thursday, June 23, 2011 2:23 PM To: Meadows, Aaron C.; 'cmake@cmake.org' Subject: RE: [CMake] Bug #12189 I've updated the bug with an additional patch (had a bug for some configuration cases). What is the procedure to get this patch considered and applied? Do I need to contact the Visual Studio Generator maintainer directly? Aaron C. Meadows From: Meadows, Aaron C. Sent: Tuesday, June 21, 2011 9:49 AM To: Meadows, Aaron C.; cmake@cmake.org Subject: RE: [CMake] Bug #12189 I updated the bug with this patch and some of the details from below. Aaron C. Meadows From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf Of Meadows, Aaron C. Sent: Monday, June 20, 2011 5:17 PM To: cmake@cmake.org Subject: [CMake] Bug #12189 (link: http://public.kitware.com/Bug/view.php?id=12189) I just came across the above bug opened last month, Summaraized as: It is not possible to generate a Visual Studio project with ASCII/SBCS character set. (Full Bug Text Following Message) I find myself in the situation where I need this to be set to not set, so as to have ASCII/SBCS as the character
Re: [CMake] Bug #12189
Sounds good. I believe the test is already in an msvc block. The other is easily added. I'll get on it tomorrow. Any thoughts on where to document it? Sent from my iPhone On Sep 6, 2011, at 3:15 PM, David Cole david.c...@kitware.com wrote: Thanks for your work on this Aaron. It looks almost good enough to merge as is -- so close! Just two more things: I want to make sure the test is conditional on MSVC (unless your intent is to make this work everywhere?) and tweak the test slightly: I think it should also verify that _SBCS is defined in addition to checking _UNICODE and _MBCS. Unfortunately, I'm running out of time to apply patches, make sure they work on all platforms, and then get the merged in for the upcoming 2.8.6 release. I'll try to get to this one soon after the 2.8.6 release so that it will be included in the next release. Thanks, David On Thu, Sep 1, 2011 at 11:29 AM, aaron.mead...@thomsonreuters.com wrote: Hi David, I've updated the bug with a patch which adds a test to check that defining _SBCS does set CharacterSet to 0 (Single Byte Character Set). I checked that it works when _SBCS is set and fails when _SBCS is not defined. I looked for where the _UNICODE option is documented, thinking to document _SBCS there, but was unable to find it in the documentation. If you want to point me to the right location to add documentation, I'm happy to write some. (I can write some for _UNICODE as well, if you like.) Aaron Meadows -Original Message- From: David Cole [mailto:david.c...@kitware.com] Sent: Wednesday, August 31, 2011 1:04 PM To: Meadows, Aaron C. Cc: cmake@cmake.org Subject: Re: [CMake] Bug #12189 The CMake/Tests/CMakeLists.txt file lists most of the tests that execute on our dashboards. The directories under CMake/Tests are all the existing test source trees. If you want to modify one of the existing tests to have an _SBCS target compile definition, I'd start by looking at Simple or COnly as a simple basis for a new test. Or you may find another one where the code that's compiled and tested is compatible with _SBCS. You may want to conditionalize it with code like: if (CMAKE_GENERATOR MATCHES Visual Studio) or if (MSVC) since your changes only apply to the Visual Studio generators. It should work with cl and nmake too, though, to have an _SBCS definition. Other compilers may or may not like a -D_SBCS. Let me know if you need further guidance. Thanks, David On Wed, Aug 31, 2011 at 1:33 PM, aaron.mead...@thomsonreuters.com wrote: I'm happy to assist in any way I can. Where do I need to add a test? Also, where would it be appropriate to document this? Aaron Meadows -Original Message- From: David Cole [mailto:david.c...@kitware.com] Sent: Wednesday, August 31, 2011 11:02 AM To: Meadows, Aaron C. Cc: cmake@cmake.org Subject: Re: [CMake] Bug #12189 Your patch has the wrong sense I think It looks like it's removing _SBCS code, but you want to add all that code, correct? I think (as long as my above assumption is correct) that this patch should be ok, even in a backwards compatibility sense, because only people who have _SBCS defined as a target property compile definition will have code generated differently than before. And I suspect your the only person in the world at this point for whom this is true. :-) Of course, to accept it into CMake, it would be nice to have it documented somewhere, and to have a test that exercises the newly added code. Especially now that we've entered the release candidate phase of 2.8.6. Any chance you can add a test (or modify an existing one) to add the _SBCS compile definition as a target property? On Wed, Aug 31, 2011 at 11:38 AM, aaron.mead...@thomsonreuters.com wrote: Any of you CMakers want to comment on this bug and patch? I'd like to be able to switch my company back to the public version of CMake instead of compiling my own flavor every time there is a release... Aaron Meadows From: Meadows, Aaron C. Sent: Thursday, June 23, 2011 2:23 PM To: Meadows, Aaron C.; 'cmake@cmake.org' Subject: RE: [CMake] Bug #12189 I've updated the bug with an additional patch (had a bug for some configuration cases). What is the procedure to get this patch considered and applied? Do I need to contact the Visual Studio Generator maintainer directly? Aaron C. Meadows From: Meadows, Aaron C. Sent: Tuesday, June 21, 2011 9:49 AM To: Meadows, Aaron C.; cmake@cmake.org Subject: RE: [CMake] Bug #12189 I updated the bug with this patch and some of the details from below. Aaron C. Meadows From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf Of Meadows, Aaron C. Sent: Monday, June 20, 2011 5:17 PM To: cmake@cmake.org Subject: [CMake] Bug #12189 (link:
Re: [CMake] Bug #12189
I don't have a good recommendation for where to document it at the moment. I would say where UNICODE is documented, but it's not... So, I will not refuse your patch for lack of documentation. :-) Testing is more important anyhow. If I think of / find the right place to actually document this, I'll add it as I'm applying the patch. (If anybody else listening here has a great idea about where to document the meaning of _SBCS, _MBCS and/or _UNICODE definitions, please chime in...) I'm leaning towards documenting them with the COMPILE_DEFINITIONS property, but there's nothing like that presently there... Thanks, David On Tue, Sep 6, 2011 at 4:17 PM, Meadows, Aaron C. aaron.mead...@thomsonreuters.com wrote: Sounds good. I believe the test is already in an msvc block. The other is easily added. I'll get on it tomorrow. Any thoughts on where to document it? Sent from my iPhone On Sep 6, 2011, at 3:15 PM, David Cole david.c...@kitware.com wrote: Thanks for your work on this Aaron. It looks almost good enough to merge as is -- so close! Just two more things: I want to make sure the test is conditional on MSVC (unless your intent is to make this work everywhere?) and tweak the test slightly: I think it should also verify that _SBCS is defined in addition to checking _UNICODE and _MBCS. Unfortunately, I'm running out of time to apply patches, make sure they work on all platforms, and then get the merged in for the upcoming 2.8.6 release. I'll try to get to this one soon after the 2.8.6 release so that it will be included in the next release. Thanks, David On Thu, Sep 1, 2011 at 11:29 AM, aaron.mead...@thomsonreuters.com wrote: Hi David, I've updated the bug with a patch which adds a test to check that defining _SBCS does set CharacterSet to 0 (Single Byte Character Set). I checked that it works when _SBCS is set and fails when _SBCS is not defined. I looked for where the _UNICODE option is documented, thinking to document _SBCS there, but was unable to find it in the documentation. If you want to point me to the right location to add documentation, I'm happy to write some. (I can write some for _UNICODE as well, if you like.) Aaron Meadows -Original Message- From: David Cole [mailto:david.c...@kitware.com] Sent: Wednesday, August 31, 2011 1:04 PM To: Meadows, Aaron C. Cc: cmake@cmake.org Subject: Re: [CMake] Bug #12189 The CMake/Tests/CMakeLists.txt file lists most of the tests that execute on our dashboards. The directories under CMake/Tests are all the existing test source trees. If you want to modify one of the existing tests to have an _SBCS target compile definition, I'd start by looking at Simple or COnly as a simple basis for a new test. Or you may find another one where the code that's compiled and tested is compatible with _SBCS. You may want to conditionalize it with code like: if (CMAKE_GENERATOR MATCHES Visual Studio) or if (MSVC) since your changes only apply to the Visual Studio generators. It should work with cl and nmake too, though, to have an _SBCS definition. Other compilers may or may not like a -D_SBCS. Let me know if you need further guidance. Thanks, David On Wed, Aug 31, 2011 at 1:33 PM, aaron.mead...@thomsonreuters.com wrote: I'm happy to assist in any way I can. Where do I need to add a test? Also, where would it be appropriate to document this? Aaron Meadows -Original Message- From: David Cole [mailto:david.c...@kitware.com] Sent: Wednesday, August 31, 2011 11:02 AM To: Meadows, Aaron C. Cc: cmake@cmake.org Subject: Re: [CMake] Bug #12189 Your patch has the wrong sense I think It looks like it's removing _SBCS code, but you want to add all that code, correct? I think (as long as my above assumption is correct) that this patch should be ok, even in a backwards compatibility sense, because only people who have _SBCS defined as a target property compile definition will have code generated differently than before. And I suspect your the only person in the world at this point for whom this is true. :-) Of course, to accept it into CMake, it would be nice to have it documented somewhere, and to have a test that exercises the newly added code. Especially now that we've entered the release candidate phase of 2.8.6. Any chance you can add a test (or modify an existing one) to add the _SBCS compile definition as a target property? On Wed, Aug 31, 2011 at 11:38 AM, aaron.mead...@thomsonreuters.com wrote: Any of you CMakers want to comment on this bug and patch? I'd like to be able to switch my company back to the public version of CMake instead of compiling my own flavor every time there is a release... Aaron Meadows From: Meadows, Aaron C. Sent: Thursday, June 23, 2011 2:23 PM To: Meadows, Aaron C.; 'cmake@cmake.org' Subject: RE: [CMake] Bug #12189 I've updated the bug with an additional patch (had a bug
Re: [CMake] how to inherit includes from other directories
Raymond, I appreciate your detailed reply. But apparently include_directories do not propagate UP, only down into subdirectories. The project has many such subdirectories each with its own headers. I think my example was therefore misleading and too simple :( There may 3 or 4 levels. At the top level, I would very much like to avoid needing to know all the dependencies at all the lower levels and exhaustively listing each one in an 'include_directories()' command. If utils/B.h needs utils/A.h which needs foo/Z.h, then in my top-level directory (that only needs to know about B.h) what does its CMakeLists.txt look like? I would like to just be add_includes(utils/B) and have cmake figure out it also needs utils/A and foo. I have somewhat succeeded by using a global variable called my_includes and using PARENT_SCOPE in all the low-level cmakelist files. But then I basically end up including all of the subdirectories all of the time. -Victor On Sun, Sep 4, 2011 at 8:15 AM, Raymond Wan r@aist.go.jp wrote: Hi Victor, On Sat, Sep 3, 2011 at 02:27, Victor Yankee victor.whiskey.yan...@gmail.com wrote: build/ src/ utils a A.h unittest_a.cpp b B.h // needs a.h unittest_b.cpp common c C.h // needs A.h and B.h testit.cpp // needs C.h, B.h and A.h The directory src/utils/a has a header file A.h. Likewise src/utils/b has a header file B.h that #includes a.h. Finally, c has a header file C.h that #includes a.h and b.h. This is just a short example of my large project. In reality there are other directories and levels of subdirectories. What can I do in the local CMakeLists.txt files so that the directories where the header files live are automatically made part of the others as needed, so I do not have to keep remembering all of them for every header-only library all the way down the dependency chain? I'm not much of a CMake expert, but it sounds like something I've done and I think the INCLUDE_DIRECTORIES command is all you need: http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:include_directories So in each of: src/utils/a src/utils/b src/common/c src/ you would have a CMakeLists.txt . The first 3 performs the unit testing. And the top-level one in src/ is the one that builds your executable. In the CMakeLists.txt that refers to the header file in another directory, you would put INCLUDE_DIRECTORIES. You would then tie up their dependencies using ADD_DEPENDENCIES so that an executable is made once something else is made: http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:add_dependencies I *think* that is all you need. I've also used ADD_SUBDIRECTORY but I'm not too sure if you need it too in your situation. Hope this helps! Ray ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check 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 inherit includes from other directories
CMake does not track dependencies of header-only libraries. It only tracks actual library dependencies given by target_link_libraries commands. You will have to come up with your own way to manage your projects interconnections. CMake provides the include_directories command so that you can say where your header files are. If Z depends on A and B's header files then Z is going to have to have include_directories commands for A and B's include directories. Sorry there's no magic bullet here. Let us know if you have any further questions, David On Tue, Sep 6, 2011 at 4:39 PM, Victor Yankee victor.whiskey.yan...@gmail.com wrote: Raymond, I appreciate your detailed reply. But apparently include_directories do not propagate UP, only down into subdirectories. The project has many such subdirectories each with its own headers. I think my example was therefore misleading and too simple :( There may 3 or 4 levels. At the top level, I would very much like to avoid needing to know all the dependencies at all the lower levels and exhaustively listing each one in an 'include_directories()' command. If utils/B.h needs utils/A.h which needs foo/Z.h, then in my top-level directory (that only needs to know about B.h) what does its CMakeLists.txt look like? I would like to just be add_includes(utils/B) and have cmake figure out it also needs utils/A and foo. I have somewhat succeeded by using a global variable called my_includes and using PARENT_SCOPE in all the low-level cmakelist files. But then I basically end up including all of the subdirectories all of the time. -Victor On Sun, Sep 4, 2011 at 8:15 AM, Raymond Wan r@aist.go.jp wrote: Hi Victor, On Sat, Sep 3, 2011 at 02:27, Victor Yankee victor.whiskey.yan...@gmail.com wrote: build/ src/ utils a A.h unittest_a.cpp b B.h // needs a.h unittest_b.cpp common c C.h // needs A.h and B.h testit.cpp // needs C.h, B.h and A.h The directory src/utils/a has a header file A.h. Likewise src/utils/b has a header file B.h that #includes a.h. Finally, c has a header file C.h that #includes a.h and b.h. This is just a short example of my large project. In reality there are other directories and levels of subdirectories. What can I do in the local CMakeLists.txt files so that the directories where the header files live are automatically made part of the others as needed, so I do not have to keep remembering all of them for every header-only library all the way down the dependency chain? I'm not much of a CMake expert, but it sounds like something I've done and I think the INCLUDE_DIRECTORIES command is all you need: http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:include_directories So in each of: src/utils/a src/utils/b src/common/c src/ you would have a CMakeLists.txt . The first 3 performs the unit testing. And the top-level one in src/ is the one that builds your executable. In the CMakeLists.txt that refers to the header file in another directory, you would put INCLUDE_DIRECTORIES. You would then tie up their dependencies using ADD_DEPENDENCIES so that an executable is made once something else is made: http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:add_dependencies I *think* that is all you need. I've also used ADD_SUBDIRECTORY but I'm not too sure if you need it too in your situation. Hope this helps! Ray ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] check directory existence in add_custom_command
Hi all, I'm developing on Mac using Xcode, and I need to create a directory in 'Debug': add_custom_command(TARGET target POST_BUILD ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/MyDir) How do I test the existence of 'MyDir' before creating it? Can I put 'if (exists MyDir)' before make_directory? Thanks Yifei ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] check directory existence in add_custom_command
On Tue, Sep 6, 2011 at 8:48 PM, Yifei Li yi...@mtu.edu wrote: Hi all, I'm developing on Mac using Xcode, and I need to create a directory in 'Debug': add_custom_command(TARGET target POST_BUILD ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/MyDir) How do I test the existence of 'MyDir' before creating it? Can I put 'if (exists MyDir)' before make_directory? Why do you need to check its existence first? Calling make_directory is a no-op if the directory already exists... Thanks Yifei ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check 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] check directory existence in add_custom_command
On Sep 6, 2011, at 9:29 PM, David Cole wrote: On Tue, Sep 6, 2011 at 8:48 PM, Yifei Li yi...@mtu.edu wrote: Hi all, I'm developing on Mac using Xcode, and I need to create a directory in 'Debug': add_custom_command(TARGET target POST_BUILD ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/MyDir) How do I test the existence of 'MyDir' before creating it? Can I put 'if (exists MyDir)' before make_directory? Why do you need to check its existence first? Calling make_directory is a no-op if the directory already exists… Thanks! I did not know that Thanks Yifei ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check 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 to inherit includes from other directories
Hi Victor, On Wed, Sep 7, 2011 at 05:39, Victor Yankee victor.whiskey.yan...@gmail.com wrote: There may 3 or 4 levels. At the top level, I would very much like to avoid needing to know all the dependencies at all the lower levels and exhaustively listing each one in an 'include_directories()' command. If utils/B.h needs utils/A.h which needs foo/Z.h, then in my top-level directory (that only needs to know about B.h) what does its CMakeLists.txt look like? I would like to just be add_includes(utils/B) and have cmake figure out it also needs utils/A and foo. I see what you mean now. David's reply says it better than I ever could... The only thing I can add is that I have the same problem as you. :-) Many include_directories (), even for those that are more than one degree of separation away... I've since given up and just have a long list of include_directories ()... Ray ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check 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 inherit includes from other directories
Hi, On Tue, Sep 06, 2011 at 04:50:30PM -0400, cmake-requ...@cmake.org wrote: Date: Tue, 6 Sep 2011 16:50:28 -0400 From: David Cole david.c...@kitware.com CMake does not track dependencies of header-only libraries. It only tracks actual library dependencies given by target_link_libraries commands. You will have to come up with your own way to manage your projects interconnections. CMake provides the include_directories command so that you can say where your header files are. If Z depends on A and B's header files then Z is going to have to have include_directories commands for A and B's include directories. Sorry there's no magic bullet here. Hmm, but surely the Config file mechanism (as used e.g. within a common build tree) may be a useful/more suitable way to do it rather than doing a manual open-coded include_directories()? Just to mention, AFAIR it's done like that: - libxxx/CMakeLists.txt defines (header location, build defines, ...) variables - that file then does a configure_file() on a libxxxConfig.cmake.in which thus encodes these settings - other projects within the build tree then include(libxxxConfig.cmake) (more or less specifically or implicitly pathed) (or alternatively include a Use file which _both_ includes Config file _and_ then activates these include paths for the local project) Or, more specifically, Z would somehow make sure to evaluate AConfig.cmake and BConfig.cmake. Andreas Mohr ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check 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.5-1823-g9b39de8
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 9b39de82bc97dbdcce7769cc04dd440c0226d0d7 (commit) via 339a321e66e142edbb0c6228caf368f09b4a072f (commit) via 5b4528b1f45a2a7d1ef5effe9813b1a2d764ac60 (commit) from 07b267b63af01be1a12fd12cc7b5493cf2893da8 (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=9b39de82bc97dbdcce7769cc04dd440c0226d0d7 commit 9b39de82bc97dbdcce7769cc04dd440c0226d0d7 Merge: 07b267b 339a321 Author: David Cole david.c...@kitware.com AuthorDate: Tue Sep 6 12:08:16 2011 -0400 Commit: CMake Topic Stage kwro...@kitware.com CommitDate: Tue Sep 6 12:08:16 2011 -0400 Merge topic 'fix-ctesttestcrash-test' into next 339a321 Tests: Look for Illegal or SegFault in the output 5b4528b KWSys Nightly Date Stamp http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=339a321e66e142edbb0c6228caf368f09b4a072f commit 339a321e66e142edbb0c6228caf368f09b4a072f Author: David Cole david.c...@kitware.com AuthorDate: Tue Sep 6 12:06:36 2011 -0400 Commit: David Cole david.c...@kitware.com CommitDate: Tue Sep 6 12:06:36 2011 -0400 Tests: Look for Illegal or SegFault in the output One of the dashmacmini5 runs of this test results in an Illegal exception detected instead of a segfault. For the purposes of this test, we're going to say that either is a crash. diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 9f4e8a3..7f83a47 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1586,7 +1586,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ PASS_REGULAR_EXPRESSION Failed) ELSE(CMAKE_TEST_GENERATOR MATCHES Watcom WMake) SET_TESTS_PROPERTIES(CTestTestCrash PROPERTIES - PASS_REGULAR_EXPRESSION SegFault) + PASS_REGULAR_EXPRESSION (Illegal|SegFault)) ENDIF(CMAKE_TEST_GENERATOR MATCHES Watcom WMake) CONFIGURE_FILE( --- Summary of changes: Source/kwsys/kwsysDateStamp.cmake |2 +- Tests/CMakeLists.txt |2 +- 2 files changed, 2 insertions(+), 2 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, master, updated. v2.8.5-390-g98cb017
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, master has been updated via 98cb017a9deca35cd9a67e03b6bd95064b6d2fb7 (commit) from 5b4528b1f45a2a7d1ef5effe9813b1a2d764ac60 (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=98cb017a9deca35cd9a67e03b6bd95064b6d2fb7 commit 98cb017a9deca35cd9a67e03b6bd95064b6d2fb7 Author: David Cole david.c...@kitware.com AuthorDate: Tue Sep 6 13:07:52 2011 -0400 Commit: David Cole david.c...@kitware.com CommitDate: Tue Sep 6 13:10:05 2011 -0400 KWSys: Remove always-true dir_only parameter Its presence confuses, and, since it is always true, is useless. diff --git a/Source/kwsys/Glob.cxx b/Source/kwsys/Glob.cxx index c1f5100..b33b926 100644 --- a/Source/kwsys/Glob.cxx +++ b/Source/kwsys/Glob.cxx @@ -215,7 +215,7 @@ kwsys_stl::string Glob::PatternToRegex(const kwsys_stl::string pattern, // void Glob::RecurseDirectory(kwsys_stl::string::size_type start, - const kwsys_stl::string dir, bool dir_only) + const kwsys_stl::string dir) { kwsys::Directory d; if ( !d.Load(dir.c_str()) ) @@ -258,7 +258,9 @@ void Glob::RecurseDirectory(kwsys_stl::string::size_type start, fullname = dir + / + fname; } -if ( !dir_only || !kwsys::SystemTools::FileIsDirectory(realname.c_str()) ) +bool isDir = kwsys::SystemTools::FileIsDirectory(realname.c_str()); + +if ( !isDir ) { if ( (this-Internals-Expressions.size() 0) this-Internals-Expressions[ @@ -267,7 +269,7 @@ void Glob::RecurseDirectory(kwsys_stl::string::size_type start, this-AddFile(this-Internals-Files, realname.c_str()); } } -if ( kwsys::SystemTools::FileIsDirectory(realname.c_str()) ) +else { bool isSymLink = kwsys::SystemTools::FileIsSymlink(realname.c_str()); if (!isSymLink || this-RecurseThroughSymlinks) @@ -276,7 +278,7 @@ void Glob::RecurseDirectory(kwsys_stl::string::size_type start, { ++this-FollowedSymlinkCount; } -this-RecurseDirectory(start+1, realname, dir_only); +this-RecurseDirectory(start+1, realname); } } } @@ -284,13 +286,13 @@ void Glob::RecurseDirectory(kwsys_stl::string::size_type start, // void Glob::ProcessDirectory(kwsys_stl::string::size_type start, - const kwsys_stl::string dir, bool dir_only) + const kwsys_stl::string dir) { //kwsys_ios::cout ProcessDirectory: dir kwsys_ios::endl; bool last = ( start == this-Internals-Expressions.size()-1 ); if ( last this-Recurse ) { -this-RecurseDirectory(start, dir, dir_only); +this-RecurseDirectory(start, dir); return; } @@ -345,7 +347,7 @@ void Glob::ProcessDirectory(kwsys_stl::string::size_type start, // this-Internals-TextExpressions[start].c_str() kwsys_ios::endl; //kwsys_ios::cout Full name: fullname kwsys_ios::endl; -if ( (!dir_only || !last) +if ( !last !kwsys::SystemTools::FileIsDirectory(realname.c_str()) ) { continue; @@ -359,7 +361,7 @@ void Glob::ProcessDirectory(kwsys_stl::string::size_type start, } else { -this-ProcessDirectory(start+1, realname + /, dir_only); +this-ProcessDirectory(start+1, realname + /); } } } @@ -462,12 +464,11 @@ bool Glob::FindFiles(const kwsys_stl::string inexpr) // Handle network paths if ( skip 0 ) { -this-ProcessDirectory(0, fexpr.substr(0, skip) + /, - true); +this-ProcessDirectory(0, fexpr.substr(0, skip) + /); } else { -this-ProcessDirectory(0, /, true); +this-ProcessDirectory(0, /); } return true; } diff --git a/Source/kwsys/Glob.hxx.in b/Source/kwsys/Glob.hxx.in index cb050ee..88c343c 100644 --- a/Source/kwsys/Glob.hxx.in +++ b/Source/kwsys/Glob.hxx.in @@ -83,12 +83,12 @@ public: protected: //! Process directory void ProcessDirectory(kwsys_stl::string::size_type start, -const kwsys_stl::string dir, bool dir_only); +const kwsys_stl::string dir); //! Process last directory, but only when recurse flags is on. That is // effectively like saying: /path/to/file/**/file void RecurseDirectory(kwsys_stl::string::size_type start, -const kwsys_stl::string dir, bool dir_only); +const kwsys_stl::string dir); //! Add regular expression void AddExpression(const char* expr); --- Summary of
[Cmake-commits] CMake branch, master, updated. v2.8.5-391-g527a40f
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, master has been updated via 527a40f06fc7f0ea6aa9c1fe96fb0fe5611fa633 (commit) from 98cb017a9deca35cd9a67e03b6bd95064b6d2fb7 (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=527a40f06fc7f0ea6aa9c1fe96fb0fe5611fa633 commit 527a40f06fc7f0ea6aa9c1fe96fb0fe5611fa633 Author: David Cole david.c...@kitware.com AuthorDate: Tue Sep 6 13:12:03 2011 -0400 Commit: David Cole david.c...@kitware.com CommitDate: Tue Sep 6 13:20:02 2011 -0400 KWSys: Add symlinks to directories as files (#12284) This behaviour was previously broken; regardless of the RecurseThroughSymLinks value, symlinks to directories were NEVER added as files in the results. When RecurseThroughSymLinks is ON, symlinks to directories should be recursed as if they were the actual directories to gather the files within. However, when RecurseThroughSymLinks is OFF, symlinks to directories should be returned as files in the result. Inspired-by: Johan Björk p...@spotify.com diff --git a/Source/kwsys/Glob.cxx b/Source/kwsys/Glob.cxx index b33b926..513eb64 100644 --- a/Source/kwsys/Glob.cxx +++ b/Source/kwsys/Glob.cxx @@ -259,26 +259,23 @@ void Glob::RecurseDirectory(kwsys_stl::string::size_type start, } bool isDir = kwsys::SystemTools::FileIsDirectory(realname.c_str()); +bool isSymLink = kwsys::SystemTools::FileIsSymlink(realname.c_str()); -if ( !isDir ) +if ( isDir (!isSymLink || this-RecurseThroughSymlinks) ) { - if ( (this-Internals-Expressions.size() 0) - this-Internals-Expressions[ - this-Internals-Expressions.size()-1].find(fname.c_str()) ) + if (isSymLink) { -this-AddFile(this-Internals-Files, realname.c_str()); +++this-FollowedSymlinkCount; } + this-RecurseDirectory(start+1, realname); } else { - bool isSymLink = kwsys::SystemTools::FileIsSymlink(realname.c_str()); - if (!isSymLink || this-RecurseThroughSymlinks) + if ( (this-Internals-Expressions.size() 0) + this-Internals-Expressions[ + this-Internals-Expressions.size()-1].find(fname.c_str()) ) { -if (isSymLink) - { - ++this-FollowedSymlinkCount; - } -this-RecurseDirectory(start+1, realname); +this-AddFile(this-Internals-Files, realname.c_str()); } } } --- Summary of changes: Source/kwsys/Glob.cxx | 21 + 1 files changed, 9 insertions(+), 12 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.5-1827-gf52a566
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 f52a566b9dc3394fd9ec2e22855658aa98c8fb6a (commit) via 527a40f06fc7f0ea6aa9c1fe96fb0fe5611fa633 (commit) from 96a5b6d18f482289e3ed9e7d0cbd8efe16f6018f (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=f52a566b9dc3394fd9ec2e22855658aa98c8fb6a commit f52a566b9dc3394fd9ec2e22855658aa98c8fb6a Merge: 96a5b6d 527a40f Author: David Cole david.c...@kitware.com AuthorDate: Tue Sep 6 13:20:22 2011 -0400 Commit: David Cole david.c...@kitware.com CommitDate: Tue Sep 6 13:20:22 2011 -0400 Merge branch 'master' into next --- Summary of changes: Source/kwsys/Glob.cxx | 21 + 1 files changed, 9 insertions(+), 12 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.5-1830-g59c05d0
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 59c05d03a49fef910d60870014a69803ae6bb84e (commit) via 7b8dcdd17312a7c3ed731743468136b0ea89a6c7 (commit) via d78bdb27832c91c775ad3782c9eb436dcd6a1e7c (commit) from f52a566b9dc3394fd9ec2e22855658aa98c8fb6a (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=59c05d03a49fef910d60870014a69803ae6bb84e commit 59c05d03a49fef910d60870014a69803ae6bb84e Merge: f52a566 7b8dcdd Author: David Cole david.c...@kitware.com AuthorDate: Tue Sep 6 14:22:31 2011 -0400 Commit: CMake Topic Stage kwro...@kitware.com CommitDate: Tue Sep 6 14:22:31 2011 -0400 Merge topic 'fix-12284-cpack-symlinks' into next 7b8dcdd CPack: Do not recurse through directory symlinks (#12284) d78bdb2 CMake: Write symlinks to directories as files in archives (#12284) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7b8dcdd17312a7c3ed731743468136b0ea89a6c7 commit 7b8dcdd17312a7c3ed731743468136b0ea89a6c7 Author: Johan Björk p...@spotify.com AuthorDate: Sat Aug 27 19:34:37 2011 +0200 Commit: David Cole david.c...@kitware.com CommitDate: Tue Sep 6 14:04:37 2011 -0400 CPack: Do not recurse through directory symlinks (#12284) ...when building CPack archive-based packages (.tar.gz and similar) Rather, put the symlinks-to-directories into the archive as files, and expect/trust that the things the symlinks point to are also in the archive. diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index 0e4acd5..083279f 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -1000,6 +1000,7 @@ int cmCPackGenerator::DoPackage() std::string findExpr = tempDirectory; findExpr += /*; gl.RecurseOn(); + gl.SetRecurseThroughSymlinks(false); if ( !gl.FindFiles(findExpr) ) { cmCPackLogger(cmCPackLog::LOG_ERROR, http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d78bdb27832c91c775ad3782c9eb436dcd6a1e7c commit d78bdb27832c91c775ad3782c9eb436dcd6a1e7c Author: Johan Björk p...@spotify.com AuthorDate: Sat Aug 27 19:35:08 2011 +0200 Commit: David Cole david.c...@kitware.com CommitDate: Tue Sep 6 13:58:00 2011 -0400 CMake: Write symlinks to directories as files in archives (#12284) Do not recurse through directory symlinks when adding files. Recursing through directory symlinks will generate broken archives, i.e., they will look something like this: foo - bar/bar foo/Info - Shouldn't be in archive. bar/bar bar/bar/Info diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx index 25dc8ba..eab8a59 100644 --- a/Source/cmArchiveWrite.cxx +++ b/Source/cmArchiveWrite.cxx @@ -180,7 +180,8 @@ bool cmArchiveWrite::AddPath(const char* path, { return false; } - if(!cmSystemTools::FileIsDirectory(path)) + if(!cmSystemTools::FileIsDirectory(path) || +cmSystemTools::FileIsSymlink(path)) { return true; } --- Summary of changes: Source/CPack/cmCPackGenerator.cxx |1 + Source/cmArchiveWrite.cxx |3 ++- 2 files changed, 3 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.5-1832-gb39bee5
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 b39bee533db5e387d081d93668ef97595c2de497 (commit) via cb22afc02c0524ff2b701b33a29339dde1e80bbd (commit) from 59c05d03a49fef910d60870014a69803ae6bb84e (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=b39bee533db5e387d081d93668ef97595c2de497 commit b39bee533db5e387d081d93668ef97595c2de497 Merge: 59c05d0 cb22afc Author: David Cole david.c...@kitware.com AuthorDate: Tue Sep 6 15:18:28 2011 -0400 Commit: CMake Topic Stage kwro...@kitware.com CommitDate: Tue Sep 6 15:18:28 2011 -0400 Merge topic 'fix-12377-xcode-honor-g0' into next cb22afc Xcode: Honor -g0 to disable debugging (#12377) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cb22afc02c0524ff2b701b33a29339dde1e80bbd commit cb22afc02c0524ff2b701b33a29339dde1e80bbd Author: Johan Bjork p...@spotify.com AuthorDate: Thu Aug 18 19:30:51 2011 +0200 Commit: David Cole david.c...@kitware.com CommitDate: Tue Sep 6 15:04:58 2011 -0400 Xcode: Honor -g0 to disable debugging (#12377) This commit changes ExtractFlag to remove all occurences of a flag, and only save the last one. (i.e., the dominant one according to GCC rules) diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 02a95fe..a8a6eb4 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -1219,19 +1219,30 @@ void cmGlobalXCodeGenerator::CreateCustomCommands(cmXCodeObject* buildPhases, } // +// This function removes each occurence of the flag and returns the last one +// (i.e., the dominant flag in GCC) std::string cmGlobalXCodeGenerator::ExtractFlag(const char* flag, std::string flags) { std::string retFlag; - std::string::size_type pos = flags.find(flag); - if(pos != flags.npos (pos ==0 || flags[pos-1]==' ')) + std::string::size_type pos = flags.rfind(flag); + bool saved = false; + while(pos != flags.npos) { -while(pos flags.size() flags[pos] != ' ') +if(pos == 0 || flags[pos-1]==' ') { - retFlag += flags[pos]; - flags[pos] = ' '; - pos++; + while(pos flags.size() flags[pos] != ' ') +{ +if(!saved) + { + retFlag += flags[pos]; + } +flags[pos] = ' '; +pos++; +} } + saved = true; + pos = flags.rfind(flag); } return retFlag; } @@ -1870,7 +1881,17 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget target, flags += gflag; } const char* debugStr = YES; - if(gflagc.size() ==0 gflag.size() == 0) + // We can't set the Xcode flag differently depending on the language, + // so put them back in this case. + if( (lang strcmp(lang, CXX) == 0) gflag != gflagc ) +{ +cflags += ; +cflags += gflagc; +flags += ; +flags += gflag; +debugStr = NO; +} + if( gflag == -g0 || gflag.size() == 0 ) { debugStr = NO; } --- Summary of changes: Source/cmGlobalXCodeGenerator.cxx | 35 --- 1 files changed, 28 insertions(+), 7 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.5-1834-gab1d555
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 ab1d5554e97667b3332da594e032a66f896cc21a (commit) via 96d106a78d1dc634cc635678afa399f1f5e15ff3 (commit) from b39bee533db5e387d081d93668ef97595c2de497 (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=ab1d5554e97667b3332da594e032a66f896cc21a commit ab1d5554e97667b3332da594e032a66f896cc21a Merge: b39bee5 96d106a Author: David Cole david.c...@kitware.com AuthorDate: Tue Sep 6 17:45:28 2011 -0400 Commit: CMake Topic Stage kwro...@kitware.com CommitDate: Tue Sep 6 17:45:28 2011 -0400 Merge topic 'fix-12446-no-cmake-E-build' into next 96d106a CMake: Remove documentation for -E build (#12446) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=96d106a78d1dc634cc635678afa399f1f5e15ff3 commit 96d106a78d1dc634cc635678afa399f1f5e15ff3 Author: Matt McCormick matt.mccorm...@kitware.com AuthorDate: Tue Sep 6 08:28:20 2011 -0400 Commit: David Cole david.c...@kitware.com CommitDate: Tue Sep 6 17:42:32 2011 -0400 CMake: Remove documentation for -E build (#12446) The '-E build build_dir' command was created and documented, but then morphed into '--build build_dir' instead, ... and then the -E documentation was never removed. This commit fixes that oversight. diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 2b8c718..a7924a4 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1112,7 +1112,6 @@ void CMakeCommandUsage(const char* program) errorStream Usage: program -E [command] [arguments ...]\n Available commands: \n - build build_dir - build the project in build_dir.\n chdir dir cmd [args]... - run command in a given directory\n compare_files file1 file2 - check if file1 is same as file2\n copy file destination - copy file to destination (either file diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index 9f213a5..436236d 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -72,7 +72,7 @@ static const char * cmDocumentationOptions[][3] = {-E, CMake command mode., For true platform independence, CMake provides a list of commands that can be used on all systems. Run with -E help for the usage - information. Commands available are: build, chdir, compare_files, copy, + information. Commands available are: chdir, compare_files, copy, copy_directory, copy_if_different, echo, echo_append, environment, make_directory, md5sum, remove, remove_directory, rename, tar, time, touch, touch_nocreate. In addition, some platform specific commands --- Summary of changes: Source/cmake.cxx |1 - Source/cmakemain.cxx |2 +- 2 files changed, 1 insertions(+), 2 deletions(-) hooks/post-receive -- CMake ___ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits