Skip to content

Commit 0d25d0c

Browse files
committed
cmake: FindBabbleSim: Ensure BSIM variables are available everywhere
Ensure the two BSIM variables BSIM_OUT_PATH and BSIM_COMPONENTS_PATH are available everywhere also as a cmake variable as quite a few apps use them. (Some apps try to get them as an environment var, some as a cmake var). When the user had them set in the environment, and the BabbleSim module uses zephyr_get() to try to find them, this also sets them globally. But otherwise, if we just deduced them in this module, we were only setting them in the enviroment, so apps which expected them globally would not build properly. Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
1 parent bdb8a8b commit 0d25d0c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

‎cmake/modules/FindBabbleSim.cmake‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,12 @@ if((NOT DEFINED BSIM_COMPONENTS_PATH) OR (NOT DEFINED BSIM_OUT_PATH))
6060
)
6161
endif()
6262

63-
# Many apps cmake files (in and out of tree) expect these environment variables. Lets provide them:
63+
# Many apps cmake files (in and out of tree) expect these either as environment variables or preset
64+
# variables. Lets provide them in any case:
6465
set(ENV{BSIM_COMPONENTS_PATH} ${BSIM_COMPONENTS_PATH})
6566
set(ENV{BSIM_OUT_PATH} ${BSIM_OUT_PATH})
67+
set(BSIM_COMPONENTS_PATH ${BSIM_COMPONENTS_PATH} CACHE PATH "BabbleSim components folder")
68+
set(BSIM_OUT_PATH ${BSIM_OUT_PATH} CACHE PATH "BabbleSim build output folder")
6669

6770
# Let's check that it is new enough and built,
6871
# so we provide better information to users than a compile error:

0 commit comments

Comments
 (0)