# install( FILES ... ) installing all files in directory when single file is specified

**URL:** https://discourse.cmake.org/t/install-files-installing-all-files-in-directory-when-single-file-is-specified/1955
**Category:** Code
**Created:** [October 1, 2020, 8:14pm UTC](https://discourse.cmake.org/t/install-files-installing-all-files-in-directory-when-single-file-is-specified/1955 "2020-10-01T20:14:56Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Matthew\_Polder](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/m/3da27b/32.png) [@Matthew\_Polder](https://discourse.cmake.org/u/Matthew_Polder)
#### Post date: [October 1, 2020, 8:14pm UTC](https://discourse.cmake.org/t/install-files-installing-all-files-in-directory-when-single-file-is-specified/1955/1 "2020-10-01T20:14:56Z")

</div>

Hi,

I’m using cmake 3.17.0 and then tried 3.17.5. Our cmake code base uses the commands:

message( STATUS “---- ${resolvedFileToInstall} -\> ${to\_directory}” )  
install(  
FILES “${resolvedFileToInstall}”  
DESTINATION “${to\_directory}/”  
COMPONENT “${resourcesComponent}”  
)

One such use shows (in the message):

---- D:/Build4/gitAll/gpc/gis/resources/landClassification/IGBPa\_1198.dat -\> resources/landClassification/

Though only a single file is specified (IGBPa\_1198.dat), the contents of the landClassification directory are all copied and placed in the installer. Is this a bug in the install command?

thanks,  
matthew

---

<div class="post-metadata">

### Author: ![jwm](https://discourse.cmake.org/user_avatar/discourse.cmake.org/jwm/32/654_2.png) [@jwm](https://discourse.cmake.org/u/jwm)
#### Post date: [October 2, 2020, 12:04am UTC](https://discourse.cmake.org/t/install-files-installing-all-files-in-directory-when-single-file-is-specified/1955/2 "2020-10-02T00:04:08Z")

</div>

Hi Matthew,

Not an expert by any means, but I wonder if you are confusing your `${resolvedFileToInstall}` “landClassification” directory with the target `${to_directory}` “landClassification” directory?

I would expect the DESTINATION to be copied to the installer; this command is just adding a single file to that destination. Was it otherwise empty?
