[CMake] install(DIRECTORY . DESTINATION include/proj FILES_MATCHINGPATTERN "*.h")

Mathieu Malaterre mathieu.malaterre at gmail.com
Wed Oct 28 11:28:51 EDT 2009


On Wed, Oct 28, 2009 at 4:14 PM, Steve Huston <shuston at riverace.com> wrote:
> Hi Mathieu,
>
>>   Quick question. What is the command to install a set of *.h files
> ?
>>
>> I tried:
>>
>> install(DIRECTORY . DESTINATION include/proj FILES_MATCHING
>> PATTERN "*.h")
>
> Right.
>
>> but it is installing the '.svn' subdir as part of the installation.
>
> Try adding:
>
>         PATTERN ".svn" EXCLUDE
>
> -Steve

indeed the proper solution that worked for me (cmake 2.6.4) was:

install(DIRECTORY . DESTINATION ${COSMO_INSTALL_INCLUDE_DIR}
FILES_MATCHING PATTERN "*.h"
   PATTERN ".svn" EXCLUDE
  )

I do not understand why I need to explicitely state

  PATTERN ".svn" EXCLUDE

(what if tomorrow I switch to CVS, git, or mercurial), so I reverted
to good ol' :

file(GLOB header_files "*.h" "*.txx")
install(FILES ${header_files}
  DESTINATION include/proj COMPONENT Headers
  )

Cheers
-- 
Mathieu


More information about the CMake mailing list