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

Can't build 1.11.0 #8954

Closed
esselfe opened this issue Apr 5, 2021 · 9 comments
Closed

Can't build 1.11.0 #8954

esselfe opened this issue Apr 5, 2021 · 9 comments

Comments

@esselfe
Copy link

esselfe commented Apr 5, 2021

Version of OpenTTD

1.11.0

Expected result

cmake configuration to succeed.

Actual result

cmake configuration fails.

Steps to reproduce

wget https://github.com/OpenTTD/OpenTTD/archive/refs/tags/1.11.0.tar.gz -O openttd-1.11.0-source.tar.gz
tar xf openttd*gz
cd openttd*0
mkdir build
cd build
cmake ..

Output

13:58:09root@L0:/build/openttd-1.11.0/build# cmake ..
CMake Error at CMakeLists.txt:10 (message):
  In-source builds not allowed.  Please run "cmake .." from the bin directory


-- Configuring incomplete, errors occurred!
See also "/build/openttd-1.11.0/CMakeFiles/CMakeOutput.log".
@esselfe
Copy link
Author

esselfe commented Apr 5, 2021

Commenting lines 9 to 11 of openttd-1.11.0/CMakeLists.txt fixes this but the resulting Makefile is in the source dir, not in build/.

@glx22
Copy link
Contributor

glx22 commented Apr 5, 2021

Using the exact same steps it works fine for me.
I think we need more info about at least your CMake version.

@esselfe
Copy link
Author

esselfe commented Apr 5, 2021

I have cmake 3.20.0

@glx22
Copy link
Contributor

glx22 commented Apr 5, 2021

Hmm ok, should not be an issue.
Adding

message(STATUS "Source: ${CMAKE_SOURCE_DIR}")
message(STATUS "Binary: ${CMAKE_BINARY_DIR}")

before line 9 will tell what CMake detected.

@esselfe
Copy link
Author

esselfe commented Apr 5, 2021

I 'cd build; cmake ..'

-- Source: /build/openttd-1.11.0
-- Binary: /build/openttd-1.11.0
CMake Error at CMakeLists.txt:12 (message):
  In-source builds not allowed.  Please run "cmake .." from the bin directory


-- Configuring incomplete, errors occurred!
See also "/build/openttd-1.11.0/CMakeFiles/CMakeOutput.log".
See also "/build/openttd-1.11.0/CMakeFiles/CMakeError.log".

@LordAro
Copy link
Member

LordAro commented Apr 5, 2021

Error very much suggests that the cd build command is not working for some reason or another. Run pwd after doing so?

@esselfe
Copy link
Author

esselfe commented Apr 5, 2021

pwd:
/build/openttd-1.11.0/build

@glx22
Copy link
Contributor

glx22 commented Apr 5, 2021

Oh maybe there's a leftover CMakeCache.txt in /build/openttd-1.11.0.

@esselfe
Copy link
Author

esselfe commented Apr 5, 2021

yes it was that! I deleted the file and it works! Thank you so much!

@esselfe esselfe closed this as completed Apr 5, 2021
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