Instalé CMake en Windows además del compilador gcc y g ++. Agregué las variables a la ruta, pero sigo recibiendo el siguiente error. ¿Podrían ayudarme?
-- Building for: NMake Makefiles CMake Error at CMakeLists.txt:6 (project): Running 'nmake' '-?' failed with: The system cannot find the file specified CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage -- Configuring incomplete, errors occurred! See also "C:/Users/DEANHOS/Desktop/peer/cmake tutorial/codeAndTech/sample/CMakeFiles/CMakeOutput.log".
Estas variables deben pasarse en la línea de comando como:
$ cmake -DCMAKE_CXX_COMPILER=/pathto/g++ -DCMAKE_C_COMPILER=/pathto/gcc /pathto/source
o configura antes de la línea project()
en CMakeLists.txt:
set( CMAKE_CXX_COMPILER "/pathto/g++" ) set( CMAKE_C_COMPILER "/pathto/gcc" ) project(mytest) ...
o alternativamente introducido con el comando -C <toolchain>
como
# mygcc.cmake # toolchain file set( CMAKE_CXX_COMPILER "/pathto/g++" ) set( CMAKE_C_COMPILER "/pathto/gcc" )
$ cmake -C /pathto/mygcc.cmake /pathto/source