maddouri / vscode-cmake-tools-helper

VSCode extension that enables cpptools to automatically know the information parsed by CMake Tools (e.g. include directories and defines)
https://marketplace.visualstudio.com/items?itemName=maddouri.cmake-tools-helper
BSD 3-Clause "New" or "Revised" License
16 stars 6 forks source link

Wrong CMake install path on OSX #9

Open apingault opened 7 years ago

apingault commented 7 years ago

Hi, Let me first thank you for this nice tool!

Now, I found that when installing cmake with the command CMake: Install CMake on OSX the install path is wrongly set. You need to append CMake.app/Contents to the path. I guess the change could be made in

export function downloadAndInstallCMake_actual(...){
    ...
    const extractionDir = extractedData[0].path.split(/[\/\\]/)[0];  // keep only the first "component" of the path
    const extractionPath = `${downloadPath}${path.sep}${extractionDir}`;
    ...
}

Adding CMake.app/Contents to extractionDir if osName=='Darwin' should do it.

Changing the cmake.cmakePath by hand in settings.json works but the use of CMake: Change Cmake Version is still broken as the cmd uses some internal variable instead of cmake.cmakePath.