llnl / llnl/blt

New utility macro for conditionally setting a variable?

Open
#495 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

It might be useful to add a new utility macro to set a variable using a ternary operator

blt_set(TO <var>
        IF     <cnd>
        THEN   <true_val>
        ELSE   <false_val>
       [CACHE  TRUE|FALSE] 
        )

This would replace the following

if( <cnd> )
   set(<var> <true_val>)
else()
   set(<var> <false_val>)
endif()

Other possible names:

  • blt_conditional_set
  • blt_ternary_set
  • blt_set_if
  • blt_ternary

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

The issue names no implementation file, test, or entry point. Start by locating BLT's existing utility macros and CMake tests, then compare their argument and CACHE conventions with the proposed conditional form; done means agreeing on the macro name and behavior and adding coverage for both condition branches and cache handling.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake
Domain
build-system
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.