84 lines
2.5 KiB
CMake
84 lines
2.5 KiB
CMake
# The Flutter tooling requires that developers have CMake 3.10 or later
|
|
# installed. You should not increase this version, as doing so will cause
|
|
# the plugin to fail to compile for some customers of the plugin.
|
|
cmake_minimum_required(VERSION 3.10)
|
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
|
|
|
function(dump_cmake_variables)
|
|
get_cmake_property(_variableNames VARIABLES)
|
|
list (SORT _variableNames)
|
|
foreach (_variableName ${_variableNames})
|
|
if (ARGV0)
|
|
unset(MATCHED)
|
|
|
|
#case sensitive match
|
|
# string(REGEX MATCH ${ARGV0} MATCHED ${_variableName})
|
|
#
|
|
#case insenstitive match
|
|
string( TOLOWER "${ARGV0}" ARGV0_lower )
|
|
string( TOLOWER "${_variableName}" _variableName_lower )
|
|
string(REGEX MATCH ${ARGV0_lower} MATCHED ${_variableName_lower})
|
|
|
|
if (NOT MATCHED)
|
|
continue()
|
|
endif()
|
|
endif()
|
|
message(STATUS "${_variableName}=${${_variableName}}")
|
|
endforeach()
|
|
endfunction()
|
|
|
|
project(archimedes_mobile_lib_library VERSION 0.0.1 LANGUAGES CXX)
|
|
|
|
set (OPENMVG_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../../openMVG/src)
|
|
set (FFMPEG_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../../ffmpeg_install/include)
|
|
set (ARCHIMEDES_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR})
|
|
find_package(
|
|
OpenMVG
|
|
REQUIRED
|
|
)
|
|
|
|
set(PNG_SHARED ON CACHE BOOL "" FORCE)
|
|
set(PNG_STATIC OFF CACHE BOOL "" FORCE)
|
|
set(PNG_EXECUTABLES OFF CACHE BOOL "" FORCE) # we only want lib
|
|
set(PNG_TESTS OFF CACHE BOOL "" FORCE) # we only want lib
|
|
set(SKIP_INSTALL_ALL OFF CACHE BOOL "" FORCE) # we only want lib
|
|
|
|
# find_package(PNG
|
|
# REQUIRED
|
|
# HINTS "../"
|
|
# )
|
|
|
|
add_definitions(${PNG_DEFINITIONS})
|
|
|
|
add_library(archimedes_mobile_lib SHARED
|
|
"image.cxx"
|
|
)
|
|
|
|
|
|
dump_cmake_variables("^png")
|
|
|
|
message("LIBRARIES:" ${OpenMVG_LIBRARIES})
|
|
|
|
target_link_libraries(
|
|
archimedes_mobile_lib
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../libpng/_install/lib/libpng16.so
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../openMVG/build/_install/lib/libopenMVG_image.a
|
|
${OPENMVG_LIBRARIES}
|
|
)
|
|
|
|
include_directories(
|
|
${FFMPEG_INCLUDE_DIRS}
|
|
${OPENMVG_INCLUDE_DIRS}
|
|
${ARCHIMEDES_INCLUDE_DIRS}
|
|
${PNG_INCLUDE_DIRS}
|
|
)
|
|
|
|
set_target_properties(archimedes_mobile_lib
|
|
PROPERTIES
|
|
PUBLIC_HEADER image.h
|
|
OUTPUT_NAME "archimedes_mobile_lib"
|
|
)
|
|
target_link_options(archimedes_mobile_lib PRIVATE "-Wl,-Bstatic")
|
|
target_link_options(archimedes_mobile_lib PRIVATE "-Wl,-Bdynamic")
|
|
|
|
target_compile_definitions(archimedes_mobile_lib PUBLIC DART_SHARED_LIB) |