You have just to put set command (not cache) for your compiler (CMAKE_Fortran_COMPILER) and environment variable in a file and specify this file on cmake command line with option -DCMAKE_TOOLCHAIN_FILE=your-file.
Le lun. 9 juil. 2018 à 03:32, Clune, Thomas L. (GSFC-6101) < thomas.l.cl...@nasa.gov> a écrit : > Marc, > > > > Thank you for the suggestion. Unfortunately, I’m a bit confused by the > documentation and not at all sure how to proceed. Further help would be > appreciated. > > > > In particular, I do not see how to capture the existing Fortran, C and CXX > toolchains and then provide the minor extension of setting this one > environment variable. In fact, at the moment, I don’t even see a simple > way to cut-and-paste the cmake built-in toolchains into a file to use as my > baseline for extension. > > > > Am I correct in assuming that once the above issues are solved, then a > simple line of the form > > > > set(ENV(INTEL_LICENSE_FILE) “…”) > > > > will then ensure that the compiler “sees” that env variable? Or do I > need to wrap the compiler in a script which just raises many more issues as > I need my project to be able to build with many different versions of the > Intel compiler. > > > > Thanks in advance, > > > > - Tom > > > > > > *From: *Marc CHEVRIER <marc.chevr...@gmail.com> > *Date: *Saturday, July 7, 2018 at 1:49 AM > *To: *"Clune, Thomas L. (GSFC-6101)" <thomas.l.cl...@nasa.gov> > *Cc: *CMake MailingList <cmake@cmake.org> > *Subject: *Re: [CMake] specifying path for license file for commercial > compiler? > > > > 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