CMake missing environment variables errors

16,311

The 2nd and later optional args to the PROJECT command should be known CMake language values.

It's typical values are:

  • leave it off, don't provide a 2nd arg (default to C and CXX)
  • C
  • CXX
  • Fortran
  • NONE

You've provided "On" as a language value to the PROJECT command, which CMake does not know.

Remove the "On" and leave it blank or replace it with the languages you need for your project.

Share:
16,311

Related videos on Youtube

Ben Crowhurst
Author by

Ben Crowhurst

Updated on June 04, 2022

Comments

  • Ben Crowhurst
    Ben Crowhurst almost 2 years

    I'm attempting to use cmake on Mac OSX i've installed both a binary version and then also from source. However i continue to receive the following errors when attempting to create a Makefile.

    cpc1-dumb4-2-0-cust166:build bcrowhurst$ cmake . CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.

    Missing variable is:

    CMAKE_On_COMPILER_ENV_VAR

    CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.

    Missing variable is:

    CMAKE_On_COMPILER

    CMake Error: Could not find cmake module file:/Users/bcrowhurst/NetBeansProjects/appon/build/CMakeFiles/CMakeOnCompiler.cmake
    
    CMake Error: Could not find cmake module file:CMakeOnInformation.cmake
    
    CMake Error: CMAKE_On_COMPILER not set, after EnableLanguage
    
    -- Boost version: 1.43.0
    
    -- Found the following Boost libraries:
    
    --   system
    
    -- Configuring incomplete, errors occurred!
    

    My CMakeLists.txt is as follows:

    cmake_minimum_required( VERSION 2.6 )
    
    project( Application On )
    
    find_package( Boost COMPONENTS system REQUIRED )
    
    link_directories( ${Boost_LIBRARY_DIRS} )
    
    if(Boost_FOUND)
        include_directories( ${Boost_INCLUDE_DIRS} )
    
        add_library( object ../source/object.cpp ../source/object.h )   
        target_link_libraries( object ${Boost_SYSTEM_LIBRARY} )
    
    endif()
    

    Any help would be greatly appreciated.

    Thanks.

  • Ben Crowhurst
    Ben Crowhurst about 13 years
    ding! What a pitfall, thats that name of my application "Application On". this worked cheers mate.
  • Pär Nils Amsen
    Pär Nils Amsen almost 7 years
    Thanks dude, I "named" my project project(FFT Test Suite), or so I though. I have reinstalled CMake and stuff before finally finding this answer...