Skip to content

Trouble with CMake #83

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Ashrindy opened this issue Nov 18, 2023 · 9 comments
Closed

Trouble with CMake #83

Ashrindy opened this issue Nov 18, 2023 · 9 comments

Comments

@Ashrindy
Copy link
Contributor

Hey!
I'm a bit new to CMake so this might be a simple and stupid solution, but I'm getting this error which I have no idea on how to solve.
Screenshot_239
Would appreciate any sort of solution!

@Knuxfan24
Copy link

This looks like the same (or a similar) problem in #81, has anything in that thread helped?

@Ashrindy
Copy link
Contributor Author

Ashrindy commented Nov 18, 2023

@Knuxfan24 Absolutely not :/. I've tried everything in that thread, but nothing seemed to help.

@Radfordhound
Copy link
Owner

Hey, sorry you're having issues! Thanks for attaching a screenshot; that's very helpful!

It looks like the Get-Dependencies script is running CMake, and CMake is failing, because it can't find a "generator" to use (a thing to build the C++ code with, basically).

Do you have Visual Studio installed, along with the C++ build tools? Those are required to build C++ code on Windows (they're big downloads, so sorry in advance for this if you don't already have them. Microsoft moment).

@Ashrindy
Copy link
Contributor Author

@Radfordhound Thanks for your worry!
I've the C++ build tools downloaded, which is why I'm scratching my head on why it doesn't work.

@Radfordhound
Copy link
Owner

@Ashrindy Huh, I'm not sure why CMake is defaulting to the Unix Makefiles generator then, that's very weird! Is this being run in a Unix-like environment, like MinGW or something?

Regardless, assuming you've got Visual Studio 2022, try adding -G "Visual Studio 17 2022" to line 53 of Get-Dependencies.ps1, like so:

& cmake -Wno-deprecated -G "Visual Studio 17 2022" -A $Architecture ../src/$SourcePath $Arguments $InstalledPrefixArgument

(Or, if you're using Visual Studio 2019, then use -G "Visual Studio 16 2019" instead.)

Then, try running the Get-Dependencies script again, to see if that lets you build (or at least gives you a different error).

@Ashrindy
Copy link
Contributor Author

Ashrindy commented Nov 19, 2023

@Radfordhound I'm not quite sure on the environment. Though after adding that argument in, it spits out a different error
Screenshot_240.
Even though I have VS 2022 downloaded and am constantly using, it says it doesn't exist.

@Radfordhound
Copy link
Owner

@Ashrindy Interesting! Normal CMake for Windows builds are always supposed to have the Visual Studio generators built-in... so maybe a special version of CMake is installed on your machine that ended up higher in your PATH somehow? I assume you downloaded your CMake from cmake.org, yeah?

Do you happen to have devkitpro/msys2 installed? That comes with its own version of CMake which might be screwing with things.

What does it say if you run the following command in a Command Prompt window:

(NOTE: It has to be command prompt, as for some reason, this command seems to just output nothing in PowerShell)

where cmake.exe

For me, it listed two paths:

E:\Program Files\CMake\bin\cmake.exe
e:\devkitPro\msys2\usr\bin\cmake.exe

As you can see, I have devkitpro installed, but it's lower in my PATH, so when I run "cmake", it uses that first cmake.exe, which is the correct one, and it has the Visual Studio generators.

If I instead run the second one that it lists for me from devkitpro, I also do not have any Visual Studio generators listed.

@Ashrindy
Copy link
Contributor Author

@Radfordhound You were right! I have msys2 downloaded, and it was above my normal cmake.exe. Though it only worked when I removed -G "Visual Studio 17 2022", which is kinda weird, but atleast it solved my problem! Thanks for your help and patience! Very appreciated!

@Radfordhound
Copy link
Owner

@Ashrindy Ay! 🎉 No problem, happy I could help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants