Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

CMake Compiler not set

CMake Error: CMAKE_Project_COMPILER not set, after EnableLanguage

I Get this Error after writing cmake ..

This is my CMakeLists.txt

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel


set(CMAKE_CXX_COMPILER "C:/mingw64/bin/g++")
set(CMAKE_C_COMPILER "C:/mingw64/bin/gcc")

project(CXX Project)

add_subdirectory(glfw/)

add_executable(${PROJECT_NAME} Main.cpp)
target_include_directories(${PROJECT_NAME} PUBLIC glfw)
target_link_libraries(${PROJECT_NAME} PUBLIC glfw)```


And this is my Complete Error
PS C:\Users\david\Documents\Idle\Project\build> cmake ..
CMake Error at CMakeLists.txt:6 (project):
  Running

   'nmake' '-?'

  failed with:

   Das System kann die angegebene Datei nicht finden


CMake Error: CMAKE_Project_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "C:/Users/david/Documents/Idle/Project/build/CMakeFiles/CMakeOutput.log".

>Solution :

You’re using the project command in the wrong way. It should be

project(Project CXX)

That’s why CMake is looking for CMAKE_Project_COMPILER instead of CMAKE_CXX_COMPILER.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading