]> Git trees. - libqmvoc.git/commitdiff
Adjusted CMakeList.txt for Qt4 Only builds and builds of KTouch outside
authorAndreas Nicolai <andreas.nicolai@gmx.net>
Sat, 25 Nov 2006 17:21:32 +0000 (17:21 +0000)
committerAndreas Nicolai <andreas.nicolai@gmx.net>
Sat, 25 Nov 2006 17:21:32 +0000 (17:21 +0000)
from kdeedu.

svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=607760

kdeeduplot/CMakeLists.txt
kdeeduplot/libkdeedu_plot_export.h

index 3f53f2ecd02ecb6d64e8457fb2227bde4f794009..cdfe0803c10713bddc00aede700a86109088bca8 100644 (file)
@@ -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)
index 70104d9fa157c65abdb216b3d226918a3f274ced..28734747b56a95391d9b91626b95cf91fcc0f2ba 100644 (file)
@@ -21,6 +21,8 @@
 #ifndef KDEEDU_PLOT_EXPORT_H
 #define KDEEDU_PLOT_EXPORT_H
 
+#ifndef QT4_ONLY
+
 /* needed for KDE_EXPORT macros */
 #include <kdemacros.h>
 
 #define KDEEDUPLOT_EXPORT KDE_EXPORT
 #endif
 
+#else // QT4_ONLY
+
+#define KDEEDUPLOT_EXPORT QT_EXPORT
+
+#endif // QT4_ONLY
+
+
 #endif