So I’m trying to use CMake with the presets.json and keep getting this error above. I’ve installed CMake and everything.
This is my CMakeFile.txt file.
cmake_minimum_required(VERSION 3.0.0)
project(project_6)
set(project_6 CMAKE_CXX_STANDARD 14)
include(CTest)
enable_testing()
include_directories(.)
include(FetchContent)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/609281088cfefc76f9d0ce82e1ff6c30cc3591e5.zip
)
FetchContent_MakeAvailable(googletest)
enable_testing()
add_executable(tests tests.cpp hashmap.cpp hashmap.h)
target_link_libraries(tests gtest_main)
include(GoogleTest)
gtest_discover_tests(tests)
add_executable(project_6 bitstream.h hashmap.cpp hashmap.h main.cpp util.h)
This is my JSON
{
"version": 3,
"configurePresets": [
{
"name": "default",
"description": "Default settings",
"hidden": false,
"generator": "Unix Makefiles",
"binaryDir": "${workspaceFolder}/build",
"cacheVariables":
{
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_EXPORT_COMPILE_COMMANDS": "YES"
}
}
]
}
I’m not really sure where the problem is coming from. As whenever I press the “set build” button it doesn’t allow me to set a build target. It instead says the error above on the console output and another error also pops up “Bad CMake executable: “”. Check to make sure it is installed or the value of the “cmake.cmakePath” setting contains the correct path”.
I’ve tried to mess around with the makefile and watched some youtube videos but nothing has been similiar to my problem. I am new to VSCode as all this code above without the JSON works fine in CLion. But in VSCode it comes up with these problems.