Commit c9fcacad authored by DanmeiChen's avatar DanmeiChen

Feature/make framework on macos

parent 62431719
......@@ -19,7 +19,7 @@ project(SOCI VERSION 4.0.0 LANGUAGES C CXX)
# Build features and variants
##############################################################################
option(SOCI_SHARED "Enable build of shared libraries" ON)
option(SOCI_SHARED "Enable build of shared libraries" OFF)
option(SOCI_STATIC "Enable build of static libraries" ON)
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)
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>${MACOSX_FRAMEWORK_NAME}</string>
<key>CFBundleGetInfoString</key>
<string>${MACOSX_BUNDLE_INFO_STRING}</string>
<key>CFBundleIconFile</key>
<string>${MACOSX_BUNDLE_ICON_FILE}</string>
<key>CFBundleIdentifier</key>
<string>${MACOSX_FRAMEWORK_IDENTIFIER}</string>
<key>LSMinimumSystemVersion</key>
<string>${MIN_OS}</string>
<key>MinimumOSVersion</key>
<string>${MIN_OS}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleLongVersionString</key>
<string>${MACOSX_BUNDLE_LONG_VERSION_STRING}</string>
<key>CFBundleName</key>
<string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>${SOCI_VERSION}</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${SOCI_VERSION}</string>
<key>CSResourcesFileMapped</key>
<true/>
<key>NSHumanReadableCopyright</key>
<string>${MACOSX_BUNDLE_COPYRIGHT}</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSHighResolutionCapable</key>
<string>True</string>
</dict>
</plist>
......@@ -167,6 +167,17 @@ macro(soci_backend NAME)
PROPERTIES
OUTPUT_NAME ${THIS_BACKEND_OUTPUT_NAME}
DEFINE_SYMBOL SOCI_DLL)
elseif(APPLE)
if(IOS)
set(MIN_OS ${LINPHONE_IOS_DEPLOYMENT_TARGET})
else()
set(MIN_OS ${CMAKE_OSX_DEPLOYMENT_TARGET})
endif()
set_target_properties(${THIS_BACKEND_TARGET} PROPERTIES
FRAMEWORK TRUE
MACOSX_FRAMEWORK_IDENTIFIER org.linphone.${SOCI_BACKEND_SQLITE3}
MACOSX_FRAMEWORK_INFO_PLIST "${CMAKE_SOURCE_DIR}/build/osx/Info.plist.in"
PUBLIC_HEADER "${THIS_BACKEND_HEADERS}")
else()
set_target_properties(${THIS_BACKEND_TARGET}
PROPERTIES
......@@ -213,11 +224,22 @@ macro(soci_backend NAME)
${INCLUDEDIR}/${PROJECTNAMEL}/${NAMEL})
if (SOCI_SHARED)
install(TARGETS ${THIS_BACKEND_TARGET}
EXPORT SOCI
RUNTIME DESTINATION ${BINDIR}
LIBRARY DESTINATION ${LIBDIR}
ARCHIVE DESTINATION ${LIBDIR})
if(APPLE)
install(TARGETS ${THIS_BACKEND_TARGET}
EXPORT SOCI
RUNTIME DESTINATION ${BINDIR}
LIBRARY DESTINATION ${LIBDIR}
ARCHIVE DESTINATION ${LIBDIR}
FRAMEWORK DESTINATION Frameworks
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
COMPONENT core)
else()
install(TARGETS ${THIS_BACKEND_TARGET}
EXPORT SOCI
RUNTIME DESTINATION ${BINDIR}
LIBRARY DESTINATION ${LIBDIR}
ARCHIVE DESTINATION ${LIBDIR})
endif()
endif()
if (SOCI_STATIC)
......
......@@ -52,6 +52,17 @@ if (SOCI_SHARED)
OUTPUT_NAME "${SOCI_CORE_TARGET_OUTPUT_NAME}"
VERSION ${SOCI_VERSION}
CLEAN_DIRECT_OUTPUT 1)
elseif(APPLE)
if(IOS)
set(MIN_OS ${LINPHONE_IOS_DEPLOYMENT_TARGET})
else()
set(MIN_OS ${CMAKE_OSX_DEPLOYMENT_TARGET})
endif()
set_target_properties(${SOCI_CORE_TARGET} PROPERTIES
FRAMEWORK TRUE
MACOSX_FRAMEWORK_IDENTIFIER org.linphone.soci_core
MACOSX_FRAMEWORK_INFO_PLIST "${CMAKE_SOURCE_DIR}/build/osx/Info.plist.in"
PUBLIC_HEADER "${SOCI_CORE_HEADERS}")
else()
set_target_properties(${SOCI_CORE_TARGET}
PROPERTIES
......@@ -109,11 +120,22 @@ endif()
install(FILES ${SOCI_CORE_HEADERS} DESTINATION ${INCLUDEDIR}/${PROJECTNAMEL})
if (SOCI_SHARED)
install(TARGETS ${SOCI_CORE_TARGET}
EXPORT SOCI
RUNTIME DESTINATION ${BINDIR}
LIBRARY DESTINATION ${LIBDIR}
ARCHIVE DESTINATION ${LIBDIR})
if(APPLE)
install(TARGETS ${SOCI_CORE_TARGET}
EXPORT SOCI
RUNTIME DESTINATION ${BINDIR}
LIBRARY DESTINATION ${LIBDIR}
ARCHIVE DESTINATION ${LIBDIR}
FRAMEWORK DESTINATION Frameworks
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
COMPONENT core)
else()
install(TARGETS ${SOCI_CORE_TARGET}
EXPORT SOCI
RUNTIME DESTINATION ${BINDIR}
LIBRARY DESTINATION ${LIBDIR}
ARCHIVE DESTINATION ${LIBDIR})
endif()
endif()
if (SOCI_STATIC)
......
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