project_files/Android-build/CMakeLists.txt
changeset 9963 9e75dbffec81
parent 9374 60063430445b
child 10015 4feced261c68
equal deleted inserted replaced
9961:c18c66d621e5 9963:9e75dbffec81
    24 if(NOT ANDROID_NDK)
    24 if(NOT ANDROID_NDK)
    25     find_path(ANDROID_NDK ndk-build)
    25     find_path(ANDROID_NDK ndk-build)
    26 endif()
    26 endif()
    27 
    27 
    28 if(IS_DIRECTORY "${ANDROID_NDK}")
    28 if(IS_DIRECTORY "${ANDROID_NDK}")
    29     message(STATUS "Detected the android NDK directory at: " ${ANDROID_NDK}) 
    29     message(STATUS "Detected the android NDK directory at: " ${ANDROID_NDK})
    30 else ()
    30 else()
    31     message(FATAL_ERROR "Couldn't detect the Android NDK directory")
    31     message(FATAL_ERROR "Couldn't detect the Android NDK directory")
    32 endif()
    32 endif()
    33 
    33 
    34 if(NOT ANDROID_NDK_TOOLCHAINDIR)
    34 if(NOT ANDROID_NDK_TOOLCHAINDIR)
    35     set(toolchainbase "${ANDROID_NDK}/toolchains/arm-linux-androideabi-4.6/prebuilt")
    35     set(toolchainbase "${ANDROID_NDK}/toolchains/arm-linux-androideabi-4.6/prebuilt")
    37                 "${toolchainbase}/linux-x86"
    37                 "${toolchainbase}/linux-x86"
    38                 "${toolchainbase}/windows")
    38                 "${toolchainbase}/windows")
    39 endif()
    39 endif()
    40 
    40 
    41 if(IS_DIRECTORY "${ANDROID_NDK_TOOLCHAINDIR}")
    41 if(IS_DIRECTORY "${ANDROID_NDK_TOOLCHAINDIR}")
    42     message(STATUS "Detected the Android NDK toolchain at: ${ANDROID_NDK_TOOLCHAINDIR}") 
    42     message(STATUS "Detected the Android NDK toolchain at: ${ANDROID_NDK_TOOLCHAINDIR}")
    43 else ()
    43 else()
    44     message(FATAL_ERROR "Couldn't detect the Android NDK toolchain directory: ${ANDROID_NDK_TOOLCHAINDIR}")
    44     message(FATAL_ERROR "Couldn't detect the Android NDK toolchain directory: ${ANDROID_NDK_TOOLCHAINDIR}")
    45 endif()
    45 endif()
    46 
    46 
    47 if(NOT ANDROID_SDK)#Check if its defined at the cmdline
    47 if(NOT ANDROID_SDK) #Check if its defined at the cmdline
    48     find_program(ANDROID_SDK adb) #assume they've added platform-tools to their path
    48     find_program(ANDROID_SDK adb) #assume they've added platform-tools to their path
    49     get_filename_component(ANDROID_SDK "${ANDROID_SDK}" PATH)
    49     get_filename_component(ANDROID_SDK "${ANDROID_SDK}" PATH)
    50     get_filename_component(ANDROID_SDK "${ANDROID_SDK}" PATH)
    50     get_filename_component(ANDROID_SDK "${ANDROID_SDK}" PATH)
    51     set(ANDROID_SDK "${ANDROID_SDK}" CACHE PATH "Path to the android sdk" FORCE)
    51     set(ANDROID_SDK "${ANDROID_SDK}" CACHE PATH "Path to the android sdk" FORCE)
    52 endif()
    52 endif()
    53 
    53 
    54 if( IS_DIRECTORY "${ANDROID_SDK}")
    54 if(IS_DIRECTORY "${ANDROID_SDK}")
    55     message(STATUS "Detected the android SDK directory at: " ${ANDROID_SDK}) 
    55     message(STATUS "Detected the android SDK directory at: " ${ANDROID_SDK})
    56 else ()
    56 else()
    57     message(FATAL_ERROR "Couldn't detect the Android SDK directory")
    57     message(FATAL_ERROR "Couldn't detect the Android SDK directory")
    58 endif()
    58 endif()
    59 
    59 
    60 if( NOT FPC_DIR)
    60 if(NOT FPC_DIR)
    61     find_program(FPC_DIR ppcrossarm)
    61     find_program(FPC_DIR ppcrossarm)
    62     get_filename_component(FPC_DIR "${FPC_DIR}" PATH)
    62     get_filename_component(FPC_DIR "${FPC_DIR}" PATH)
    63     if(IS_DIRECTORY "${FPC_DIR}") 
    63     if(IS_DIRECTORY "${FPC_DIR}")
    64     	set(FPC_DIR "${FPC_DIR}" CACHE PATH "Path to fpc dir used in the android port" FORCE)
    64         set(FPC_DIR "${FPC_DIR}" CACHE PATH "Path to fpc dir used in the android port" FORCE)
    65     endif()
    65     endif()
    66 endif()
    66 endif()
    67 
    67 
    68 if( IS_DIRECTORY "${FPC_DIR}")
    68 if(IS_DIRECTORY "${FPC_DIR}")
    69     message(STATUS "Detected the FreePascal directory at: " "${FPC_DIR}") 
    69     message(STATUS "Detected the FreePascal directory at: ${FPC_DIR}")
    70 else ()
    70 else()
    71     message(FATAL_ERROR "Couldn't detect the FreePascal directory")
    71     message(FATAL_ERROR "Couldn't detect the FreePascal directory")
    72 endif()
    72 endif()
    73 
    73 
    74 set(SDL_DIR /home/richard/Downloads/android-project)
    74 set(SDL_DIR /home/richard/Downloads/android-project)
    75 
    75