Can't build master branch with cmake

Having trouble with the game? Report issues and get help here. Read this first!

Moderator: Forum Moderators

Forum rules
Before reporting issues in this section, you must read the following topic:
Post Reply
dwarftough
Posts: 484
Joined: August 4th, 2019, 5:27 pm

Can't build master branch with cmake

Post by dwarftough »

The output is

Code: Select all

cmake .  -DCMAKE_BUILD_TYPE=Debug
-- Lua submodule found.
-- Found the following ICU libraries:
--   data (required)
--   i18n (required)
--   uc (required)
Removing -rdynamic flag from CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS
Removing -rdynamic flag from CMAKE_SHARED_LIBRARY_LINK_C_FLAGS
Removing -DNDEBUG flag from CMAKE_CXX_FLAGS_RELWITHDEBINFO
Removing -DNDEBUG flag from CMAKE_C_FLAGS_RELWITHDEBINFO
Removing -DNDEBUG flag from CMAKE_CXX_FLAGS_MINSIZEREL
Removing -DNDEBUG flag from CMAKE_C_FLAGS_MINSIZEREL
Replacing default flags used for Release build with   
Replacing flags used for Debug build  -DDEBUG -ggdb3  
-- Configuring done
CMake Error at src/CMakeLists.txt:147 (add_executable):
  Target "sdl2" links to target "VorbisFile::VorbisFile" but the target was
  not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?


CMake Error at src/CMakeLists.txt:184 (add_executable):
  Target "sdl2_audio" links to target "VorbisFile::VorbisFile" but the target
  was not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?


CMake Error at src/CMakeLists.txt:154 (add_executable):
  Target "sdl2_image" links to target "VorbisFile::VorbisFile" but the target
  was not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?


CMake Error at src/CMakeLists.txt:160 (add_executable):
  Target "sdl2_mixer" links to target "VorbisFile::VorbisFile" but the target
  was not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?


CMake Error at src/CMakeLists.txt:166 (add_executable):
  Target "sdl2_jpg" links to target "VorbisFile::VorbisFile" but the target
  was not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?


CMake Error at src/CMakeLists.txt:178 (add_executable):
  Target "sdl2_webp" links to target "VorbisFile::VorbisFile" but the target
  was not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?


CMake Error at src/CMakeLists.txt:172 (add_executable):
  Target "sdl2_png" links to target "VorbisFile::VorbisFile" but the target
  was not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?


-- Generating done
CMake Generate step failed.  Build files cannot be regenerated correctly.
I could build 1.16 but not the master branch
Co-founder and current maintainer of IsarFoundation, Afterlife Rated and overall Wesnoth Autohost Project
Developer and maintainer of my fork of World Conquest, Invincibles Conquest II
User avatar
Pentarctagon
Project Manager
Posts: 5564
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Can't build master branch with cmake

Post by Pentarctagon »

What operating system?
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
dwarftough
Posts: 484
Joined: August 4th, 2019, 5:27 pm

Re: Can't build master branch with cmake

Post by dwarftough »

Ubuntu 20
Co-founder and current maintainer of IsarFoundation, Afterlife Rated and overall Wesnoth Autohost Project
Developer and maintainer of my fork of World Conquest, Invincibles Conquest II
User avatar
Pentarctagon
Project Manager
Posts: 5564
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Can't build master branch with cmake

Post by Pentarctagon »

And you do have the Vorbisfile dependency installed, right? Its handling was updated in https://github.com/wesnoth/wesnoth/comm ... 8b050bc9ec, but the CI build using cmake succeeded and it was also using Ubuntu 20.04.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
dwarftough
Posts: 484
Joined: August 4th, 2019, 5:27 pm

Re: Can't build master branch with cmake

Post by dwarftough »

I dunno if I have it or not. Which package should I install, libvorbis-dev? Btw strangely once cmake succeeded, finding vorbis somewhere, but it succeeded never after that
Co-founder and current maintainer of IsarFoundation, Afterlife Rated and overall Wesnoth Autohost Project
Developer and maintainer of my fork of World Conquest, Invincibles Conquest II
User avatar
Pentarctagon
Project Manager
Posts: 5564
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Can't build master branch with cmake

Post by Pentarctagon »

Yeah. For reference, everything installed on the CI for building it there for Ubuntu 20.04 is listed here, though you can ignore the programs and translations parts.

You could also try deleting all the CMakeCache files to get it to re-generate from scratch.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
dwarftough
Posts: 484
Joined: August 4th, 2019, 5:27 pm

Re: Can't build master branch with cmake

Post by dwarftough »

Well, it turns out that I can't run cmake when I want to compile everything but game. If I run cmake with usual options, it's fine. When I add "-DENABLE_GAME=false", it's what you see in the topic (and any rerun even without this option will cause this until I clean everything and start anew)
Co-founder and current maintainer of IsarFoundation, Afterlife Rated and overall Wesnoth Autohost Project
Developer and maintainer of my fork of World Conquest, Invincibles Conquest II
User avatar
Pentarctagon
Project Manager
Posts: 5564
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Can't build master branch with cmake

Post by Pentarctagon »

If you change line 145 of src/CMakeLists.txt from if(NOT MSVC) to if((ENABLE_GAME OR ENABLE_TESTS) AND NOT MSVC), does it work as expected?
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
dwarftough
Posts: 484
Joined: August 4th, 2019, 5:27 pm

Re: Can't build master branch with cmake

Post by dwarftough »

Yes, this way it works
Co-founder and current maintainer of IsarFoundation, Afterlife Rated and overall Wesnoth Autohost Project
Developer and maintainer of my fork of World Conquest, Invincibles Conquest II
User avatar
Pentarctagon
Project Manager
Posts: 5564
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Can't build master branch with cmake

Post by Pentarctagon »

Alright, I've pushed that fix in 0946d8b3f06ce55685a2a68c48284e1c832fe2ef. Thanks for reporting this.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
Post Reply