Ver Fonte

Add 'install' option for cross-compiling build and IOS as well.

Note: there is a known bug in CMake/Xcode generator that prevents iOS targets (library and bundle) to be installed correctly (see http://public.kitware.com/Bug/bug_relationship_graph.php?bug_id=12506&graph=dependency).
Yao Wei Tjong 姚伟忠 há 12 anos atrás
pai
commit
e8fbcf8a82

+ 10 - 8
Source/CMake/Modules/FindUrho3D.cmake

@@ -49,13 +49,12 @@ if (WIN32)
 endif ()
 
 if (CMAKE_PROJECT_NAME MATCHES Urho3D.* AND PROJECT_ROOT_DIR)
-    set (URHO3D_HOME ${PROJECT_ROOT_DIR})
+    set (URHO3D_HOME ${PROJECT_ROOT_DIR} CACHE PATH "Path to Urho3D project root tree" FORCE)
 else ()
-    set (URHO3D_HOME $ENV{URHO3D_HOME})
+    file (TO_CMAKE_PATH "$ENV{URHO3D_HOME}" URHO3D_HOME)
+    set (URHO3D_HOME ${URHO3D_HOME} CACHE PATH "Path to Urho3D project root tree")
 endif ()
 if (URHO3D_HOME)
-    file (TO_CMAKE_PATH ${URHO3D_HOME} URHO3D_HOME)
-    
     # Construct source tree paths from URHO3D_HOME environment variable
     find_file (SOURCE_TREE_PATH Urho3D.h.in ${URHO3D_HOME}/Source/Engine NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
     if (SOURCE_TREE_PATH)
@@ -89,11 +88,14 @@ else ()
     # If Urho3D SDK is not being installed in the default system location, use the URHO3D_INSTALL_PREFIX environment variable to specify the prefix path to that location
     # Note that the prefix path should not contain the "/include" or "/lib"
     # For example on Linux platform: URHO3D_INSTALL_PREFIX=/home/john/usr/local if the SDK is installed using DESTDIR=/home/john and CMAKE_INSTALL_PREFIX=/usr/local (default)
-    set (CMAKE_PREFIX_PATH $ENV{URHO3D_INSTALL_PREFIX})
+    set (CMAKE_PREFIX_PATH $ENV{URHO3D_INSTALL_PREFIX} CACHE PATH "Prefix path to Urho3D SDK installation")
     if (WIN32)
         set (URHO3D_INC_SEARCH_PATH "${CMAKE_INSTALL_PREFIX}/Urho3D SDK/Include")
         set (URHO3D_LIB_SEARCH_PATH "${CMAKE_INSTALL_PREFIX}/Urho3D SDK/Lib")
     else ()
+        if (IOS)
+            set (CMAKE_LIBRARY_ARCHITECTURE ios)
+        endif ()
         set (URHO3D_INC_SEARCH_PATH /opt/include)
         set (URHO3D_LIB_SEARCH_PATH /opt/lib)
     endif ()
@@ -102,7 +104,7 @@ else ()
 
     if (URHO3D_INCLUDE_DIR)
         set (BASE_DIR ${URHO3D_INCLUDE_DIR})
-        foreach (DIR Bullet kNet)
+        foreach (DIR Bullet kNet SDL)
             list (APPEND URHO3D_INCLUDE_DIR ${BASE_DIR}/${DIR})     # Note: variable change to list context after this, so we need BASE_DIR to remain the same
         endforeach ()
     endif ()
@@ -122,8 +124,8 @@ else ()
     if (Urho3D_FIND_REQUIRED)
         message (FATAL_ERROR
             "Could not find Urho3D library in default SDK installation location or Urho3D project root tree. "
-            "For detecting a non-default Urho3D SDK installation, use 'URHO3D_INSTALL_PREFIX' environment variable to specify the prefix path of the installation location. "
-            "For detecting Urhor3D library in a build tree of Urho3D source installation, use 'URHO3D_HOME' environment variable to specify the Urho3D project root directory. The Urho3D library itself must already be built successfully.")
+            "For searching in a non-default Urho3D SDK installation, use 'URHO3D_INSTALL_PREFIX' environment variable to specify the prefix path of the installation location. "
+            "For searching in a build tree of Urho3D source installation, use 'URHO3D_HOME' environment variable to specify the Urho3D project root directory. The Urho3D library itself must already be built successfully.")
     endif ()
 endif ()
 

+ 33 - 17
Source/CMake/Modules/Urho3D-CMake-magic.cmake

@@ -147,11 +147,13 @@ if (MSVC)
     set (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /OPT:REF /OPT:ICF /DEBUG")
     set (CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /OPT:REF /OPT:ICF")
 else ()
-    # GCC-specific setup
+    # GCC/Clang-specific setup
     if (ANDROID)
+        # Most of the flags are already setup in android.toolchain.cmake module
         set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector")
         set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-invalid-offsetof -fstack-protector")
         if (ENABLE_64BIT)
+            # TODO: Revisit this again when ARM also support 64bit
             # For now just reference it to suppress "unused variable" warning
         endif ()
     elseif (NOT IOS)
@@ -371,9 +373,7 @@ macro (setup_executable)
     elseif (RASPI AND SCP_TO_TARGET)
         add_custom_command (TARGET ${TARGET_NAME} POST_BUILD COMMAND scp $<TARGET_FILE:${TARGET_NAME}> ${SCP_TO_TARGET} || exit 0)
     endif ()
-    if (DEST_RUNTIME_DIR)
-        install (TARGETS ${TARGET_NAME} RUNTIME DESTINATION ${DEST_RUNTIME_DIR})
-    endif ()
+    install (TARGETS ${TARGET_NAME} RUNTIME DESTINATION ${DEST_RUNTIME_DIR} BUNDLE DESTINATION ${DEST_RUNTIME_DIR})
 endmacro ()
 
 # Macro for setting up linker flags for Mac OS X desktop build
@@ -397,6 +397,33 @@ macro (setup_ios_linker_flags LINKER_FLAGS)
     set (${LINKER_FLAGS} "-framework AudioToolbox -framework CoreAudio -framework CoreGraphics -framework Foundation -framework OpenGLES -framework QuartzCore -framework UIKit")
 endmacro ()
 
+# Macro for adding SDL native init function on Android platform
+macro (add_android_native_init)
+    # This source file could not be added when building SDL static library because it needs SDL_Main() which is not yet available at library building time
+    # The SDL_Main() is defined by Android application that could be resided in other CMake projects outside of Urho3D CMake project which makes things a little bit complicated
+    if (CMAKE_PROJECT_NAME MATCHES Urho3D.*)
+        list (APPEND SOURCE_FILES ${PROJECT_ROOT_DIR}/Source/ThirdParty/SDL/src/main/android/SDL_android_main.c)
+        # Rename target name to avoid name clash with Urho3D game engine shared library
+        if (TARGET_NAME STREQUAL Urho3D AND URHO3D_LIB_TYPE STREQUAL SHARED)
+            set (TARGET_NAME Urho3Dapp)
+        endif ()
+    elseif (EXISTS $ENV{URHO3D_HOME}/Source/ThirdParty/SDL/src/main/android/SDL_android_main.c)
+        # Use Urho3D source installation
+        list (APPEND SOURCE_FILES $ENV{URHO3D_HOME}/Source/ThirdParty/SDL/src/main/android/SDL_android_main.c)
+    elseif (EXISTS $ENV{URHO3D_INSTALL_PREFIX}/share/Urho3D/templates/android/SDL_android_main.c)
+        # Use Urho3D SDK installation on non-default installation location
+        list (APPEND SOURCE_FILES $ENV{URHO3D_INSTALL_PREFIX}/share/Urho3D/templates/android/SDL_android_main.c)
+    elseif (EXISTS ${CMAKE_INSTALL_PREFIX}/share/Urho3D/templates/android/SDL_android_main.c)
+        # Use Urho3D SDK installation on system default installation location
+        list (APPEND SOURCE_FILES ${CMAKE_INSTALL_PREFIX}/share/Urho3D/templates/android/SDL_android_main.c)
+    else ()
+        message (FATAL_ERROR
+            "Could not find SDL_android_main.c source file in default SDK installation location or Urho3D project root tree. "
+            "For searching in a non-default Urho3D SDK installation, use 'URHO3D_INSTALL_PREFIX' environment variable to specify the prefix path of the installation location. "
+            "For searching in a source tree of Urho3D source installation, use 'URHO3D_HOME' environment variable to specify the Urho3D project root directory.")
+    endif ()
+endmacro ()
+
 # Macro for setting up an executable target with resources to copy
 macro (setup_main_executable)
     # Define resource files
@@ -407,19 +434,8 @@ macro (setup_main_executable)
     endif ()
 
     if (ANDROID)
-        # Add SDL native init function
-        if (CMAKE_PROJECT_NAME MATCHES Urho3D.*)
-            set (URHO3D_HOME ${PROJECT_ROOT_DIR})
-            # Rename target name to avoid name clash with Urho3D game engine shared library
-            if (TARGET_NAME STREQUAL Urho3D AND URHO3D_LIB_TYPE STREQUAL SHARED)
-                set (TARGET_NAME Urho3Dapp)
-            endif ()
-        elseif (EXISTS $ENV{URHO3D_HOME}/Source/ThirdParty/SDL/src/main/android/SDL_android_main.c)
-            set (URHO3D_HOME $ENV{URHO3D_HOME})
-        else ()
-            message (FATAL_ERROR "Could not find URHO3D_HOME environment variable or it is not point to a Urho3D project root tree")
-        endif ()
-        list (APPEND SOURCE_FILES ${URHO3D_HOME}/Source/ThirdParty/SDL/src/main/android/SDL_android_main.c)
+        # Add SDL native init function, SDL_Main() entry point must be defined by one of the source files in ${SOURCE_FILES} 
+        add_android_native_init ()
         # Setup shared library output path
         set_output_directories (${ANDROID_LIBRARY_OUTPUT_PATH} LIBRARY)
         # Setup target as main shared library

+ 31 - 13
Source/CMake/Toolchains/raspberrypi.toolchain.cmake

@@ -32,22 +32,40 @@ set (CMAKE_SYSTEM_NAME Linux)
 set (CMAKE_SYSTEM_VERSION 1)
 
 # specify the cross compiler
-set (RASPI_TOOL $ENV{RASPI_TOOL})
-set (CMAKE_C_COMPILER   "${RASPI_TOOL}/arm-linux-gnueabihf-gcc"     CACHE PATH "C compiler")
-set (CMAKE_CXX_COMPILER "${RASPI_TOOL}/arm-linux-gnueabihf-c++"     CACHE PATH "C++ compiler")
-set (CMAKE_ASM_COMPILER "${RASPI_TOOL}/arm-linux-gnueabihf-gcc"     CACHE PATH "assembler")
-set (CMAKE_STRIP        "${RASPI_TOOL}/arm-linux-gnueabihf-strip"   CACHE PATH "strip")
-set (CMAKE_AR           "${RASPI_TOOL}/arm-linux-gnueabihf-ar"      CACHE PATH "archive")
-set (CMAKE_LINKER       "${RASPI_TOOL}/arm-linux-gnueabihf-ld"      CACHE PATH "linker")
-set (CMAKE_NM           "${RASPI_TOOL}/arm-linux-gnueabihf-nm"      CACHE PATH "nm")
-set (CMAKE_OBJCOPY      "${RASPI_TOOL}/arm-linux-gnueabihf-objcopy" CACHE PATH "objcopy")
-set (CMAKE_OBJDUMP      "${RASPI_TOOL}/arm-linux-gnueabihf-objdump" CACHE PATH "objdump")
-set (CMAKE_RANLIB       "${RASPI_TOOL}/arm-linux-gnueabihf-ranlib"  CACHE PATH "ranlib")
+file (TO_CMAKE_PATH "$ENV{RASPI_TOOL}" RASPI_TOOL)
+set (CMAKE_C_COMPILER   ${RASPI_TOOL}/arm-linux-gnueabihf-gcc     CACHE PATH "C compiler")
+set (CMAKE_CXX_COMPILER ${RASPI_TOOL}/arm-linux-gnueabihf-c++     CACHE PATH "C++ compiler")
+set (CMAKE_ASM_COMPILER ${RASPI_TOOL}/arm-linux-gnueabihf-gcc     CACHE PATH "assembler")
+set (CMAKE_STRIP        ${RASPI_TOOL}/arm-linux-gnueabihf-strip   CACHE PATH "strip")
+set (CMAKE_AR           ${RASPI_TOOL}/arm-linux-gnueabihf-ar      CACHE PATH "archive")
+set (CMAKE_LINKER       ${RASPI_TOOL}/arm-linux-gnueabihf-ld      CACHE PATH "linker")
+set (CMAKE_NM           ${RASPI_TOOL}/arm-linux-gnueabihf-nm      CACHE PATH "nm")
+set (CMAKE_OBJCOPY      ${RASPI_TOOL}/arm-linux-gnueabihf-objcopy CACHE PATH "objcopy")
+set (CMAKE_OBJDUMP      ${RASPI_TOOL}/arm-linux-gnueabihf-objdump CACHE PATH "objdump")
+set (CMAKE_RANLIB       ${RASPI_TOOL}/arm-linux-gnueabihf-ranlib  CACHE PATH "ranlib")
+if (NOT CMAKE_CXX_COMPILER)
+    message (FATAL_ERROR "Could not find Raspberry Pi cross compilation tool. "
+        "Use RASPI_TOOL environment variable to specify the location of the toolchain. "
+        "Use RASPI_ROOT environment variable to specify the location of system root.")
+endif ()
 
-# where is the target environment 
-set (CMAKE_FIND_ROOT_PATH "${RASPI_TOOL}/../arm-linux-gnueabihf/libc" $ENV{RASPI_ROOT})
+# specify the system root
+if (NOT BCM_VC_INCLUDE_DIR)
+    # Keep invalidating the cache until we found the BCM library and its include directory which hopefully also mean we have found the correct SYSROOT
+    unset (RASPI_SYSROOT CACHE)
+    unset (CMAKE_INSTALL_PREFIX CACHE)
+endif ()
+file (TO_CMAKE_PATH "$ENV{RASPI_ROOT}" RASPI_ROOT)
+if (NOT RASPI_ROOT)
+    set (RASPI_ROOT ${RASPI_TOOL}/../arm-linux-gnueabihf/libc)
+endif ()
+set (RASPI_SYSROOT ${RASPI_ROOT} CACHE PATH "Path to Raspberry Pi SYSROOT")
+set (CMAKE_FIND_ROOT_PATH ${RASPI_SYSROOT})
 
 # only search programs, libraries, and headers in the target directories
 set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY)
 set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
 set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+
+# setup install destination prefix path
+set (CMAKE_INSTALL_PREFIX "${RASPI_SYSROOT}/usr/local" CACHE PATH "Install path prefix, prepended onto install directories.")

+ 21 - 21
Source/CMakeLists.txt

@@ -71,30 +71,30 @@ if (URHO3D_LIB_TYPE STREQUAL SHARED)
     set (CMAKE_POSITION_INDEPENDENT_CODE true)
 endif ()
 
-# Setup install destinations for native build only (Win, Mac, Linux, and Raspberry Pi)
-if (NOT CMAKE_CROSSCOMPILING AND NOT IOS)
-    if (WIN32)
-        set (DEST_INCLUDE_DIR "Urho3D SDK/Include")
-        set (DEST_RUNTIME_DIR "Urho3D SDK/Bin")
-        set (DEST_LIBRARY_DIR "Urho3D SDK/Lib")
-        set (DEST_ARCHIVE_DIR "Urho3D SDK/Lib")
-        set (SCRIPT_PATTERN *.bat)
-    else ()
-        set (DEST_INCLUDE_DIR include/Urho3D)
-        set (DEST_RUNTIME_DIR share/Urho3D)
-        if (ENABLE_64BIT)
-            if (EXISTS /usr/lib64)
-                # Probably target system is a RedHat-based distro
-                set (LIB_BITS_SUFFIX 64)
-            endif ()
+# Setup install destinations
+if (WIN32)
+    set (DEST_INCLUDE_DIR "Urho3D SDK/Include")
+    set (DEST_RUNTIME_DIR "Urho3D SDK/Bin")
+    set (DEST_LIBRARY_DIR "Urho3D SDK/Lib")
+    set (DEST_ARCHIVE_DIR "Urho3D SDK/Lib")
+    set (SCRIPT_PATTERN *.bat)
+else ()
+    set (DEST_INCLUDE_DIR include/Urho3D)
+    set (DEST_RUNTIME_DIR share/Urho3D)
+    if (ENABLE_64BIT)
+        if (NOT CMAKE_CROSSCOMPILING AND EXISTS /usr/lib64)    # TODO: Revisit this again when ARM also supports 64bit, for now ARM architecture ignores ENABLE_64BIT build option
+            set (LIB_SUFFIX 64)
         endif ()
-        set (DEST_LIBRARY_DIR lib${LIB_BITS_SUFFIX}/Urho3D)
-        set (DEST_ARCHIVE_DIR lib${LIB_BITS_SUFFIX}/Urho3D)
-        set (SCRIPT_PATTERN *.sh)
     endif ()
-    install (DIRECTORY ${PROJECT_ROOT_DIR}/Bin/ DESTINATION ${DEST_RUNTIME_DIR} USE_SOURCE_PERMISSIONS FILES_MATCHING PATTERN ${SCRIPT_PATTERN})    # Note: the trailing slash is significant
-    install (DIRECTORY ${PROJECT_ROOT_DIR}/Bin/CoreData ${PROJECT_ROOT_DIR}/Bin/Data DESTINATION ${DEST_RUNTIME_DIR} USE_SOURCE_PERMISSIONS)
+    if (IOS)
+        set (LIB_SUFFIX ${LIB_SUFFIX}/ios)
+    endif ()
+    set (DEST_LIBRARY_DIR lib${LIB_SUFFIX}/Urho3D)
+    set (DEST_ARCHIVE_DIR lib${LIB_SUFFIX}/Urho3D)
+    set (SCRIPT_PATTERN *.sh)
 endif ()
+install (DIRECTORY ${PROJECT_ROOT_DIR}/Bin/ DESTINATION ${DEST_RUNTIME_DIR} USE_SOURCE_PERMISSIONS FILES_MATCHING PATTERN ${SCRIPT_PATTERN})    # Note: the trailing slash is significant
+install (DIRECTORY ${PROJECT_ROOT_DIR}/Bin/CoreData ${PROJECT_ROOT_DIR}/Bin/Data DESTINATION ${DEST_RUNTIME_DIR} USE_SOURCE_PERMISSIONS)
 
 # Add targets
 foreach (TARGET AngelScript Bullet Civetweb Detour FreeType JO kNet LZ4 PugiXml Recast SDL StanHull STB)

+ 4 - 12
Source/Engine/CMakeLists.txt

@@ -103,18 +103,14 @@ endforeach ()
 # Define source files
 foreach (SOURCE Audio Container Core Engine Graphics Input IO Math Navigation Network Physics Resource Scene Script UI)
     add_subdirectory (${SOURCE})
-    if (DEST_INCLUDE_DIR)
-        install (DIRECTORY ${SOURCE}/ DESTINATION ${DEST_INCLUDE_DIR} USE_SOURCE_PERMISSIONS FILES_MATCHING PATTERN *.h)    # Note: the trailing slash is significant
-    endif ()
+    install (DIRECTORY ${SOURCE}/ DESTINATION ${DEST_INCLUDE_DIR} USE_SOURCE_PERMISSIONS FILES_MATCHING PATTERN *.h)    # Note: the trailing slash is significant
     source_group ("Source Files\\${SOURCE}" FILES ${${SOURCE}_CPP_FILES})
     source_group ("Header Files\\${SOURCE}" FILES ${${SOURCE}_H_FILES})
     list (APPEND ENGINE_SOURCE_FILES ${${SOURCE}_CPP_FILES} ${${SOURCE}_H_FILES})
     list (APPEND ENGINE_INCLUDE_DIRS_ONLY ${SOURCE})
 endforeach ()
 define_source_files (EXTRA_CPP_FILES ${ENGINE_SOURCE_FILES} EXTRA_H_FILES ${CMAKE_CURRENT_BINARY_DIR}/gitversion.h PCH)
-if (DEST_INCLUDE_DIR)
-    install (FILES ${H_FILES} DESTINATION ${DEST_INCLUDE_DIR})
-endif ()
+install (FILES ${H_FILES} DESTINATION ${DEST_INCLUDE_DIR})
 list (APPEND SOURCE_FILES ${ALL_OBJ_FILES})
 set_source_files_properties (${ALL_OBJ_FILES} PROPERTIES GENERATED TRUE)
 
@@ -135,9 +131,7 @@ set_output_directories (${OUTPUT_PATH} ARCHIVE LIBRARY)
 # Setup target
 setup_library (${URHO3D_LIB_TYPE})
 adjust_library_name ()
-if (DEST_RUNTIME_DIR AND DEST_LIBRARY_DIR AND DEST_ARCHIVE_DIR)
-    install (TARGETS ${TARGET_NAME} RUNTIME DESTINATION ${DEST_RUNTIME_DIR} LIBRARY DESTINATION ${DEST_LIBRARY_DIR} ARCHIVE DESTINATION ${DEST_ARCHIVE_DIR})
-endif ()
+install (TARGETS ${TARGET_NAME} RUNTIME DESTINATION ${DEST_RUNTIME_DIR} LIBRARY DESTINATION ${DEST_LIBRARY_DIR} ARCHIVE DESTINATION ${DEST_ARCHIVE_DIR})
 if (NOT GIT_EXIT_CODE EQUAL 0)
     add_dependencies (${TARGET_NAME} ${STATIC_LIBRARY_TARGETS})
 endif ()
@@ -162,9 +156,7 @@ if (NOT URHO3D_LIB_TYPE STREQUAL URHO3D_EXPORTS_LIB_TYPE OR ${CMAKE_CURRENT_SOUR
     file (READ ${CMAKE_CURRENT_BINARY_DIR}/Urho3D.h EXPORT_DEFINE)
     configure_file (${CMAKE_CURRENT_SOURCE_DIR}/Urho3D.h.in ${CMAKE_CURRENT_BINARY_DIR}/Urho3D.h)
 endif ()
-if (DEST_INCLUDE_DIR)
-    install (FILES ${CMAKE_CURRENT_BINARY_DIR}/Urho3D.h DESTINATION ${DEST_INCLUDE_DIR})
-endif ()
+install (FILES ${CMAKE_CURRENT_BINARY_DIR}/Urho3D.h DESTINATION ${DEST_INCLUDE_DIR})
 
 # Define post build steps
 # Strip the output shared library for embedded devices

+ 1 - 3
Source/Engine/LuaScript/CMakeLists.txt

@@ -57,9 +57,7 @@ endforeach ()
 
 # Define source files
 define_source_files (EXTRA_CPP_FILES ${GEN_CPP_FILES})
-if (DEST_INCLUDE_DIR)
-    install (FILES ${H_FILES} DESTINATION ${DEST_INCLUDE_DIR})
-endif ()
+install (FILES ${H_FILES} DESTINATION ${DEST_INCLUDE_DIR})
 
 # Define dependency libs
 set (LIBS ../../ThirdParty/Lua${JIT}/src)

+ 2 - 4
Source/ThirdParty/Bullet/CMakeLists.txt

@@ -15,10 +15,8 @@ file (GLOB H_FILES *.h src/BulletCollision/BroadphaseCollision/*.h
     src/BulletDynamics/Dynamics/*.h src/BulletDynamics/Vehicle/*.h src/BulletSoftBody/*.h 
     src/LinearMath/*.h)
 set (SOURCE_FILES ${CPP_FILES} ${H_FILES})
-if (DEST_INCLUDE_DIR)
-    # Dependency from Engine/PhysicsWorld.h and Engine/RigidBody.h
-    install (DIRECTORY src/LinearMath DESTINATION ${DEST_INCLUDE_DIR}/Bullet USE_SOURCE_PERMISSIONS FILES_MATCHING PATTERN *.h)
-endif ()
+# Install dependency for Engine/Physics/PhysicsWorld.h and Engine/Physics/RigidBody.h
+install (DIRECTORY src/LinearMath DESTINATION ${DEST_INCLUDE_DIR}/Bullet USE_SOURCE_PERMISSIONS FILES_MATCHING PATTERN *.h)
 
 # Define dependency libs
 set (INCLUDE_DIRS_ONLY src)

+ 5 - 0
Source/ThirdParty/SDL/CMakeLists.txt

@@ -105,6 +105,11 @@ file (GLOB H_FILES include/*.h)
 set_source_files_properties (${C_FILES} PROPERTIES LANGUAGE C)
 set_source_files_properties (${SYS_C_FILES} PROPERTIES LANGUAGE C)
 set (SOURCE_FILES ${C_FILES} ${SYS_C_FILES} ${H_FILES})
+if (ANDROID)
+    # Dependency from SDL_android_main.c
+    install (DIRECTORY include/ DESTINATION ${DEST_INCLUDE_DIR}/SDL USE_SOURCE_PERMISSIONS FILES_MATCHING PATTERN *.h)     # Note: the trailing slash is significant
+    install (FILES src/main/android/SDL_android_main.c DESTINATION ${DEST_RUNTIME_DIR}/templates/android)
+endif ()
 
 # Setup target
 setup_library ()

+ 2 - 4
Source/ThirdParty/kNet/CMakeLists.txt

@@ -58,10 +58,8 @@ endif ()
 
 # Define source files
 set (SOURCE_FILES ${kNetSourceFiles} ${kNetHeaderFiles})
-if (DEST_INCLUDE_DIR)
-    # Dependency from Engine/Connection.h and Engine/Network.h
-    install (DIRECTORY include/ DESTINATION ${DEST_INCLUDE_DIR}/kNet USE_SOURCE_PERMISSIONS FILES_MATCHING PATTERN *.h PATTERN *.inl)     # Note: the trailing slash is significant
-endif ()
+# Install dependency for Engine/Network/Connection.h and Engine/Network/Network.h
+install (DIRECTORY include/ DESTINATION ${DEST_INCLUDE_DIR}/kNet USE_SOURCE_PERMISSIONS FILES_MATCHING PATTERN *.h PATTERN *.inl)     # Note: the trailing slash is significant
 
 # Define dependency libs
 set (INCLUDE_DIRS_ONLY include)