mirror of
https://github.com/tfussell/xlnt.git
synced 2024-03-22 13:11:17 +08:00
add support for osx frameworks, move optional into source tree so it can be used in framework
This commit is contained in:
parent
d62ad6731d
commit
55987bdad7
|
@ -8,6 +8,7 @@ project(xlnt)
|
|||
|
||||
option(SHARED "Set to OFF to not build shared libraries" ON)
|
||||
option(STATIC "Set to ON to build static libraries" OFF)
|
||||
option(FRAMEWORK "Set to ON to package dylib and headers into a .framework, OSX only" OFF)
|
||||
option(DEBUG "Set to ON to for debug configuration" OFF)
|
||||
option(BUILD_EXAMPLES "Build examples" OFF)
|
||||
option(BUILD_TESTS "Build tests runner" OFF)
|
||||
|
|
|
@ -30,7 +30,6 @@ include_directories(../source)
|
|||
include_directories(../third-party/miniz)
|
||||
include_directories(../third-party/pugixml/src)
|
||||
include_directories(../third-party/utfcpp/source)
|
||||
include_directories(../third-party/Optional)
|
||||
|
||||
FILE(GLOB ROOT_HEADERS ../include/xlnt/*.hpp)
|
||||
FILE(GLOB CELL_HEADERS ../include/xlnt/cell/*.hpp)
|
||||
|
@ -87,6 +86,18 @@ if(SHARED)
|
|||
SOVERSION ${PROJECT_VERSION}
|
||||
INSTALL_NAME_DIR "${LIB_DEST_DIR}"
|
||||
)
|
||||
|
||||
if(FRAMEWORK)
|
||||
add_custom_command(
|
||||
TARGET xlnt.shared
|
||||
POST_BUILD
|
||||
COMMAND mkdir -p "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.framework/Versions/${PROJECT_VERSION_FULL}/Headers"
|
||||
COMMAND cp -R ../include/xlnt/* "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.framework/Versions/${PROJECT_VERSION_FULL}/Headers"
|
||||
COMMAND cp "../lib/lib${PROJECT_NAME}.${PROJECT_VERSION_FULL}.dylib" "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.framework/Versions/${PROJECT_VERSION_FULL}/xlnt"
|
||||
COMMAND cd "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.framework/Versions" && ln -s "${PROJECT_VERSION_FULL}" Current
|
||||
COMMAND cd "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.framework" && ln -s Versions/Current/* ./
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(STATIC)
|
||||
|
|
2
configure
vendored
2
configure
vendored
|
@ -81,6 +81,8 @@ def parse_args(args):
|
|||
options['SHARED'] = 0
|
||||
elif option == '--disable-static':
|
||||
options['STATIC'] = 0
|
||||
elif option == '--enable-framework':
|
||||
options['FRAMEWORK'] = 1
|
||||
elif option == '--enable-tests':
|
||||
options['BUILD_TESTS'] = 1
|
||||
elif option == '--enable-coverage':
|
||||
|
|
|
@ -25,12 +25,12 @@
|
|||
|
||||
#include <cstddef>
|
||||
#include <functional>
|
||||
#include <optional.hpp>
|
||||
|
||||
#include <xlnt/xlnt_config.hpp>
|
||||
#include <xlnt/styles/diagonal_direction.hpp>
|
||||
#include <xlnt/styles/side.hpp>
|
||||
#include <xlnt/utils/hashable.hpp>
|
||||
#include <xlnt/utils/optional.hpp>
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
|
|
|
@ -23,10 +23,9 @@
|
|||
// @author: see AUTHORS file
|
||||
#pragma once
|
||||
|
||||
#include <optional.hpp>
|
||||
|
||||
#include <xlnt/xlnt_config.hpp>
|
||||
#include <xlnt/styles/color.hpp>
|
||||
#include <xlnt/utils/optional.hpp>
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
|
|
|
@ -24,12 +24,12 @@
|
|||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
#include <optional.hpp>
|
||||
|
||||
#include <xlnt/xlnt_config.hpp>
|
||||
#include <xlnt/styles/border_style.hpp>
|
||||
#include <xlnt/styles/color.hpp>
|
||||
#include <xlnt/utils/hashable.hpp>
|
||||
#include <xlnt/utils/optional.hpp>
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
|
|
1042
include/xlnt/utils/optional.hpp
Normal file
1042
include/xlnt/utils/optional.hpp
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user