summaryrefslogtreecommitdiff
path: root/src/settingsgen
diff options
context:
space:
mode:
authorglx22 <glx@openttd.org>2020-07-01 02:52:32 +0200
committerOwen Rudge <owen@owenrudge.net>2020-12-04 09:49:31 +0000
commita06fe8e8a7d749f1fbd08102a9516acd51171b24 (patch)
tree97b90a5a5229c8c1fae0729cf8ccba18d08243f5 /src/settingsgen
parent0b2dd2c5cd39833945fcea3a39811898bf40c6b5 (diff)
downloadopenttd-a06fe8e8a7d749f1fbd08102a9516acd51171b24.tar.xz
Fix: [CMake] cross-compiling requires native tools
Diffstat (limited to 'src/settingsgen')
-rw-r--r--src/settingsgen/CMakeLists.txt25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/settingsgen/CMakeLists.txt b/src/settingsgen/CMakeLists.txt
index e17b8ad6b..69b209201 100644
--- a/src/settingsgen/CMakeLists.txt
+++ b/src/settingsgen/CMakeLists.txt
@@ -1,13 +1,18 @@
cmake_minimum_required(VERSION 3.5)
-project(settingsgen)
+if (NOT HOST_BINARY_DIR)
+ project(settingsgen)
-set(sourcefiles
- settingsgen.cpp
- ../core/alloc_func.cpp
- ../misc/getoptdata.cpp
- ../ini_load.cpp
- ../string.cpp
-)
-add_definitions(-DSETTINGSGEN)
-add_executable(settingsgen ${sourcefiles})
+ set(sourcefiles
+ settingsgen.cpp
+ ../core/alloc_func.cpp
+ ../misc/getoptdata.cpp
+ ../ini_load.cpp
+ ../string.cpp
+ )
+ add_definitions(-DSETTINGSGEN)
+ add_executable(settingsgen ${sourcefiles})
+
+ export(TARGETS settingsgen FILE ${CMAKE_BINARY_DIR}/settingsgen.cmake)
+ add_dependencies(tools settingsgen)
+endif()