1
0
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:
Richard Jenkins
2017-05-23 15:37:03 +01:00
committed by Gymnasiast
parent f998172674
commit 7a59eef47e
2 changed files with 10 additions and 2 deletions

View File

@@ -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")

View File

@@ -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)