diff --git a/CMakeLists.txt b/CMakeLists.txt index d273937a31..214b971dd3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -101,6 +101,10 @@ if(OPTION_TOOLS_ONLY) return() endif() +if(ANDROID) +include(AndroidSDL) +endif() + # Prefer -pthread over -lpthread, which is often the better option of the two. set(CMAKE_THREAD_PREFER_PTHREAD YES) # Make sure we have Threads available. @@ -176,7 +180,13 @@ include_directories(${CMAKE_SOURCE_DIR}/src/3rdparty/squirrel/include) include(MSVCFilters) +if(ANDROID) +add_library(openttd SHARED ${GENERATED_SOURCE_FILES}) +target_link_libraries(openttd log z) +else() add_executable(openttd WIN32 ${GENERATED_SOURCE_FILES}) +endif() + set_target_properties(openttd PROPERTIES OUTPUT_NAME "${BINARY_NAME}") # All other files are added via target_sources() diff --git a/cmake/FindICU.cmake b/cmake/FindICU.cmake index b110dbf404..f681b63edd 100644 --- a/cmake/FindICU.cmake +++ b/cmake/FindICU.cmake @@ -38,11 +38,13 @@ foreach(MOD_NAME IN LISTS ICU_FIND_COMPONENTS) unset(PC_LIBRARIES) foreach(LIBRARY IN LISTS PC_ICU_${MOD_NAME}_LIBRARIES) unset(PC_LIBRARY CACHE) - find_library(PC_LIBRARY NAMES ${LIBRARY}) - if(NOT PC_LIBRARY) + if(NOT PC_ICU_${MOD_NAME}_LIBRARY) + find_library(PC_ICU_${MOD_NAME}_LIBRARY NAMES ${LIBRARY}) + endif() + if(NOT PC_ICU_${MOD_NAME}_LIBRARY) unset(PC_ICU_${MOD_NAME}_FOUND) endif() - list(APPEND PC_LIBRARIES ${PC_LIBRARY}) + list(APPEND PC_LIBRARIES ${PC_ICU_${MOD_NAME}_LIBRARY}) endforeach() unset(PC_LIBRARY CACHE) diff --git a/cmake/InstallAndPackage.cmake b/cmake/InstallAndPackage.cmake index b54c8131ac..c8345cf928 100644 --- a/cmake/InstallAndPackage.cmake +++ b/cmake/InstallAndPackage.cmake @@ -21,6 +21,7 @@ install(TARGETS openttd RUNTIME DESTINATION ${BINARY_DESTINATION_DIR} COMPONENT Runtime + LIBRARY DESTINATION ${BINARY_DESTINATION_DIR} ) install(DIRECTORY