llnl / llnl/blt

BLT subproject changes behavior of non-BLT parent project

Open
#751 7 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
296
Forks
66
Avg merge
1h 3m
Merged PRs (30d)
1

Description

I have a large pre-existing CMake-based code base. We added a subproject to our code that uses BLT (pulled in as a subdirectory using git submodules), and many things in the parent project broke because BLT changes some global CMake variables. Specifically, `SetupBLT.cmake` sets `LIBRARY_OUTPUT_PATH`, `CMAKE_RUNTIME_OUTPUT_DIRECTORY`, and `CMAKE_Fortran_MODULE_DIRECTORY`, which changes the default behavior of many cmake routines for the entire project.

As a workaround, we had to go to every cmake routine affected by these global variables and explicitly set local variables to restore the old behavior.

I would expect and prefer that adding a CMake subproject that uses BLT to a CMake main project that does not use BLT would not result in any changes to the CMake behavior of the main project. This would be accomplished by having SetupBLT.cmake not change `LIBRARY_OUTPUT_PATH`, `CMAKE_RUNTIME_OUTPUT_DIRECTORY`, and `CMAKE_Fortran_MODULE_DIRECTORY`, and instead change the BLT macros to set local variables to replicate the desired behavior.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading SetupBLT.cmake and tracing where it sets LIBRARY_OUTPUT_PATH, CMAKE_RUNTIME_OUTPUT_DIRECTORY, and CMAKE_Fortran_MODULE_DIRECTORY. Review the BLT macros affected by those variables, then verify that embedding BLT leaves the parent project's defaults unchanged while preserving BLT's intended output behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.