Fix cross-compilation against Poco pre-built (#2599)

* Use ZLIB and PCRE imported target to improve portability
* Set EXPAT and SQLite3 library for XML and SQL if POCO_UNBUNDLED is true in cmake build
This commit is contained in:
lmayencourt
2019-04-20 17:53:48 +01:00
committed by Joerg-Christian Boehme
parent b878152e90
commit bd98f5cedf
13 changed files with 301 additions and 131 deletions

View File

@@ -28,7 +28,7 @@ set_target_properties(SQLSQLite
DEFINE_SYMBOL SQLite_EXPORTS
)
target_link_libraries(SQLSQLite PUBLIC Poco::SQL ${SQLITE3_LIBRARIES}) # TODO(BJoe) Use namespace target
target_link_libraries(SQLSQLite PUBLIC Poco::SQL)
target_include_directories(SQLSQLite
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
@@ -37,7 +37,7 @@ target_include_directories(SQLSQLite
)
if(POCO_UNBUNDLED)
target_include_directories(SQLSQLite PUBLIC "${SQLITE3_INCLUDE_DIRS}")
target_link_libraries(SQLSQLite PUBLIC SQLite::SQLite3)
target_compile_definitions(SQLSQLite PUBLIC POCO_UNBUNDLED)
else()
if(WINCE)

View File

@@ -1,4 +1,11 @@
include(CMakeFindDependencyMacro)
find_dependency(PocoFoundation)
find_dependency(PocoSQL)
if(@POCO_UNBUNDLED@)
if(CMAKE_VERSION VERSION_LESS "3.14")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/V313")
endif()
find_dependency(SQLite3 REQUIRED)
endif()
include("${CMAKE_CURRENT_LIST_DIR}/PocoSQLSQLiteTargets.cmake")