Clean up CMakeLists.txt
[plasmaplugin.git] / CMakeLists.txt
blob5029ad1228d3dee1c6e2ba9fcca7c5623a9364fa
1 SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules )
3 project(plasmaplugin)
5 find_package(Qt4 REQUIRED)
6 # search packages used by KDE
7 find_package(KDE4 REQUIRED)
8 find_package(Plasma REQUIRED)
9 find_package(X11 REQUIRED)
10 include (KDE4Defaults)
11 include (MacroLibrary)
12 include(MacroOptionalAddSubdirectory)
13 include(MacroOptionalDependPackage)
14 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=default")
16 include(${QT_USE_FILE})
17 message(Qt_Use_file: ${QT_USE_FILE})
19 add_definitions(${QT_DEFINITIONS})
20 add_definitions(-DQT_PLUGIN -DQT_SHARED)
22 include_directories(${CMAKE_SOURCE_DIR}
23                     ${CMAKE_BINARY_DIR}
24                     ${X11_INCLUDE_DIR}
25                     ${KDE4_INCLUDES}
26             ${PLASMA_INCLUDE_DIR}
27                     ${CMAKE_SOURCE_DIR}/qtbrowserplugin
30 set(MOZPLUGIN_INSTALL_DIR $ENV{HOME}/.mozilla/plugins)
31 set(BIN_INSTALL_DIR ${MOZPLUGIN_INSTALL_DIR})
33 set(plasmaplugin_SRCS 
34          src/fullview.cpp
35          src/pluginwidget.cpp
36          qtbrowserplugin/qtbrowserplugin.cpp
37          qtbrowserplugin/qtbrowserplugin_x11.cpp
40 set(plasmaplugin_MOC_HDRS 
41               src/fullview.h
42               src/pluginwidget.h
45 SET(plasmaplugindemo_SRCS
46         src/main.cpp
49 QT4_WRAP_CPP(plasmaplugin_MOC_SRCS ${plasmaplugin_MOC_HDRS})
51 add_library(plasmaplugin MODULE
52             ${plasmaplugin_SRCS}
53                 ${plasmaplugin_MOC_SRCS}
56 add_executable(plasmaplugindemo
57                ${plasmaplugin_SRCS}
58                ${plasmaplugin_MOC_SRCS}
59                ${plasmaplugindemo_SRCS}
62 target_link_libraries(plasmaplugin
63                       ${QT_LIBRARIES}
64                       ${X11_LIBRARIES}
65                       ${PLASMA_LIBS}
66                       ${KDE4_KIO_LIBS})
68 target_link_libraries(plasmaplugindemo
69                       ${QT_LIBRARIES}
70                       ${X11_LIBRARIES}
71                       ${PLASMA_LIBS}
72                       ${KDE4_KIO_LIBS})
74 install(TARGETS plasmaplugin DESTINATION ${MOZPLUGIN_INSTALL_DIR})
75 install(TARGETS plasmaplugindemo DESTINATION ${BIN_INSTALL_DIR})