CMake environment variable errors missing

I am trying to use cmake on Mac OSX. I installed both the binary version and the original one. However, when I try to create a Makefile, I keep getting the following errors.

cpc1-dumb4-2-0-cust166: build bcrowhurst $ cmake. CMake error: an error in which the internal CMake variable is not set, cmake may not be built correctly.

Missing variable:

CMAKE_On_COMPILER_ENV_VAR

CMake error: an error in which the internal CMake variable is not set, cmake may not be built correctly.

Missing variable:

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.

+4
source share
1 answer

The second and later optional arguments to the PROJECT command must be known to the CMake language values.

Typical Values:

  • leave this, don't provide the second argument (default is C and CXX)
  • WITH
  • Cxx
  • Fortran
  • NONE

You provided "On" as the language value for the PROJECT command, which CMake does not know.

Extract "On" and leave it blank or replace it with the languages ​​needed for your project.

+3
source

Source: https://habr.com/ru/post/1340331/


All Articles