MantisBT - CMake | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0008164 | CMake | CMake | public | 2008-11-25 08:39 | 2016-06-10 14:30 |
Reporter | Hugo Heden | ||||
Assigned To | Bill Hoffman | ||||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | moved | ||
Platform | OS | OS Version | |||
Product Version | CMake-2-6 | ||||
Target Version | Fixed in Version | ||||
Summary | 0008164: additional_clean_files not respected if no target present in directory | ||||
Description | It seems that set_directory_properties( properties additional_clean_files ... ) is not respected if no target present in the directory -- that is 'make clean' will not remove the specified "additional clean file". | ||||
Steps To Reproduce | |||||
Additional Information | $ cmake --version cmake version 2.6-patch 2 A little test case to illustrate the issue follows. We have two CMakeLists.txt-files, one in the root directory and one in a sub directory. The former (src/CMakeLists.txt) is not really important, but included here for completeness. The latter, src/subdir/CMakeLists.txt, is where the bug appears. There is also a file that is being installed, src/subdir/hello.txt. Invoking 'make clean' will not clean that file unless there is an actual target specified in src/subdir/CMakeLists.txt. File tree:. |-- build |-- install `-- src |-- CMakeLists.txt `-- subdir |-- CMakeLists.txt `-- hello.txt -------------------------------- ------- src/CMakeLists.txt: CMAKE_MINIMUM_REQUIRED(VERSION 2.6) SET( CMAKE_INSTALL_PREFIX ${CMAKE_SOURCE_DIR}/../install ) ADD_SUBDIRECTORY( subdir ) ADD_CUSTOM_TARGET( some_target COMMAND ${CMAKE_COMMAND} -E echo HELLO ) -------------------------------- ------- src/subdir/CMakeLists.txt: #ADD_CUSTOM_TARGET( # some_subdir_target # COMMAND ${CMAKE_COMMAND} -E echo WHOHOO #) INSTALL( FILES hello.txt DESTINATION ./ ) SET_DIRECTORY_PROPERTIES( PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${CMAKE_INSTALL_PREFIX}/hello.txt ) --------------------------- --------------------------- As written above, with the target "some_subdir_target" commented out, the ADDITIONAL_MAKE_CLEAN_FILES will not be respected - - it seems to be sort of optimized away: $ cd build/ $ cmake ../src ... ... $ make install ... $ ls ../install hello.txt $ make clean $ ls ../install/ hello.txt # <--- OUCH -------------------------------- -------------------------------- However, if the target is not commented out it will all work nicely: -------------------------------- ------- src/subdir/CMakeLists.txt: ADD_CUSTOM_TARGET( some_subdir_target COMMAND ${CMAKE_COMMAND} -E echo WHOHOO ) INSTALL( FILES hello.txt DESTINATION ./ ) SET_DIRECTORY_PROPERTIES( PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${CMAKE_INSTALL_PREFIX}/hello.txt ) -------------------------------- -------------------------------- $ cd build/ $ cmake ../src ... ... $ make install ... $ ls ../install hello.txt $ make clean $ ls ../install/ # <no files> -- as expected | ||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | |||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2008-11-25 08:39 | Hugo Heden | New Issue | |||
2008-11-27 06:53 | Hugo Heden | Note Added: 0014211 | |||
2009-01-30 06:32 | Hugo Heden | Note Added: 0014733 | |||
2009-09-14 15:15 | Bill Hoffman | Status | new => assigned | ||
2009-09-14 15:15 | Bill Hoffman | Assigned To | => Bill Hoffman | ||
2016-06-10 14:27 | Kitware Robot | Note Added: 0041472 | |||
2016-06-10 14:27 | Kitware Robot | Status | assigned => resolved | ||
2016-06-10 14:27 | Kitware Robot | Resolution | open => moved | ||
2016-06-10 14:30 | Kitware Robot | Status | resolved => closed |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|