简体   繁体   中英

Getting "Could not find cmake module file: CMakeDetermineVersionCompiler.cmake" with cmake in linux

I'm getting Could not find cmake module file: CMakeDetermineVersionCompiler.cmake after installing cmake via script from website. What am I missing and where/what commands to run to fix this issue.

install cmd:

sudo ./cmake.sh --prefix=/usr/local/ --exclude-subdir

CMakeLists.txt:

cmake_minimum_required(VERSION 3.12)

project(Hello Version 1.0)

add_executable(${PROJECT_NAME} ../src/main.cpp)

Version: cmake version 3.16.6 (I also tried the latest version 3.17.2 too)

OS: Linux Mint 19 Cinnamon

Inside CMake commands all options have case-sensitive names, which are usually upper-case . So, it is incorrectly to write Version instead of VERSION . Correct:

project(Hello VERSION 1.0)

See documentation for project command.

@Tsyvarev is correct, of course - it's Version used instead of VERSION .

I've reported this over at Kitware's issue tracker:

Feel free to chime in on that page. Hopefully they'll address this at some point (they're often responsive).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM