Source script before building

Answered

Hello,

I am using CERN's ROOT framework that comes with a script to prepare everything you need called thisroot.sh. This automatically sets a bunch of environment variables. My normal build process is:

source /path/to/thisroot.sh
cmake [...]
make

Or I have the "source thisroot.sh" in my .bashrc. I know I can manually add environment variables in CLion, but is there a way to source that script before running cmake?

OS: Fedora 29
CLion 2019.1

2
5 comments

Hello! There is no way to run something before CMake project loading automatically, it's possible only before building/running. You can create an external tool with this script and run it manually. 

0

@Gerritzen Did you manage ?

0

@Anna Falevskaya I do not understand how this is meant to be working. Will an external tool modify the environment of the whole Clion and make it available next time cmake is ran ?

0

It seems my previous answer was incorrect, sorry for that. Feel free to comment or upvote https://youtrack.jetbrains.com/issue/CPP-8414.

0

Source your variables in .profile not .bashrc

0

Please sign in to leave a comment.