MantisBT - CMake
View Issue Details
0010366CMakeCMakepublic2010-03-04 04:242013-01-09 10:58
Jan M 
Brad King 
normalmajoralways
closedfixed 
CMake-2-8 
CMake 2.8.9CMake 2.8.9 
0010366: install(DIRECTORY ... ) FILES_MATCHING does not work on MacOS
Hi,

i use the following function call:

install(DIRECTORY .
        DESTINATION include/OpenMesh/Core
        FILES_MATCHING
        PATTERN "*.hh"
        PATTERN "CVS" EXCLUDE
        PATTERN ".svn" EXCLUDE)

On Windows and Linux this gets all files ending with .hh and installs them with their path.
On MacOS nothing gets installed. When i remove the FILES_MATCHING option all files get installed. Also if i change pattern to "*" all files get installed. I also tried it using REGEX with the same result.

Best Regards,
Jan
No tags attached.
duplicate of 0013177closed Brad King File matching patterns not functional when installing headers 
Issue History
2010-03-04 04:24Jan MNew Issue
2011-01-17 14:55David ColeAssigned To => David Cole
2011-01-17 14:55David ColeStatusnew => assigned
2011-01-17 14:56David ColeNote Added: 0024796
2011-02-18 19:09David AlexanderNote Added: 0025499
2011-03-02 10:38David AlexanderNote Added: 0025622
2011-03-06 21:27David AlexanderNote Added: 0025681
2011-03-07 13:22David ColeNote Added: 0025685
2011-03-08 19:56David AlexanderNote Added: 0025697
2011-07-26 04:36Fabien BenureauNote Added: 0027070
2012-08-13 15:36David ColeStatusassigned => backlog
2012-08-13 15:36David ColeNote Added: 0030617
2012-08-13 15:37David ColeAssigned ToDavid Cole =>
2012-08-13 15:40Brad KingRelationship addedduplicate of 0013177
2012-08-13 15:41Brad KingNote Added: 0030627
2012-08-13 15:41Brad KingAssigned To => Brad King
2012-08-13 15:41Brad KingStatusbacklog => resolved
2012-08-13 15:41Brad KingResolutionopen => fixed
2012-08-13 15:41Brad KingFixed in Version => CMake 2.8.9
2012-08-13 15:41Brad KingTarget Version => CMake 2.8.9
2013-01-09 10:58Robert MaynardNote Added: 0032058
2013-01-09 10:58Robert MaynardStatusresolved => closed

Notes
(0024796)
David Cole   
2011-01-17 14:56   
Is OpenMesh a framework on the Mac?

Please provide exact steps to reproduce the issue.
(0025499)
David Alexander   
2011-02-18 19:09   
I see this same thing. Here's a simple way to reproduce for me...

1) create new directory called regexproblem
2) cd to regexproblem
3) create CMakeList.txt with the following

   cmake_minimum_required(VERSION 2.8.3)
   project(HELLO)

   INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/testinclude
       DESTINATION ${CMAKE_INSTALL_PREFIX}
       FILES_MATCHING PATTERN "*.h"
   )
4) mkdir testinclude
5) touch testinclude/header1.h
6) touch testinclude/header2.h
7) mkdir testinstall
8) cmake -DCMake_INSTALL_PREFIX="./testinclude" .
9) make install

This fails to install the two mock headers unless the "FILES_MATCHING..." line is commented out. I am working on

$uname -a
Darwin qarmac.txcorp.com 10.6.0 Darwin Kernel Version 10.6.0: Wed Nov 10 18:13:17 PST 2010; root:xnu-1504.9.26~3/RELEASE_I386 i386
$ cmake --version
cmake version 2.8.4

But I get the same with 2.8.3 too. I did a trace with

$cmake --trace -P cmake_install.cmake

and I see that the line ...

FILE(INSTALL DESTINATION /Users/alexanda/projects/cmakeplay/testinstall TYPE DIRECTORY FILES /Users/alexanda/projects/cmakeplay/testinclude FILES_MATCHING REGEX /[^/]*\\.h$ )

Several colleagues with similar OS X 10.6 machines do not see this behavior, so it may be in a library or function that cmake is calling???
(0025622)
David Alexander   
2011-03-02 10:38   
Any chance a fix for this issue would make it into the 2.8.5 release in April?
(0025681)
David Alexander   
2011-03-06 21:27   
I have a case-sensitive file system. Could that be the issue?
(0025685)
David Cole   
2011-03-07 13:22   
A case-sensitive file system could certainly be a contributing factor here, but one would think that using ".h" in the file names, and then ".h" in the regex, too, would yield matches on case-sensitive and case-insensitive file systems...

This warrants investigation, at the very least, but case-sensitive file systems on Macs are not the default, are they? How did you get one? You made it that way yourself on purpose?
(0025697)
David Alexander   
2011-03-08 19:56   
Ok. I changed the format of my file system to the default (case-insensitive) type and the problem went away. So, this was the issue. Maybe cmake is writing a temp file and then checking it later with some loss of the case? Anyway, it is working for me know. Just to be clear, before when I saw the issue, I was using ".h" in the regex and had ".h" (both lower case) files that were missed in the match; so this remains indeed a bug, if one uses a case-sensitive file system on OS X 10.6.
(0027070)
Fabien Benureau   
2011-07-26 04:36   
I am confirming the bug on a case-sensitive system, on Mac OS X 10.6 and 10.7, and its absence when the system is not. It causes headers to be skipped by the installation. The peculiar thing is, exclude patterns work :
INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/testinclude
       DESTINATION ${CMAKE_INSTALL_PREFIX}
       FILES_MATCHING PATTERN "*"
       PATTERN "*.h" EXCLUDE
   )
will install everything except the .h files.
I think a warning should be at least displayed, if the bug is too hard to fix.
(0030617)
David Cole   
2012-08-13 15:36   
Sending old, not-recently-updated issues to the backlog.

(The age of the bug alone means that nobody is actively working on it...)

If an issue you care about is sent to the backlog when you feel it should have been addressed in a different manner, please bring it up on the CMake mailing list for discussion. Sign up for the mailing list here, if you're not already on it: http://www.cmake.org/mailman/listinfo/cmake [^]

It's easy to re-activate a bug here if you can find a CMake developer who has the bandwidth to take it on, and ferry a fix through to our 'next' branch for dashboard testing.
(0030627)
Brad King   
2012-08-13 15:41   
This was separately reported and resolved in issue 0013177. The fix:

 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a41557a2 [^]

was in 2.8.9.
(0032058)
Robert Maynard   
2013-01-09 10:58   
Closing resolved issues that have not been updated in more than 4 months.