CMAKE_COMPILER_IS_GNUCXX and CMAKE_CXX_COMPILER_ID are empty

后端 未结 2 1418
感动是毒
感动是毒 2021-02-14 08:49

I am currently playing around with CMake and want to detect the compiler and the compiler version. My current CMakeLists.txt looks as follows:

cmake         


        
2条回答
  •  南笙
    南笙 (楼主)
    2021-02-14 09:16

    It might help you tell CMake that this is a C++ project. To do it you say it in the project command:

    project ($(PROJECT) CXX)
    #                   ^^^
    # Note project type
    

    You might also want to do it before checking the variable.

提交回复
热议问题