ROOT_GENERATE_DICTIONARY() and install directive: only install .so, not .pcm and rootmap

Hi,

Here a fragment of my CMakeList.txt:

add_library(THERMUS SHARED ${SRCFILES})
set_target_properties(THERMUS PROPERTIES PUBLIC_HEADER "${HFILES}")
target_link_libraries(THERMUS ${ROOT_LIBRARIES} GSL::gsl GSL::gslcblas)

target_include_directories(THERMUS PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
ROOT_GENERATE_DICTIONARY(ThermusDict ${HFILES} LINKDEF THERMUSClassesLinkDef.h MODULE THERMUS)

install(TARGETS THERMUS)

install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libTHERMUS_rdict.pcm DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libTHERMUS.rootmap DESTINATION ${CMAKE_INSTALL_LIBDIR})

As you can see, I had to manually add the installation of the .pcm and .roadmap files.
However, from what I read, it should do it on its own, right?

Note: I also tried ROOT_STANDARD_LIBRARY_PACKAGE(), which behaves about same, but not sure it should be used outside of ROOT’s own libraries.

Thanks for any help.

Context:

root --version
ROOT Version: 6.28/04
Built for linuxx8664gcc on May 08 2023, 02:44:07
From tags/v6-28-04@v6-28-04

gcc --version
gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-22)

lsb_release -a
LSB Version:    :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
Distributor ID: Rocky
Description:    Rocky Linux release 8.10 (Green Obsidian)
Release:        8.10
Codename:       GreenObsidian

cmake --version
cmake version 3.26.5

ROOT Version: 6.28/04
Platform: Rocky 8.10
Compiler: gcc (GCC) 8.5.0

Note: adding a root --forum-version (or something), that would spit that exact content you expect we put as context would be nice, thanks.

Not sure how it works (I’ll have to try), but looking at ROOT_GENERATE_DICTIONARY in RootMacros.cmake, it looks like some install step is done…

Thank for your input.
But then what could prevents this to actually happens?
As it’s not when I run a “make install”.

Thanks.

I don’t know, I’ll try to find out

Side note,

in the CMake doc, I read:

CMAKE_LIBRARY_OUTPUT_DIRECTORY

Where to put all the [LIBRARY] target files when built.

This variable is used to initialize the [LIBRARY_OUTPUT_DIRECTORY] property on all the targets. See that target property for additional information.

That’s what is inside the code you linked.
However, its a build directive not an install one.

The root cmake code seems to mix both, as shared_lib_install_dir is an install stuff.

I’ll try to define CMAKE_LIBRARY_OUTPUT_DIRECTORY in a way that won’t break my code, and maybe that would work, but that should not be needed.

What do you think?

As I said, I’ll have to try

OK, it works if I add the trivial line (it’s what’s done by defaut):

SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})

But that should be irrelevant to an install directive.

Thanks for the help!

1 Like

Thanks to you for trying and for the feedback!

Hi,

Should this be a bug of a feature?
Thanks.