# installing package configuration files: FILES or EXPORT

**URL:** https://discourse.cmake.org/t/installing-package-configuration-files-files-or-export/11577
**Category:** Usage
**Created:** [September 3, 2024, 1:56pm UTC](https://discourse.cmake.org/t/installing-package-configuration-files-files-or-export/11577 "2024-09-03T13:56:14Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![adaldev](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/a/9dc877/32.png) [@adaldev](https://discourse.cmake.org/u/adaldev)
#### Post date: [September 3, 2024, 1:56pm UTC](https://discourse.cmake.org/t/installing-package-configuration-files-files-or-export/11577/1 "2024-09-03T13:56:14Z")

</div>

From the tutorial:

```cmake
# generate the config file that includes the exports
# creates the file in the build tree
configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
  "${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsConfig.cmake"
  INSTALL_DESTINATION "lib/cmake/MathFunctions"
  )

# AnyNewerVersion or SameMajorVersion?
write_basic_package_version_file(
  "${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsConfigVersion.cmake"
  VERSION "${Tutorial_VERSION_MAJOR}.${Tutorial_VERSION_MINOR}"
  COMPATIBILITY AnyNewerVersion
)

#actually copy the files
install(FILES
  ${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsConfig.cmake
  ${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsConfigVersion.cmake
  DESTINATION lib/cmake/MathFunctions
  )

```

Shouldn’t it be `install(EXPORT...`? why?

regards  
A.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [July 21, 2025, 12:30am UTC](https://discourse.cmake.org/t/installing-package-configuration-files-files-or-export/11577/2 "2025-07-21T00:30:15Z")

</div>

Those are files the project manages. The `install(EXPORT)` call installs a fully-CMake-generated file containing information about the targets in the named `EXPORT` set. See `install(TARGETS … EXPORT)`.
