mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-10 09:32:29 +01:00
Fix cmake for OpenRCT2-UI on macOS
This commit is contained in:
committed by
Gymnasiast
parent
f998172674
commit
7a59eef47e
@@ -4,6 +4,7 @@ if (CMAKE_BINARY_DIR STREQUAL CMAKE_SOURCE_DIR)
|
||||
message(FATAL_ERROR "Building in-source is not supported! Create a build dir and remove ${CMAKE_SOURCE_DIR}/CMakeCache.txt")
|
||||
endif()
|
||||
set(ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}")
|
||||
set(CMAKE_MACOSX_RPATH 1)
|
||||
|
||||
set(TITLE_SEQUENCE_URL "https://github.com/OpenRCT2/title-sequences/releases/download/v0.0.5/title-sequence-v0.0.5.zip")
|
||||
set(TITLE_SEQUENCE_SHA1 "79ffb2585d12abcbfce205d7696e3472a504b005")
|
||||
|
||||
@@ -12,6 +12,7 @@ include(FindPkgConfig)
|
||||
|
||||
# Third party libraries
|
||||
PKG_CHECK_MODULES(SDL2 REQUIRED sdl2)
|
||||
PKG_CHECK_MODULES(SPEEX REQUIRED speexdsp)
|
||||
if (NOT DISABLE_OPENGL)
|
||||
# GL doesn't work nicely with macOS, while find_package doesn't work with multiarch on Ubuntu.
|
||||
if (APPLE)
|
||||
@@ -43,7 +44,12 @@ add_executable(${PROJECT} ${OPENRCT2_UI_SOURCES} ${OPENRCT2_UI_M_SOURCES} ${OPEN
|
||||
|
||||
target_link_libraries(${PROJECT} "libopenrct2"
|
||||
${SDL2_LIBRARIES}
|
||||
${SDL2_TTF_LIBRARIES})
|
||||
${SDL2_TTF_LIBRARIES}
|
||||
${SPEEX_LIBRARIES})
|
||||
|
||||
if (APPLE)
|
||||
target_link_libraries(${PROJECT} "-framework Cocoa")
|
||||
endif ()
|
||||
|
||||
if (NOT DISABLE_OPENGL)
|
||||
if (WIN32)
|
||||
@@ -57,7 +63,8 @@ endif ()
|
||||
|
||||
# Includes
|
||||
target_include_directories(${PROJECT} PRIVATE "${CMAKE_CURRENT_LIST_DIR}/.."
|
||||
${SDL2_INCLUDE_DIRS})
|
||||
${SDL2_INCLUDE_DIRS}
|
||||
${SPEEX_INCLUDE_DIRS})
|
||||
|
||||
# Compiler flags
|
||||
if (FORCE32)
|
||||
|
||||
Reference in New Issue
Block a user