diff --git a/CMakeLists.txt b/CMakeLists.txt index 20578cba0b..9de33187f9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -243,7 +243,9 @@ set_target_properties(openttd PROPERTIES OUTPUT_NAME "${BINARY_NAME}") set(host_tools_list strgen settingsgen) -if(CMAKE_CROSSCOMPILING) +if(HOST_BINARY_DIR) + # Host tools already exist, nothing to do +elseif(CMAKE_CROSSCOMPILING) # Pawn off the creation of the host utilities into its own dedicated space file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/host_tools) file(TO_NATIVE_PATH ${CMAKE_COMMAND} native_cmake_command) @@ -280,7 +282,7 @@ add_subdirectory(${CMAKE_SOURCE_DIR}/src) add_subdirectory(${CMAKE_SOURCE_DIR}/media/baseset) add_subdirectory(${CMAKE_SOURCE_DIR}/bin) -if(NOT CMAKE_CROSSCOMPILING) +if(NOT CMAKE_CROSSCOMPILING AND NOT HOST_BINARY_DIR) foreach(tgt IN ITEMS ${host_tools_list}) add_executable(host${tgt} ALIAS ${tgt}) endforeach() diff --git a/src/lang/CMakeLists.txt b/src/lang/CMakeLists.txt index 3041ef27d2..db63c003e2 100644 --- a/src/lang/CMakeLists.txt +++ b/src/lang/CMakeLists.txt @@ -65,6 +65,7 @@ set(LANG_BINARY_DIR ${CMAKE_BINARY_DIR}/lang) if (HOST_BINARY_DIR) include(${HOST_BINARY_DIR}/strgen.cmake) + add_executable(hoststrgen ALIAS strgen) endif() # Walk over all the (finished) language files, and generate a command to compile them diff --git a/src/table/CMakeLists.txt b/src/table/CMakeLists.txt index d2e1e50fa7..fc87a97f77 100644 --- a/src/table/CMakeLists.txt +++ b/src/table/CMakeLists.txt @@ -13,6 +13,7 @@ set(TABLE_INI_SOURCE_FILES if (HOST_BINARY_DIR) include(${HOST_BINARY_DIR}/settingsgen.cmake) + add_executable(hostsettingsgen ALIAS settingsgen) endif() # Generate a command and target to create the settings table