From: Andreas Nicolai Date: Sat, 25 Nov 2006 17:21:32 +0000 (+0000) Subject: Adjusted CMakeList.txt for Qt4 Only builds and builds of KTouch outside X-Git-Tag: v3.80.3~104 X-Git-Url: https://git.rmz.fi/?a=commitdiff_plain;h=90f5bc4b89ffdd86fa83cfa77d83b7bdcbe5260d;p=libqmvoc.git Adjusted CMakeList.txt for Qt4 Only builds and builds of KTouch outside from kdeedu. svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=607760 --- diff --git a/kdeeduplot/CMakeLists.txt b/kdeeduplot/CMakeLists.txt index 3f53f2e..cdfe080 100644 --- a/kdeeduplot/CMakeLists.txt +++ b/kdeeduplot/CMakeLists.txt @@ -1,30 +1,65 @@ -add_subdirectory( tests ) +# for the kdeeduplot library we have different build options depending on +# whether we build with Qt4 only or with kde -########### next target ############### +# *** common variables *** -set(kdeeduplot_LIB_SRCS - kplotobject.cpp - kplotaxis.cpp - kplotwidget.cpp +# sources for the kdeeduplot library +set( kdeeduplot_LIB_SRCS + kplotobject.cpp + kplotaxis.cpp + kplotwidget.cpp ) -kde4_automoc(${kdeeduplot_LIB_SRCS}) +if (COMPILE_WITH_QT4_ONLY) -kde4_add_library(kdeeduplot SHARED ${kdeeduplot_LIB_SRCS}) + # generate moc files automatically (requires that the + # moc files are included in the cpp files) + qt4_automoc(${kdeeduplot_LIB_SRCS}) -target_link_libraries(kdeeduplot ${KDE4_KDEUI_LIBS} ) + # add the definition for a QT4_ONLY build + add_definitions( -DQT4_ONLY ) + + # set include directories for a Qt4 build + include_directories( + ${QT_INCLUDES} + ${CMAKE_BINARY_DIR}/kdeeduplot + ) -set_target_properties(kdeeduplot PROPERTIES VERSION 1.2.0 SOVERSION 1 ) -install(TARGETS kdeeduplot DESTINATION ${LIB_INSTALL_DIR} ) + # build the kdeeduplot library + add_library(kdeeduplot SHARED ${kdeeduplot_LIB_SRCS}) + + # link Qt4 libraries so that users of the kdeeduplot lib do + # not have to worry about these dependencies + target_link_libraries(kdeeduplot ${QT_LIBRARIES} ) + +else (COMPILE_WITH_QT4_ONLY) + # build test program in the tests subdir + add_subdirectory( tests ) -########### install files ############### + # generate moc files automatically (requires that the + # moc files are included in the cpp files) + kde4_automoc(${kdeeduplot_LIB_SRCS}) -install(FILES - libkdeedu_plot_export.h - kplotobject.h - kplotaxis.h - kplotwidget.h DESTINATION ${INCLUDE_INSTALL_DIR}/libkdeedu -) + # build the kdeeduplot library as shared lib + kde4_add_library(kdeeduplot SHARED ${kdeeduplot_LIB_SRCS}) + + # link kdeui library so that users of the kdeeduplot lib do + # not have to worry about these dependencies + target_link_libraries(kdeeduplot ${KDE4_KDEUI_LIBS} ) + + # set the properties for the build + set_target_properties(kdeeduplot PROPERTIES VERSION 1.2.0 SOVERSION 1 ) + + # install the binary library file into the KDE library directory + install(TARGETS kdeeduplot DESTINATION ${LIB_INSTALL_DIR} ) + # install the header files for the kdeeduplot library + install(FILES + libkdeedu_plot_export.h + kplotobject.h + kplotaxis.h + kplotwidget.h DESTINATION ${INCLUDE_INSTALL_DIR}/libkdeedu + ) +endif (COMPILE_WITH_QT4_ONLY) diff --git a/kdeeduplot/libkdeedu_plot_export.h b/kdeeduplot/libkdeedu_plot_export.h index 70104d9..2873474 100644 --- a/kdeeduplot/libkdeedu_plot_export.h +++ b/kdeeduplot/libkdeedu_plot_export.h @@ -21,6 +21,8 @@ #ifndef KDEEDU_PLOT_EXPORT_H #define KDEEDU_PLOT_EXPORT_H +#ifndef QT4_ONLY + /* needed for KDE_EXPORT macros */ #include @@ -39,4 +41,11 @@ #define KDEEDUPLOT_EXPORT KDE_EXPORT #endif +#else // QT4_ONLY + +#define KDEEDUPLOT_EXPORT QT_EXPORT + +#endif // QT4_ONLY + + #endif