Commit 305a7af4 authored by jehan's avatar jehan

add SOCI_FRAMEWORK option

parent 90db7e29
......@@ -18,9 +18,11 @@ project(SOCI VERSION 4.0.0 LANGUAGES C CXX)
###############################################################################
# Build features and variants
##############################################################################
option(SOCI_SHARED "Enable build of shared libraries" OFF)
option(SOCI_STATIC "Enable build of static libraries" ON)
if (APPLE)
option(SOCI_FRAMEWORK "Enable build of APPLE framework" ON)
endif()
option(SOCI_TESTS "Enable build of collection of SOCI tests" ON)
option(SOCI_ASAN "Enable address sanitizer on GCC v4.8+/Clang v 3.1+" OFF)
......@@ -52,6 +54,7 @@ soci_version()
boost_report_value(SOCI_SHARED)
boost_report_value(SOCI_STATIC)
boost_report_value(SOCI_FRAMEWORK)
boost_report_value(SOCI_TESTS)
boost_report_value(SOCI_ASAN)
......
......@@ -167,7 +167,7 @@ macro(soci_backend NAME)
PROPERTIES
OUTPUT_NAME ${THIS_BACKEND_OUTPUT_NAME}
DEFINE_SYMBOL SOCI_DLL)
elseif(APPLE)
elseif(SOCI_FRAMEWORK)
if(IOS)
set(MIN_OS ${LINPHONE_IOS_DEPLOYMENT_TARGET})
else()
......@@ -184,7 +184,7 @@ macro(soci_backend NAME)
SOVERSION ${${PROJECT_NAME}_SOVERSION}
INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/lib)
if(APPLE)
if(SOCI_FRAMEWORK)
set_target_properties(${THIS_BACKEND_TARGET}
PROPERTIES
LINK_FLAGS "-Wl,-flat_namespace -Wl,-undefined -Wl,suppress")
......
......@@ -52,7 +52,7 @@ if (SOCI_SHARED)
OUTPUT_NAME "${SOCI_CORE_TARGET_OUTPUT_NAME}"
VERSION ${SOCI_VERSION}
CLEAN_DIRECT_OUTPUT 1)
elseif(APPLE)
elseif(SOCI_FRAMEWORK)
if(IOS)
set(MIN_OS ${LINPHONE_IOS_DEPLOYMENT_TARGET})
else()
......@@ -120,7 +120,7 @@ endif()
install(FILES ${SOCI_CORE_HEADERS} DESTINATION ${INCLUDEDIR}/${PROJECTNAMEL})
if (SOCI_SHARED)
if(APPLE)
if(SOCI_FRAMEWORK)
install(TARGETS ${SOCI_CORE_TARGET}
EXPORT SOCI
RUNTIME DESTINATION ${BINDIR}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment