diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 88c0c5a45..d772c10ad 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -591,9 +591,12 @@ if(USE_CURL) endif() -# When cross-compiling assume the user doesn't want to run the executable anyway, -# otherwise place it in /bin/ since Luanti can only run from there. -if(NOT CMAKE_CROSSCOMPILING) +# When cross-compiling place the executable in /bin so that multiple +# targets can be built from the same source folder. Otherwise, place it in +# /bin/ since Luanti can only run from there. +if(CMAKE_CROSSCOMPILING) + set(EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}/bin") +else() set(EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/bin") endif()