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

Improve CMake behavior on Unix and macOS #66369

Merged
merged 3 commits into from
Jun 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ option(LIBBACKTRACE "Print backtrace with libbacktrace." "OFF")
option(USE_XDG_DIR "Use XDG directories for save and config files." "OFF")
option(USE_HOME_DIR "Use user's home directory for save and config files." "ON")
cmake_dependent_option(USE_PREFIX_DATA_DIR
"Use UNIX system directories for game data in release build." OFF
"Use UNIX system directories for game data in release build." ON
"UNIX" OFF
)
option(LOCALIZE "Support for language localizations. Also enable UTF support." "ON")
Expand Down Expand Up @@ -172,6 +172,7 @@ else ()
# Use CMAKE_INSTALL_PREFIX as storage of data,gfx, etc.. Useful only on *nix OS.
if(USE_PREFIX_DATA_DIR)
if ("${CMAKE_SYSTEM_NAME}" MATCHES "(Linux|FreeBSD|Darwin)")
set(CMAKE_INSTALL_DATAROOTDIR "${CMAKE_INSTALL_PREFIX}/share/cataclysm-dda")
add_definitions(-DPREFIX=${CMAKE_INSTALL_PREFIX})
configure_file(
"${CMAKE_SOURCE_DIR}/src/prefix.h.in"
Expand Down
2 changes: 1 addition & 1 deletion lang/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ foreach (LANG ${LANGUAGES})
add_custom_command(
OUTPUT ${_MO}
COMMAND ${CMAKE_COMMAND} -E
make_directory ${CMAKE_SOURCE_DIR}/lang/mo/${LANG}
make_directory ${CMAKE_SOURCE_DIR}/lang/mo/${LANG}/LC_MESSAGES
COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -f ${_PO} -o ${_MO}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
DEPENDS ${_PO}
Expand Down
4 changes: 4 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ if (TILES)
target_link_libraries(cataclysm-tiles-common PUBLIC backtrace)
endif ()
endif ()
elseif (APPLE)
target_link_libraries(cataclysm-tiles-common PUBLIC "-framework CoreFoundation")
endif ()

if (LIBBACKTRACE)
Expand Down Expand Up @@ -191,6 +193,8 @@ if (CURSES)
if (BACKTRACE)
target_link_libraries(cataclysm-common PUBLIC dbghelp.lib)
endif ()
elseif (APPLE)
target_link_libraries(cataclysm-common PUBLIC "-framework CoreFoundation")
endif ()

if (LIBBACKTRACE)
Expand Down