aboutsummaryrefslogtreecommitdiff
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2021-04-11 17:10:06 +0200
committerGitHub <noreply@github.com>2021-04-11 17:10:06 +0200
commit4d0fef8ae87aa7b940d43485e7f6466eaa3d111e (patch)
tree24a270c7ff3071ab50b9a4e3e9f111695eaf0f9a /src/CMakeLists.txt
parent4b8209d9a44425156ba89a4763f63ea088daccb3 (diff)
downloadhax-minetest-server-4d0fef8ae87aa7b940d43485e7f6466eaa3d111e.tar.gz
hax-minetest-server-4d0fef8ae87aa7b940d43485e7f6466eaa3d111e.zip
Buildbot changes to allow out-of-tree builds (#11180)
* Do proper out-of-tree builds with buildbot * Don't write to bin/ for cross builds * This allows safely building multiple builds from the same source dir, e.g. with the buildbot. * Disable Gettext (by default) and Freetype (entirely) for server builds
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 4bb6877d9..26441063f 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -55,7 +55,7 @@ if(NOT USE_CURL)
endif()
-option(ENABLE_GETTEXT "Use GetText for internationalization" TRUE)
+option(ENABLE_GETTEXT "Use GetText for internationalization" ${BUILD_CLIENT})
set(USE_GETTEXT FALSE)
if(ENABLE_GETTEXT)
@@ -120,13 +120,13 @@ endif()
option(ENABLE_FREETYPE "Enable FreeType2 (TrueType fonts and basic unicode support)" TRUE)
set(USE_FREETYPE FALSE)
-if(ENABLE_FREETYPE)
+if(BUILD_CLIENT AND ENABLE_FREETYPE)
find_package(Freetype)
if(FREETYPE_FOUND)
message(STATUS "Freetype enabled.")
set(USE_FREETYPE TRUE)
endif()
-endif(ENABLE_FREETYPE)
+endif()
option(ENABLE_CURSES "Enable ncurses console" TRUE)
set(USE_CURSES FALSE)
@@ -526,8 +526,11 @@ if(USE_CURL)
endif()
-set(EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/bin")
-
+# When cross-compiling assume the user doesn't want to run the executable anyway,
+# otherwise place it in <source dir>/bin/ since Minetest can only run from there.
+if(NOT CMAKE_CROSSCOMPILING)
+ set(EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/bin")
+endif()
if(BUILD_CLIENT)
add_executable(${PROJECT_NAME} ${client_SRCS} ${extra_windows_SRCS})