]> git.lizzy.rs Git - minetest.git/blobdiff - CMakeLists.txt
Attempt to fix build for MSVC
[minetest.git] / CMakeLists.txt
index b1803bc9e8bf718c16c975566b3febc616de74df..1eb5c2f1312952d2d8d6883298334b9b49acf882 100644 (file)
@@ -7,11 +7,14 @@ endif(${CMAKE_VERSION} STREQUAL "2.8.2")
 # This can be read from ${PROJECT_NAME} after project() is called
 project(minetest)
 
+# Also remember to set PROTOCOL_VERSION in clientserver.h when releasing
 set(VERSION_MAJOR 0)
-set(VERSION_MINOR 2)
-set(VERSION_PATCH 20110424_1_dev)
+set(VERSION_MINOR 4)
+set(VERSION_PATCH dev-20120311)
 set(VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
 
+MESSAGE(STATUS "*** Will build version ${VERSION_STRING} ***")
+
 # Configuration options
 
 if(WIN32)
@@ -21,7 +24,11 @@ else()
 endif()
 
 set(BUILD_CLIENT 1 CACHE BOOL "Build client")
-set(BUILD_SERVER 1 CACHE BOOL "Build server")
+if(WIN32)
+       set(BUILD_SERVER 0 CACHE BOOL "Build server")
+else()
+       set(BUILD_SERVER 1 CACHE BOOL "Build server")
+endif()
 
 set(WARN_ALL 1 CACHE BOOL "Enable -Wall for Release build")
 
@@ -42,25 +49,44 @@ find_package(Irrlicht)
 #
 
 if(WIN32)
-       set(DATADIR "data")
+       set(SHAREDIR "share")
        set(BINDIR "bin")
        set(DOCDIR "doc")
-       set(EXAMPLE_CONF_DIR ".")
+       set(EXAMPLE_CONF_DIR "user")
 elseif(APPLE)
        # random placeholders
-       set(DATADIR "share/minetest")
+       set(SHAREDIR "share/${PROJECT_NAME}")
        set(BINDIR "bin")
-       set(DOCDIR "share/doc/minetest")
-       set(EXAMPLE_CONF_DIR ".")
+       set(DOCDIR "share/doc/${PROJECT_NAME}")
+       set(EXAMPLE_CONF_DIR ${DOCDIR})
 elseif(UNIX) # Linux, BSD etc
-       set(DATADIR "share/minetest")
-       set(BINDIR "bin")
-       set(DOCDIR "share/doc/minetest")
-       set(EXAMPLE_CONF_DIR "share/doc/minetest")
+       if(RUN_IN_PLACE)
+               set(SHAREDIR "share")
+               set(BINDIR "bin")
+               set(DOCDIR "doc")
+               set(MANDIR "share/unix/man")
+               set(EXAMPLE_CONF_DIR ${DOCDIR})
+               set(XDG_APPS_DIR "share/unix/applications")
+               set(ICONDIR "share/unix/icons")
+       else()
+               set(SHAREDIR "share/${PROJECT_NAME}")
+               set(BINDIR "bin")
+               set(DOCDIR "share/doc/${PROJECT_NAME}")
+               set(MANDIR "share/man")
+               set(EXAMPLE_CONF_DIR ${DOCDIR})
+               set(XDG_APPS_DIR "share/applications")
+               set(ICONDIR "share/icons")
+       endif()
 endif()
 
-install(FILES "doc/README.txt" DESTINATION "${DOCDIR}")
-install(FILES "minetest.conf.example" DESTINATION "${DOCDIR}")
+install(FILES "README.txt" DESTINATION "${DOCDIR}")
+install(FILES "minetest.conf.example" DESTINATION "${EXAMPLE_CONF_DIR}")
+
+if(UNIX)
+       install(FILES "doc/minetest.6" "doc/minetestserver.6" DESTINATION "${MANDIR}/man6")
+       install(FILES "misc/minetest.desktop" DESTINATION "${XDG_APPS_DIR}")
+       install(FILES "minetest-icon.svg" DESTINATION "${ICONDIR}/hicolor/scalable/apps")
+endif()
 
 #
 # Subdirectories
@@ -103,7 +129,7 @@ elseif(APPLE)
        set(CPACK_BUNDLE_NAME ${PROJECT_NAME})
        set(CPACK_BUNDLE_ICON "")
        set(CPACK_BUNDLE_PLIST "")
-       set(CPACK_BUNDLE_STARTUP_COMMAND "Contents/MacOS/minetest")
+       set(CPACK_BUNDLE_STARTUP_COMMAND "Contents/MacOS/${PROJECT_NAME}")
        set(CPACK_GENERATOR "Bundle")
 else()
        set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${VERSION_STRING}-linux")