Fixed export header for static/shared build.
This commit is contained in:
parent
1a53602555
commit
993f3bf56d
3
.gitignore
vendored
3
.gitignore
vendored
@ -25,7 +25,8 @@ doc/html/*
|
||||
/libvmime.a
|
||||
/vmime.pc
|
||||
/vmime/config.hpp
|
||||
/vmime/export.hpp
|
||||
/vmime/export-static.hpp
|
||||
/vmime/export-shared.hpp
|
||||
/COPYING.txt
|
||||
/build/
|
||||
|
||||
|
@ -78,13 +78,15 @@ FILE(
|
||||
vmime/*
|
||||
)
|
||||
|
||||
LIST(APPEND VMIME_LIBRARY_GENERATED_INCLUDE_FILES "vmime/config.hpp")
|
||||
LIST(APPEND VMIME_LIBRARY_GENERATED_INCLUDE_FILES "vmime/export.hpp")
|
||||
LIST(APPEND VMIME_LIBRARY_INCLUDE_FILES "vmime/config.hpp")
|
||||
|
||||
INCLUDE_DIRECTORIES(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
INCLUDE(GenerateExportHeader)
|
||||
ADD_COMPILER_EXPORT_FLAGS()
|
||||
|
||||
# Shared library
|
||||
OPTION(
|
||||
VMIME_BUILD_SHARED_LIBRARY
|
||||
@ -94,10 +96,6 @@ OPTION(
|
||||
|
||||
IF(VMIME_BUILD_SHARED_LIBRARY)
|
||||
|
||||
INCLUDE(GenerateExportHeader)
|
||||
|
||||
ADD_COMPILER_EXPORT_FLAGS()
|
||||
|
||||
ADD_LIBRARY(
|
||||
${VMIME_LIBRARY_NAME}
|
||||
SHARED
|
||||
@ -108,14 +106,18 @@ IF(VMIME_BUILD_SHARED_LIBRARY)
|
||||
GENERATE_EXPORT_HEADER(
|
||||
${VMIME_LIBRARY_NAME}
|
||||
BASE_NAME VMIME
|
||||
EXPORT_FILE_NAME ${CMAKE_SOURCE_DIR}/vmime/export.hpp
|
||||
STATIC_DEFINE VMIME_STATIC
|
||||
EXPORT_FILE_NAME ${CMAKE_SOURCE_DIR}/vmime/export-shared.hpp
|
||||
)
|
||||
|
||||
LIST(APPEND VMIME_LIBRARY_INCLUDE_FILES "vmime/export-shared.hpp")
|
||||
|
||||
SET_TARGET_PROPERTIES(
|
||||
${VMIME_LIBRARY_NAME}
|
||||
PROPERTIES
|
||||
VERSION "${VMIME_API_VERSION}"
|
||||
SOVERSION "${VMIME_API_VERSION_CURRENT}"
|
||||
COMPILE_FLAGS -DVMIME_SHARED
|
||||
)
|
||||
|
||||
ENDIF()
|
||||
@ -139,11 +141,20 @@ IF(VMIME_BUILD_STATIC_LIBRARY)
|
||||
${VMIME_LIBRARY_INCLUDE_FILES}
|
||||
)
|
||||
|
||||
GENERATE_EXPORT_HEADER(
|
||||
${VMIME_LIBRARY_NAME}-static
|
||||
BASE_NAME VMIME
|
||||
STATIC_DEFINE VMIME_STATIC
|
||||
EXPORT_FILE_NAME ${CMAKE_SOURCE_DIR}/vmime/export-static.hpp
|
||||
)
|
||||
|
||||
LIST(APPEND VMIME_LIBRARY_INCLUDE_FILES "vmime/export-static.hpp")
|
||||
|
||||
SET_TARGET_PROPERTIES(
|
||||
${VMIME_LIBRARY_NAME}-static
|
||||
PROPERTIES
|
||||
OUTPUT_NAME ${VMIME_LIBRARY_NAME}
|
||||
COMPILE_FLAGS -DVMIME_STATIC_DEFINE
|
||||
COMPILE_FLAGS -DVMIME_STATIC
|
||||
)
|
||||
|
||||
ENDIF()
|
||||
|
36
vmime/export.hpp
Normal file
36
vmime/export.hpp
Normal file
@ -0,0 +1,36 @@
|
||||
//
|
||||
// VMime library (http://www.vmime.org)
|
||||
// Copyright (C) 2002-2013 Vincent Richard <vincent@vmime.org>
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation; either version 3 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
//
|
||||
// Linking this library statically or dynamically with other modules is making
|
||||
// a combined work based on this library. Thus, the terms and conditions of
|
||||
// the GNU General Public License cover the whole combination.
|
||||
//
|
||||
|
||||
#ifndef VMIME_EXPORT_HPP_INCLUDED
|
||||
#define VMIME_EXPORT_HPP_INCLUDED
|
||||
|
||||
|
||||
// Define VMIME_STATIC if you are linking with the static library
|
||||
#ifdef VMIME_STATIC
|
||||
# include "vmime/export-static.hpp"
|
||||
#else
|
||||
# include "vmime/export-shared.hpp"
|
||||
#endif
|
||||
|
||||
|
||||
#endif // VMIME_EXPORT_HPP_INCLUDED
|
Loading…
Reference in New Issue
Block a user