mirror of
https://github.com/Xahau/xahaud.git
synced 2025-11-20 18:45:55 +00:00
Search for soci before vendoring
This commit is contained in:
16
Builds/CMake/deps/Findsoci.cmake
Normal file
16
Builds/CMake/deps/Findsoci.cmake
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
find_package (PkgConfig REQUIRED)
|
||||||
|
|
||||||
|
# no soci pkgconfig
|
||||||
|
#pkg_search_module (soci_PC QUIET libsoci_core>=3.2)
|
||||||
|
|
||||||
|
if(static)
|
||||||
|
set(SOCI_LIB libsoci.a)
|
||||||
|
else()
|
||||||
|
set(SOCI_LIB libsoci_core.so)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
find_library (soci
|
||||||
|
NAMES ${SOCI_LIB})
|
||||||
|
|
||||||
|
find_path (SOCI_INCLUDE_DIR
|
||||||
|
NAMES soci/soci.h)
|
||||||
@@ -2,6 +2,26 @@
|
|||||||
NIH dep: soci
|
NIH dep: soci
|
||||||
#]===================================================================]
|
#]===================================================================]
|
||||||
|
|
||||||
|
foreach (_comp core empty sqlite3)
|
||||||
|
add_library ("soci_${_comp}" STATIC IMPORTED GLOBAL)
|
||||||
|
endforeach ()
|
||||||
|
|
||||||
|
if (NOT WIN32)
|
||||||
|
find_package(soci)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (soci)
|
||||||
|
foreach (_comp core empty sqlite3)
|
||||||
|
set_target_properties ("soci_${_comp}" PROPERTIES
|
||||||
|
IMPORTED_LOCATION_DEBUG
|
||||||
|
${soci}
|
||||||
|
IMPORTED_LOCATION_RELEASE
|
||||||
|
${soci}
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES
|
||||||
|
${SOCI_INCLUDE_DIR})
|
||||||
|
endforeach ()
|
||||||
|
|
||||||
|
else()
|
||||||
set (soci_lib_pre ${ep_lib_prefix})
|
set (soci_lib_pre ${ep_lib_prefix})
|
||||||
set (soci_lib_post "")
|
set (soci_lib_post "")
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
@@ -103,7 +123,6 @@ endif ()
|
|||||||
file (MAKE_DIRECTORY ${SOURCE_DIR}/include)
|
file (MAKE_DIRECTORY ${SOURCE_DIR}/include)
|
||||||
file (MAKE_DIRECTORY ${BINARY_DIR}/include)
|
file (MAKE_DIRECTORY ${BINARY_DIR}/include)
|
||||||
foreach (_comp core empty sqlite3)
|
foreach (_comp core empty sqlite3)
|
||||||
add_library ("soci_${_comp}" STATIC IMPORTED GLOBAL)
|
|
||||||
set_target_properties ("soci_${_comp}" PROPERTIES
|
set_target_properties ("soci_${_comp}" PROPERTIES
|
||||||
IMPORTED_LOCATION_DEBUG
|
IMPORTED_LOCATION_DEBUG
|
||||||
${BINARY_DIR}/lib/${soci_lib_pre}soci_${_comp}${soci_lib_post}_d${ep_lib_suffix}
|
${BINARY_DIR}/lib/${soci_lib_pre}soci_${_comp}${soci_lib_post}_d${ep_lib_suffix}
|
||||||
@@ -116,6 +135,12 @@ foreach (_comp core empty sqlite3)
|
|||||||
if (NOT _comp STREQUAL "core")
|
if (NOT _comp STREQUAL "core")
|
||||||
target_link_libraries ("soci_${_comp}" INTERFACE soci_core)
|
target_link_libraries ("soci_${_comp}" INTERFACE soci_core)
|
||||||
endif ()
|
endif ()
|
||||||
|
endforeach ()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
foreach (_comp core empty sqlite3)
|
||||||
exclude_if_included ("soci_${_comp}")
|
exclude_if_included ("soci_${_comp}")
|
||||||
endforeach ()
|
endforeach ()
|
||||||
|
|
||||||
|
|
||||||
exclude_if_included (soci)
|
exclude_if_included (soci)
|
||||||
|
|||||||
Reference in New Issue
Block a user