Commit 0e3c96e3 authored by Stephen Kelly's avatar Stephen Kelly
Browse files

Port to generate_export_header.

Lots of new include_directories invocations are needed, but can be
removed when CMake 2.8.11 is depended on.
parent 5a3597d1
......@@ -41,18 +41,21 @@ if(NOT USE_KRESOURCES)
)
endif()
include_directories(
${CMAKE_BINARY_DIR}/kcal
${CMAKE_BINARY_DIR}/kcalcore
${CMAKE_BINARY_DIR}/akonadi
${CMAKE_BINARY_DIR}/kholidays
${CMAKE_BINARY_DIR}/kpimidentities
)
kde4_add_library(kalarmcal ${LIBRARY_TYPE} ${kalarmcal_LIB_SRCS})
generate_export_header(kalarmcal)
if(USE_KRESOURCES)
set(KALARMCAL_USE_KRESOURCES "// This library was built to use KResources.\n// It must be rebuilt in order to use Akonadi.\n#define KALARMCAL_USE_KRESOURCES")
file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/kalarmcal_export.h" "\n// This library was built to use KResources.\n// It must be rebuilt in order to use Akonadi.\n#define KALARMCAL_USE_KRESOURCES\n")
else()
set(KALARMCAL_USE_KRESOURCES "// This library was built to use Akonadi.\n// It must be rebuilt in order to use KResources.\n#ifdef KALARMCAL_USE_KRESOURCES\n#undef KALARMCAL_USE_KRESOURCES\n#endif")
file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/kalarmcal_export.h" "\n// This library was built to use Akonadi.\n// It must be rebuilt in order to use KResources.\n#ifdef KALARMCAL_USE_KRESOURCES\n#undef KALARMCAL_USE_KRESOURCES\n#endif\n")
endif()
# NOTE: kalarmcal_export.h is only generated when cmake is run.
# If it is deleted, 'make' will not regenerate it.
configure_file(kalarmcal_export.h.in ${CMAKE_CURRENT_BINARY_DIR}/kalarmcal_export.h)
kde4_add_library(kalarmcal ${LIBRARY_TYPE} ${kalarmcal_LIB_SRCS})
if(USE_KRESOURCES)
target_link_libraries(kalarmcal
kcal
......
/*
* This file is part of kalarmcal library, which provides access to KAlarm
* calendar data.
* Copyright © 2011-2012 by David Jarvie <djarvie@kde.org>
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as published
* by the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This library 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 Library General Public
* License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
#ifndef KALARMCAL_EXPORT_H
#define KALARMCAL_EXPORT_H
@KALARMCAL_USE_KRESOURCES@
/* needed for KDE_EXPORT and KDE_IMPORT macros */
#include <kdemacros.h>
#ifndef KALARMCAL_EXPORT
# if defined(KDEPIM_STATIC_LIBS)
/* No export/import for static libraries */
# define KALARMCAL_EXPORT
# elif defined(MAKE_KALARMCAL_LIB)
/* We are building this library */
# define KALARMCAL_EXPORT KDE_EXPORT
# else
/* We are using this library */
# define KALARMCAL_EXPORT KDE_IMPORT
# endif
#endif
# ifndef KALARMCAL_EXPORT_DEPRECATED
# define KALARMCAL_EXPORT_DEPRECATED KDE_DEPRECATED KALARMCAL_EXPORT
# define KALARMCAL_DEPRECATED_EXPORT KDE_DEPRECATED KALARMCAL_EXPORT
# define KALARMCAL_DEPRECATED KDE_DEPRECATED
# endif
#endif
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