Skip to content
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

Multiple cmake issues when trying to build #1584

Open
elirnm opened this issue Oct 18, 2023 · 6 comments
Open

Multiple cmake issues when trying to build #1584

elirnm opened this issue Oct 18, 2023 · 6 comments
Labels
area: buildsystem Related to our cmake/python buildsystem bug Behaving differently as it should behave os: windows Windows-specific issue

Comments

@elirnm
Copy link

elirnm commented Oct 18, 2023

I'm trying to build the current version on Windows 11 and running into several problems in the cmake config step. I'm running the following command from the openage\build folder:

cmake -DCMAKE_TOOLCHAIN_FILE=..\vcpkg\scripts\buildsystems\vcpkg.cmake -G "Visual Studio 17 2022" -A x64 -DDOWNLOAD_NYAN=YES -DFLEX_EXECUTABLE=..\flex\win_flex.exe ..

My cmake version is 3.28.0-rc1

The first issue is it failing with

CMake Error at CMakeLists.txt:207 (project):
  VERSION "v0.5.2" format invalid.

It seems to not like the "v" and manually editing the version to just "0.5.2" fixed that problem.

The second issue is it failing with

CMake Error at libopenage/CMakeLists.txt:53 (find_package):
  By not providing "Findtoml11.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "toml11", but
  CMake did not find one.

  Could not find a package configuration file provided by "toml11" with any
  of the following names:

    toml11Config.cmake
    toml11-config.cmake

  Add the installation prefix of "toml11" to CMAKE_PREFIX_PATH or set
  "toml11_DIR" to a directory containing one of the above files.  If "toml11"
  provides a separate development package or SDK, be sure it has been
  installed.


-- Configuring incomplete, errors occurred!

I have toml11 installed in vcpkg but cmake isn't seeing that and I can't figure out how to make it do so. I tried adding the directory to -DCMAKE_PREFIX_PATH and also copying the toml11Config.cmake file to various other folders but always got the same error.

@heinezen heinezen added bug Behaving differently as it should behave os: windows Windows-specific issue area: buildsystem Related to our cmake/python buildsystem labels Oct 18, 2023
@heinezen
Copy link
Member

The version error should be fixed by #1583

@heinezen
Copy link
Member

No idea yet for the vcpkg problem. Our CI builds run through withouth problems.

Maybe you follow the steps in the CI build and check if that solves the error in some way?

https://github.com/SFTtech/openage/blob/master/.github/workflows/windows-server-2022.yml

@elirnm
Copy link
Author

elirnm commented Oct 20, 2023

Thanks, that helped me figure it out. I was copying the commands from the Windows build guide ( cmake -DCMAKE_TOOLCHAIN_FILE=<vcpkg directory>\scripts\buildsystems\vcpkg.cmake .. and -DDOWNLOAD_NYAN=YES -DFLEX_EXECUTABLE=<path to win_flex.exe>) but the paths need quotes around them.

Unfortunately now the actual build command (cmake --build . --config RelWithDebInfo -- /nologo /m /v:m) is itself failing partway through the build:

G:\openage\vcpkg\installed\x64-windows\debug\bin\freetyped.dll : fatal error LNK1107: invalid or corrupt file: cannot read at 0x350 [G:\openage\build\libopenage\libopenage.vcxproj]

There are a number of compiler warnings about that file earlier in the build but I see it's still succeeding on the server so I don't know what's going on there.

@heinezen
Copy link
Member

@elirnm Weird, this is again something with vcpkg. Maybe your vcpkg setup is borked :D

Is freetype.dll at the place specified in the error message? It should be somewhere if you have installed it.

@dmwever
Copy link

dmwever commented Dec 10, 2024

I have now run into the toml11 issue here. Just FYI. If I figure out a solution I'll be sure to update.

@dmwever
Copy link

dmwever commented Dec 10, 2024

Strange thing here: I was not having this issue originally, but I am having it now. I can no longer even build.

I will likely try a fresh install of everything at a later point and see if that helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: buildsystem Related to our cmake/python buildsystem bug Behaving differently as it should behave os: windows Windows-specific issue
Projects
None yet
Development

No branches or pull requests

3 participants