Android supporte
This commit is contained in:
parent
9bdfabc381
commit
c46228a03b
129
Prelims.cmake
129
Prelims.cmake
@ -4,104 +4,104 @@
|
|||||||
include (MacroLogFeature)
|
include (MacroLogFeature)
|
||||||
|
|
||||||
if (POLICY CMP0042)
|
if (POLICY CMP0042)
|
||||||
cmake_policy( SET CMP0042 NEW)
|
cmake_policy( SET CMP0042 NEW)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (ANDROID)
|
if (ANDROID)
|
||||||
macro ( MY_add_custom_target)
|
macro ( MY_add_custom_target)
|
||||||
endmacro()
|
endmacro()
|
||||||
else()
|
else()
|
||||||
macro ( MY_add_custom_target )
|
macro ( MY_add_custom_target )
|
||||||
add_custom_target (${ARGN})
|
add_custom_target (${ARGN})
|
||||||
endmacro()
|
endmacro()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
if (ANDROID)
|
if (ANDROID)
|
||||||
macro ( add_component arg1)
|
macro ( add_component arg1)
|
||||||
foreach(item ${ARGN})
|
foreach(item ${ARGN})
|
||||||
get_filename_component(i ${item} ABSOLUTE)
|
get_filename_component(i ${item} ABSOLUTE)
|
||||||
set( ALL_SOURCES ${ALL_SOURCES} ${i} )
|
set( ALL_SOURCES ${ALL_SOURCES} ${i} )
|
||||||
endforeach()
|
endforeach()
|
||||||
set( ALL_SOURCES ${ALL_SOURCES} PARENT_SCOPE )
|
set( ALL_SOURCES ${ALL_SOURCES} PARENT_SCOPE )
|
||||||
endmacro()
|
endmacro()
|
||||||
macro ( add_external arg1)
|
macro ( add_external arg1)
|
||||||
foreach(item ${ARGN})
|
foreach(item ${ARGN})
|
||||||
get_filename_component(i ${item} ABSOLUTE)
|
get_filename_component(i ${item} ABSOLUTE)
|
||||||
set( ALL_SOURCES ${ALL_SOURCES} ${i} )
|
set( ALL_SOURCES ${ALL_SOURCES} ${i} )
|
||||||
endforeach()
|
endforeach()
|
||||||
set( ALL_SOURCES ${ALL_SOURCES} PARENT_SCOPE )
|
set( ALL_SOURCES ${ALL_SOURCES} PARENT_SCOPE )
|
||||||
endmacro()
|
endmacro()
|
||||||
else()
|
else()
|
||||||
macro ( add_component arg1 )
|
macro ( add_component arg1 )
|
||||||
add_library ( ${arg1} OBJECT ${ARGN})
|
add_library ( ${arg1} OBJECT ${ARGN})
|
||||||
endmacro()
|
endmacro()
|
||||||
macro ( add_external arg1 )
|
macro ( add_external arg1 )
|
||||||
add_library ( ${arg1} SHARED ${ARGN})
|
add_library ( ${arg1} SHARED ${ARGN})
|
||||||
endmacro()
|
endmacro()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (ANDROID)
|
if (ANDROID)
|
||||||
macro ( MY_add_dependencies)
|
macro ( MY_add_dependencies)
|
||||||
endmacro()
|
endmacro()
|
||||||
else()
|
else()
|
||||||
macro ( MY_add_dependencies )
|
macro ( MY_add_dependencies )
|
||||||
add_dependencies (${ARGN})
|
add_dependencies (${ARGN})
|
||||||
endmacro()
|
endmacro()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (ANDROID)
|
if (ANDROID)
|
||||||
macro ( MY_add_library)
|
macro ( MY_add_library)
|
||||||
endmacro()
|
endmacro()
|
||||||
else()
|
else()
|
||||||
macro ( MY_add_library )
|
macro ( MY_add_library )
|
||||||
add_library (${ARGN})
|
add_library (${ARGN})
|
||||||
endmacro()
|
endmacro()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (ANDROID)
|
if (ANDROID)
|
||||||
macro ( MY_add_subdirectory)
|
macro ( MY_add_subdirectory)
|
||||||
endmacro()
|
endmacro()
|
||||||
else()
|
else()
|
||||||
macro ( MY_add_subdirectory )
|
macro ( MY_add_subdirectory )
|
||||||
add_subdirectory (${ARGN})
|
add_subdirectory (${ARGN})
|
||||||
endmacro()
|
endmacro()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (ANDROID)
|
if (ANDROID)
|
||||||
macro ( MY_include)
|
macro ( MY_include)
|
||||||
endmacro()
|
endmacro()
|
||||||
else()
|
else()
|
||||||
macro ( MY_include )
|
macro ( MY_include )
|
||||||
include (${ARGN})
|
include (${ARGN})
|
||||||
endmacro()
|
endmacro()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (ANDROID)
|
if (ANDROID)
|
||||||
macro ( MY_install)
|
macro ( MY_install)
|
||||||
endmacro()
|
endmacro()
|
||||||
else()
|
else()
|
||||||
macro ( MY_install )
|
macro ( MY_install )
|
||||||
install (${ARGN})
|
install (${ARGN})
|
||||||
endmacro()
|
endmacro()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (ANDROID)
|
if (ANDROID)
|
||||||
macro ( MY_set_target_properties)
|
macro ( MY_set_target_properties)
|
||||||
endmacro()
|
endmacro()
|
||||||
else()
|
else()
|
||||||
macro ( MY_set_target_properties )
|
macro ( MY_set_target_properties )
|
||||||
set_target_properties (${ARGN})
|
set_target_properties (${ARGN})
|
||||||
endmacro()
|
endmacro()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (ANDROID)
|
if (ANDROID)
|
||||||
macro ( MY_target_link_libraries)
|
macro ( MY_target_link_libraries)
|
||||||
endmacro()
|
endmacro()
|
||||||
else()
|
else()
|
||||||
macro ( MY_target_link_libraries )
|
macro ( MY_target_link_libraries )
|
||||||
target_link_libraries (${ARGN})
|
target_link_libraries (${ARGN})
|
||||||
endmacro()
|
endmacro()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
@ -109,14 +109,14 @@ endif()
|
|||||||
# Search packages for host system instead of packages for target system
|
# Search packages for host system instead of packages for target system
|
||||||
# in case of cross compilation these macro should be defined by toolchain file
|
# in case of cross compilation these macro should be defined by toolchain file
|
||||||
if(NOT COMMAND find_host_package)
|
if(NOT COMMAND find_host_package)
|
||||||
macro(find_host_package)
|
macro(find_host_package)
|
||||||
find_package(${ARGN})
|
find_package(${ARGN})
|
||||||
endmacro()
|
endmacro()
|
||||||
endif()
|
endif()
|
||||||
if(NOT COMMAND find_host_program)
|
if(NOT COMMAND find_host_program)
|
||||||
macro(find_host_program)
|
macro(find_host_program)
|
||||||
find_program(${ARGN})
|
find_program(${ARGN})
|
||||||
endmacro()
|
endmacro()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# where we have most scripts
|
# where we have most scripts
|
||||||
@ -131,13 +131,13 @@ disallow_intree_builds()
|
|||||||
# set(CMAKE_BUILD_TYPE Debug)
|
# set(CMAKE_BUILD_TYPE Debug)
|
||||||
|
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
set (MACOSX_RPATH ON)
|
set (MACOSX_RPATH ON)
|
||||||
endif (APPLE )
|
endif (APPLE )
|
||||||
if(POLICY CMP0042)
|
if(POLICY CMP0042)
|
||||||
cmake_policy(SET CMP0042 NEW)
|
cmake_policy(SET CMP0042 NEW)
|
||||||
endif(POLICY CMP0042)
|
endif(POLICY CMP0042)
|
||||||
if(POLICY CMP0043)
|
if(POLICY CMP0043)
|
||||||
cmake_policy(SET CMP0043 NEW)
|
cmake_policy(SET CMP0043 NEW)
|
||||||
endif(POLICY CMP0043)
|
endif(POLICY CMP0043)
|
||||||
|
|
||||||
|
|
||||||
@ -147,11 +147,16 @@ set ( libdir "${exec_prefix}/lib")
|
|||||||
set ( dlls "${exec_prefix}/lib/Yap")
|
set ( dlls "${exec_prefix}/lib/Yap")
|
||||||
set ( includedir "${prefix}/include")
|
set ( includedir "${prefix}/include")
|
||||||
set ( datarootdir "${prefix}/share")
|
set ( datarootdir "${prefix}/share")
|
||||||
set ( libpl "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/../../../../../build/generated/assets/share/Yap")
|
if (ANDROID)
|
||||||
|
set ( libpl "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/../../../../../build/generated/assets/Yap")
|
||||||
|
else()
|
||||||
|
set ( libpl "${datarootdir}/Yap")
|
||||||
|
|
||||||
|
endif()
|
||||||
set ( datadir "${datarootdir}")
|
set ( datadir "${datarootdir}")
|
||||||
set ( mandir "${datarootdir}/man")
|
set ( mandir "${datarootdir}/man")
|
||||||
set ( bindir "${exec_prefix}/bin")
|
set ( bindir "${exec_prefix}/bin")
|
||||||
set ( docdir "${exec_prefix}/share/doc/Yap")
|
set ( docdir "${exec_prefix}/doc/Yap")
|
||||||
|
|
||||||
set(YAP_ROOTDIR ${prefix})
|
set(YAP_ROOTDIR ${prefix})
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user