summaryrefslogtreecommitdiff
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-02-19 08:14:16 +0000
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-02-19 08:14:16 +0000
commiteab47c4f2674516d9499e837eff5b6b40f48213d (patch)
tree5d0e59267ca89acef8a491917a3af5ac5afad08f /src/CMakeLists.txt
parent278d9aa7eb084bd6f93e6ac1fd84033dc316ab5e (diff)
downloadmana-eab47c4f2674516d9499e837eff5b6b40f48213d.tar.gz
mana-eab47c4f2674516d9499e837eff5b6b40f48213d.tar.bz2
mana-eab47c4f2674516d9499e837eff5b6b40f48213d.tar.xz
mana-eab47c4f2674516d9499e837eff5b6b40f48213d.zip
Fixed compile on macOS
Since Guichan is currently disabled on Homebrew, I've opted for adding it as a submodule instead. It currently references the 0.8 branch of Guichan, after I cherry-picked the CMake support from the master branch. When using SDL2 installed through Homebrew, it was necessary to use SDL2_LINK_LIBRARIES, since the libraries occupy various different directories. It no longer seems necessary to include an SDLMain.m, so I deleted it. Removed obsolete OS X instructions. Also added instructions for installing dependencies on Fedora. Removed mentioning of /announce and /who in the README, since they were removed for tmwAthena.
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt26
1 files changed, 15 insertions, 11 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 227302c1..628fab82 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -23,6 +23,12 @@ IF (ENABLE_MANASERV)
SET(INTERNAL_LIBRARIES enet)
ENDIF()
+IF (APPLE)
+ INCLUDE_DIRECTORIES("../libs/guichan/include")
+ LINK_DIRECTORIES("../libs/guichan")
+ SET(INTERNAL_LIBRARIES ${INTERNAL_LIBRARIES} guichan)
+ENDIF()
+
SET(FLAGS "-DPACKAGE_VERSION=\\\"${VERSION}\\\"")
SET(FLAGS "${FLAGS} -DPKG_DATADIR=\\\"${PKG_DATADIR}/\\\"")
SET(FLAGS "${FLAGS} -DLOCALEDIR=\\\"${LOCALEDIR}/\\\"")
@@ -56,7 +62,9 @@ ELSEIF (CMAKE_SYSTEM_NAME STREQUAL SunOS)
SET(EXTRA_LIBRARIES intl)
ENDIF()
-FIND_PACKAGE(Guichan REQUIRED)
+IF(NOT APPLE)
+ FIND_PACKAGE(Guichan REQUIRED)
+ENDIF()
IF (WITH_OPENGL)
FIND_PACKAGE(OpenGL REQUIRED)
@@ -620,14 +628,6 @@ IF (WIN32)
)
ENDIF (WIN32)
-IF (APPLE)
- SET(SRCS
- ${SRCS}
- SDLMain.h
- SDLMain.m
- )
-ENDIF (APPLE)
-
SET (PROGRAMS mana)
IF (ENABLE_MANASERV)
@@ -636,9 +636,9 @@ ELSE(ENABLE_MANASERV)
ADD_EXECUTABLE(mana WIN32 ${SRCS} ${SRCS_TMWA})
ENDIF(ENABLE_MANASERV)
-TARGET_LINK_LIBRARIES(mana
+TARGET_LINK_LIBRARIES(mana PRIVATE
${INTERNAL_LIBRARIES}
- ${SDL2_LIBRARIES}
+ ${SDL2_LINK_LIBRARIES}
${PNG_LIBRARIES}
${PHYSFS_LIBRARY}
${CURL_LIBRARIES}
@@ -648,6 +648,10 @@ TARGET_LINK_LIBRARIES(mana
${LIBINTL_LIBRARIES}
${EXTRA_LIBRARIES})
+if(APPLE)
+ target_link_libraries(mana PRIVATE "-framework Foundation")
+endif()
+
INSTALL(TARGETS mana RUNTIME DESTINATION ${PKG_BINDIR})
IF (CMAKE_SYSTEM_NAME STREQUAL SunOS)