Skip to content

Commit

Permalink
allow disabling CMAKE_INSTALL_LIBDIR injection through install_libdir…
Browse files Browse the repository at this point in the history
… in CMakeMake
  • Loading branch information
lexming committed May 27, 2024
1 parent 3880cc1 commit a109930
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions easybuild/easyblocks/generic/cmakemake.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,15 +207,16 @@ def configure_step(self, srcdir=None, builddir=None):
options['CMAKE_BUILD_TYPE'] = self.build_type

# Set installation directory for libraries
# any CMAKE_INSTALL_DIR[:PATH] setting defined in easyconfig has precedence
cmake_install_dir_pattern = re.compile(r"-DCMAKE_INSTALL_LIBDIR(:PATH)?=[^\s]")
if cmake_install_dir_pattern.search(self.cfg['configopts']):
self.log.info(
"CMAKE_INSTALL_LIBDIR is set in configopts. Ignoring 'install_libdir' easyconfig parameter."
)
else:
# set CMAKE_INSTALL_LIBDIR including its type to PATH, otherwise CMake can silently ignore it
options['CMAKE_INSTALL_LIBDIR:PATH'] = self.cfg['install_libdir']
# any CMAKE_INSTALL_DIR[:PATH] setting defined in 'configopts' has precedence over 'install_libdir'
if self.cfg['install_libdir'] is not None:
cmake_install_dir_pattern = re.compile(r"-DCMAKE_INSTALL_LIBDIR(:PATH)?=[^\s]")
if cmake_install_dir_pattern.search(self.cfg['configopts']):
self.log.info(
"CMAKE_INSTALL_LIBDIR is set in configopts. Ignoring 'install_libdir' easyconfig parameter."
)
else:
# set CMAKE_INSTALL_LIBDIR including its type to PATH, otherwise CMake can silently ignore it
options['CMAKE_INSTALL_LIBDIR:PATH'] = self.cfg['install_libdir']

# Add -fPIC flag if necessary
if self.toolchain.options['pic']:
Expand Down

0 comments on commit a109930

Please sign in to comment.