# CMAKE not installing \*.pcm and .rootmap

**URL:** <https://root-forum.cern.ch/t/cmake-not-installing-pcm-and-rootmap/50997>\
**Category:** ROOT\
**Tags:** cmake\
**Created:** [July 28, 2022, 4:11pm UTC](https://root-forum.cern.ch/t/cmake-not-installing-pcm-and-rootmap/50997 "2022-07-28T16:11:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![maurik](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/maurik/32/22685_2.png) [@maurik](https://root-forum.cern.ch/u/maurik)\
**Post date:** [July 28, 2022, 4:11pm UTC](https://root-forum.cern.ch/t/cmake-not-installing-pcm-and-rootmap/50997/1 "2022-07-28T16:11:52Z")

</div>

Hello CMAKE experts,

I would like to know the “correct” way of getting the \*.pcm and \*.rootmap files installed when cmake installs the library to CMAKE\_INSTALL\_PREFIX/lib. I know I can tell cmake to do this with an explicit INSTALL\_FILES() directive, but the code in RootMacros.cmake (around line 704) seems indicate this should be done by the ROOT macros. The confusion is that this particular bit of code only seems to do anything when CMAKE\_LIBRARY\_OUTPUT\_DIRECTORY is set, which it usually is not. So how should the install step be setup correctly?

Also, what is the correct place for ROOT + cmake information?  
There is quite a bit of cmake advice on this forum and at various web location that contradict each other and may not work depending on the version of ROOT you are using. The page: [Integrating ROOT into CMake projects - ROOT](https://root.cern/manual/integrate_root_into_my_cmake_project) is rather incomplete, it does not mention ROOT\_GENERATE\_DICTIONARY. The website: [ROOT · Modern CMake](https://cliutils.gitlab.io/modern-cmake/chapters/packages/ROOT.html) does much better, bit it still includes RootNewMacros.cmake, and does not help with getting the install step to work properly. From this forum: [How to Integrate ROOT into my project with CMake](https://root-forum.cern.ch/t/how-to-integrate-root-into-my-project-with-cmake/37175) does not have the ROOT\_GENERATE\_DICTIONARY after the “add\_library”. And none of these resources show anything about the install step of the library.

I recognize it is difficult to document a changing project, but some clarification would be helpful.

Thanks!

* * *

The relevant part of RootMacros.cmake is here:

```nohighlight
  if(NOT ARG_NOINSTALL AND NOT CMAKE_ROOTTEST_DICT AND DEFINED CMAKE_LIBRARY_OUTPUT_DIRECTORY)
    ROOT_GET_INSTALL_DIR(shared_lib_install_dir)
    # Install the C++ module if we generated one.
    if (cpp_module_file)
      install(FILES ${cpp_module_file}
                    DESTINATION ${shared_lib_install_dir} COMPONENT libraries)
    endif()

    if(ARG_STAGE1)
      install(FILES ${rootmap_name}
                    DESTINATION ${shared_lib_install_dir} COMPONENT libraries)
    else()
      install(FILES ${pcm_name} ${rootmap_name}
                    DESTINATION ${shared_lib_install_dir} COMPONENT libraries)
    endif()
  endif()

```

* * *

\_ROOT Version: git master  
\_Platform: MacOS  
\_Compiler: llvm  
\_cmake version: 3.22.2

* * *

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [August 11, 2022, 4:12pm UTC](https://root-forum.cern.ch/t/cmake-not-installing-pcm-and-rootmap/50997/2 "2022-08-11T16:12:25Z")

</div>

Closed on August 11, 2022, 4:12pm UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
