I am new with CMake, and am using Visual Studio Code with SSH to Linux. In my ~/.bashrc file I have an environment variable exported to a directory path. I have checked it with PRINTENV, and the path is correct. In CMake however the path is undefined. What am I doing wrong? Thanks
IF(DEFINED ENV{ALPHA_DIR})
SET(ALPHA_DIR $ENV{ALPHA_DIR})
ELSEIF(NOT DEFINED ALPHA_DIR OR ALPHA_DIR STREQUAL "NOT-SET")
SET(ALPHA_DIR "NOT-SET" CACHE PATH "ALPHA_DIR directory")
MESSAGE( FATAL_ERROR "** Please add the variable 'ALPHA_DIR'")
ENDIF()
with the output generated:
CMake Error at CMakeLists.txt:37 (MESSAGE): ** Please add the variable 'ALPHA_DIR'