I have a source directory structure:
projectSource
|---src
|---include
|---CMakeLists.txt
and would like an install directory structure of
projectInstall
|---bin
|---include
|---lib
My source directory tree is all under version control, so each source folder contains an additional .svn/
directory. What's the easiest way to install all header files from projectSource/include
to projectInstall/include
, while skipping over the .svn
directories?
I'd like to use something like:
set( PROJECT_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/include )
include_directories( ${PROJECT_INCLUDE_DIR} )
install(DIRECTORY ${PROJECT_INCLUDE_DIR}/
DESTINATION "include"
FILES_MATCHING PATTERN "*.h"
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
but even though I'm (attempting to) install only files matching *.h
, I'm still picking up the .svn/
directory and contents.
You can add EXCLUDE
keyword to the PATTERN:
install(DIRECTORY ${PROJECT_INCLUDE_DIR}/
DESTINATION "include"
FILES_MATCHING
PATTERN "*.h"
PATTERN ".svn" EXCLUDE
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With