I agree that a toolchain file is more appropriate, noting that typically modifying the environment variables is much more common for there's compilers (particularly using environment modules).
However, since you've started clearly you would rather not set the environment variables, there may be an easier "hack". Intel also looks in /opt/intel/licenses for any .lic files. So if you want, you can just create a symbolic link or copy your license file there :) On Fri, Jul 6, 2018, 10:49 PM Marc CHEVRIER <marc.chevr...@gmail.com> wrote: > May be using a toolchain file is more appropriate. See > https://cmake.org/cmake/help/v3.12/manual/cmake-toolchains.7.html > > > Le ven. 6 juil. 2018 à 22:59, Clune, Thomas L. (GSFC-6101) < > thomas.l.cl...@nasa.gov> a écrit : > >> To use the Intel compiler, one must use an environment variable that >> specifies the path to the license file. E.g., >> >> export INTEL_LICENSE_FILE=/usr/local/intel/license >> >> Other commercial compilers use a very similar mechanism. I had hoped >> to capture such information in a cache file so that I could avoid polluting >> the shell where I am invoking cmake: >> >> % cmake -C my-cache <src-dir> >> >> Such a cache file could look like: >> >> set(CMAKE_Fortran_COMPILER >> "/usr/local/intel/2018/compilers_and_libraries_2018.3.222/linux/bin/intel64/ifort" >> CACHE path "Fortran compiler") >> set(ENV{INTEL_LICENSE_FILE} "/usr/local/intel/license" CACHE path >> "Intel license") >> >> >> Unfortunately, the compiler is not “seeing” the env variable and >> complains that there is no license. Is there a solution to this, or am >> I forced to set the env variable each time I try to build? >> >> >> >> >> >> >> >> -- >> >> Powered by www.kitware.com >> >> Please keep messages on-topic and check the CMake FAQ at: >> http://www.cmake.org/Wiki/CMake_FAQ >> >> Kitware offers various services to support the CMake community. For more >> information on each offering, please visit: >> >> CMake Support: http://cmake.org/cmake/help/support.html >> CMake Consulting: http://cmake.org/cmake/help/consulting.html >> CMake Training Courses: http://cmake.org/cmake/help/training.html >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Follow this link to subscribe/unsubscribe: >> https://cmake.org/mailman/listinfo/cmake >> > -- > > Powered by www.kitware.com > > Please keep messages on-topic and check the CMake FAQ at: > http://www.cmake.org/Wiki/CMake_FAQ > > Kitware offers various services to support the CMake community. For more > information on each offering, please visit: > > CMake Support: http://cmake.org/cmake/help/support.html > CMake Consulting: http://cmake.org/cmake/help/consulting.html > CMake Training Courses: http://cmake.org/cmake/help/training.html > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Follow this link to subscribe/unsubscribe: > https://cmake.org/mailman/listinfo/cmake >
-- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: https://cmake.org/mailman/listinfo/cmake