Skip to content

Also copy woof.pk3 next to the executable when building for Mac#2636

Merged
rfomin merged 1 commit intofabiangreffrath:masterfrom
ioan-chera:copy-pk3-mac
Mar 14, 2026
Merged

Also copy woof.pk3 next to the executable when building for Mac#2636
rfomin merged 1 commit intofabiangreffrath:masterfrom
ioan-chera:copy-pk3-mac

Conversation

@ioan-chera
Copy link
Copy Markdown
Contributor

Currently when trying to play Woof built from source, I get a "woof.pk3 not found" error, which unfortunately can't be solved by changing the working directory or providing command-line parameters, but I have to actively copy or symlink the file post-build. I've noticed that the build system only does the copying for Windows (and only with Visual Studio), so I'm suggesting to also do it on Mac. Since currently there's no elaborate app bundle target (for which I would most likely try to put it in the "../share" path inside the bundle), just a raw executable, I think it's fine for now to just copy the woof.pk3 next to woof, for convenience.

@rfomin rfomin merged commit b2e2561 into fabiangreffrath:master Mar 14, 2026
9 checks passed
@rfomin
Copy link
Copy Markdown
Collaborator

rfomin commented Mar 14, 2026

Thank you!

@fabiangreffrath
Copy link
Copy Markdown
Owner

fabiangreffrath commented Mar 14, 2026

Hm, even on Linux the woof.pk3 file is already next to the built woof executable:

$ LANG=C ls -l build/src
total 6772
drwxrwxr-x 4 fabian fabian    4096 Mar 14 20:05 CMakeFiles
-rw-rw-r-- 1 fabian fabian    3032 Mar 14 20:05 cmake_install.cmake
-rwxrwxr-x 1 fabian fabian 5990184 Mar 14 20:06 woof
-rwxrwxr-x 1 fabian fabian  623136 Mar 14 20:06 woof-setup
-rw-rw-r-- 1 fabian fabian  303385 Mar 14 20:06 woof.pk3

@fabiangreffrath
Copy link
Copy Markdown
Owner

Seriously, I don't get it. In the top-level CMakeLists.txt we do

set(BASE_PK3_PATH "${CMAKE_BINARY_DIR}/src/${BASE_PK3}")

And in base/CMakeLists.txt we do

add_custom_command(OUTPUT "${BASE_PK3_PATH}"
    COMMAND ${CMAKE_COMMAND} -E tar cf "${BASE_PK3_PATH}" --format=zip ${BASE_SOURCES}
    DEPENDS ${BASE_SOURCES}
    WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")

So, the woof.pk3 file is already supposed to end up next to the executable in ${CMAKE_BINARY_DIR}/src. Or is it not?

@rfomin
Copy link
Copy Markdown
Collaborator

rfomin commented Mar 15, 2026

So, the woof.pk3 file is already supposed to end up next to the executable in ${CMAKE_BINARY_DIR}/src. Or is it not?

I think it's an issue with the Mac Xcode IDE. Windows Visual Studio also has a special directory structure.
When I built Woof in a Mac VM using command line tools a while ago, woof.pk3 was placed in the same place as in Linux or MSYS2.

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

Successfully merging this pull request may close these issues.

3 participants