summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoudhayan Gupta <me@BaloneyGeek.com>2015-09-26 11:07:22 (GMT)
committerBoudhayan Gupta <me@BaloneyGeek.com>2015-09-26 11:07:22 (GMT)
commit8de9e3158624292243e10ab64bd14652e0dd472a (patch)
treee57b934616b1a4d383e062486a957499d4ac047e
parent8da63fa7814aeecb9262ff028733d689e85ce579 (diff)
Generate export headers through CMake. Bumps CMake req to 3.0.2
-rw-r--r--CMakeLists.txt11
-rw-r--r--src/CMakeLists.txt3
-rw-r--r--src/kcompactdisc.h18
3 files changed, 10 insertions, 22 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fd57c04..4442bd9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,5 @@
-´╗┐cmake_minimum_required(VERSION 2.8.12)
-project(libkcompactdisc)
+´╗┐cmake_minimum_required(VERSION 3.0.2)
+project(libkcompactdisc VERSION 5.0.0)
set(QT5_REQUIRED_VERSION 5.4.0)
set(KF5_REQUIRED_VERSION 5.13.0)
@@ -10,15 +10,16 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_D
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings)
-include(ECMPackageConfigHelpers)
+include(CMakePackageConfigHelpers)
include(ECMGenerateHeaders)
include(ECMSetupVersion)
include(ECMGeneratePriFile)
+include(GenerateExportHeader)
include(FeatureSummary)
# Version Setup
-ecm_setup_version("5.0.0"
+ecm_setup_version(PROJECT
VARIABLE_PREFIX KCOMPACTDISC
VERSION_HEADER ${CMAKE_CURRENT_BINARY_DIR}/kcompactdisc_version.h
PACKAGE_VERSION_FILE ${CMAKE_CURRENT_BINARY_DIR}/KF5CompactDiscConfigVersion.cmake
@@ -45,7 +46,7 @@ add_subdirectory(tests)
set(CMAKECONFIG_INSTALL_DIR ${CMAKECONFIG_INSTALL_PREFIX}/KF5CompactDisc)
-ecm_configure_package_config_file(
+configure_package_config_file(
${CMAKE_CURRENT_SOURCE_DIR}/KF5CompactDiscConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/KF5CompactDiscConfig.cmake
INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index b633bf2..f07cd05 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -88,6 +88,7 @@ ecm_generate_headers(KCOMPACTDISC_HEADERS
PREFIX KCompactDisc
REQUIRED_HEADERS KCOMPACTDISC_REQ_HEADERS
)
+generate_export_header(KF5CompactDisc BASE_NAME kcompactdisc)
ecm_generate_pri_file(
BASE_NAME KCompactDisc
@@ -96,7 +97,9 @@ ecm_generate_pri_file(
FILENAME_VAR PRI_FILENAME
)
+
install(TARGETS KF5CompactDisc EXPORT KF5CompactDiscTargets ${INSTALL_TARGETS_DEFAULT_ARGS})
install(FILES ${KCOMPACTDISC_HEADERS} DESTINATION ${KF5_INCLUDE_INSTALL_DIR}/KCompactDisc/KCompactDisc COMPONENT Devel)
install(FILES ${KCOMPACTDISC_REQ_HEADERS} DESTINATION ${KF5_INCLUDE_INSTALL_DIR}/KCompactDisc/kcompactdisc COMPONENT Devel)
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/kcompactdisc_export.h DESTINATION ${KF5_INCLUDE_INSTALL_DIR}/KCompactDisc/kcompactdisc COMPONENT Devel)
install(FILES ${PRI_FILENAME} DESTINATION ${ECM_MKSPECS_INSTALL_DIR})
diff --git a/src/kcompactdisc.h b/src/kcompactdisc.h
index 0a0b8b0..6c15a87 100644
--- a/src/kcompactdisc.h
+++ b/src/kcompactdisc.h
@@ -27,23 +27,7 @@
#include <QUrl>
#include <QTimer>
-#include <kdemacros.h>
-
-#if defined Q_OS_WIN
-
-#ifndef KCOMPACTDISC_EXPORT
-# ifdef MAKE_KCOMPACTDISC_LIB
-# define KCOMPACTDISC_EXPORT KDE_EXPORT
-# else
-# define KCOMPACTDISC_EXPORT KDE_IMPORT
-# endif
-#endif
-
-#else /* UNIX */
-
-/* export statements for unix */
-#define KCOMPACTDISC_EXPORT KDE_EXPORT
-#endif
+#include "kcompactdisc_export.h"
class KCompactDiscPrivate;