MantisBT - CMake
View Issue Details
0015537CMakeCMakepublic2015-04-27 07:092016-06-10 14:31
Jamie Kirkpatrick 
Kitware Robot 
normalminoralways
closedmoved 
Windows
CMake 3.2.2 
 
0015537: CTestTargets.cmake interferes with source trees that use directory structures nested under a "testing" directory
If you have a project that uses a directory structure with a top-level directory called "testing" and some nested directories with CMakeLists.txt files in those directories you can get unexpected results. Namely that the first time you run cmake, targets defined in those directories will not be set up correctly.
Download the attached test-case: in the root directory of the project run the following command:

mkdir build && cd build && cmake -GNinja .. && ninja custom_target

Ninja will report that it has "nothing to do"
The problem seems to boil down to the presence of this line in CTestTargets.cmake

# make directories in the binary tree
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/Testing/Temporary)
No tags attached.
zip cmake-bug.zip (3,214) 2015-04-27 07:09
https://public.kitware.com/Bug/file/5440/cmake-bug.zip
Issue History
2015-04-27 07:09Jamie KirkpatrickNew Issue
2015-04-27 07:09Jamie KirkpatrickFile Added: cmake-bug.zip
2015-04-27 07:30Jamie KirkpatrickNote Added: 0038601
2015-04-27 09:01Ben BoeckelNote Added: 0038606
2015-04-27 09:37Jamie KirkpatrickNote Added: 0038610
2015-04-27 11:06Brad KingNote Added: 0038619
2015-04-27 11:10Brad KingNote Added: 0038620
2016-06-10 14:29Kitware RobotNote Added: 0042766
2016-06-10 14:29Kitware RobotStatusnew => resolved
2016-06-10 14:29Kitware RobotResolutionopen => moved
2016-06-10 14:29Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0038601)
Jamie Kirkpatrick   
2015-04-27 07:30   
I should also note that this only seems to be an issue on win32 - works fine on posix platforms AFAICT.
(0038606)
Ben Boeckel   
2015-04-27 09:01   
*nix will likely have problems with directories named 'Testing'. Maybe CTest should use _CTest_Testing similar to _CPack_Packages? Probably requires a policy though...
(0038610)
Jamie Kirkpatrick   
2015-04-27 09:37   
Additionally I should mention that this affects all generators.
(0038619)
Brad King   
2015-04-27 11:06   
CTest has always used <top>/Testing to store some things. This came from its early days as part of a project that used a Testing directory. It has never been known to interfere with project-specified "Testing" directories.

This looks like a problem with the case difference between the "testing" source directory and the "Testing" directory CTest creates.
(0038620)
Brad King   
2015-04-27 11:10   
Teaching CTest to use something other than <top>/Testing will be non-trivial. It is used in many places by the C++-side of the implementation. We would also have to deal with supporting older versions, etc.

Instead one could look at why the case mixing causes problems. I suspect it has something to do with GetActualCaseForPath.
(0042766)
Kitware Robot   
2016-06-10 14:29   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.