updated on Thu Jan 19 12:17:07 UTC 2012
[aur-mirror.git] / plasmaplugin-git / CMakeLists.txt
blob4cba1ed35b4395c665e667fd5a8280a02ad7a1b8
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)
15 if(UNIX)
16     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=default")
17 endif(UNIX)
19 include(${QT_USE_FILE})
20 message(Qt_Use_file: ${QT_USE_FILE})
22 add_definitions(${QT_DEFINITIONS})
23 add_definitions(-DQT_PLUGIN -DQT_SHARED)
25 include_directories(${CMAKE_SOURCE_DIR}
26                     ${CMAKE_BINARY_DIR}
27                     ${X11_INCLUDE_DIR}
28                     ${KDE4_INCLUDES}
29             ${KDE4_INCLUDE_DIR}
30                     ${CMAKE_SOURCE_DIR}/qtbrowserplugin
33 if(WIN32)
34     set(MOZPLUGIN_INSTALL_DIR "C:/Program Files/Mozilla Firefox/plugins")
35 endif(WIN32)
37 if(UNIX)
38     set(MOZPLUGIN_INSTALL_DIR /usr/lib/mozilla/plugins)
39 endif(UNIX)
41 set(BIN_INSTALL_DIR ${MOZPLUGIN_INSTALL_DIR})
43 if(WIN32)
44    ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/plasmaplugin.obj
45                         COMMAND windres.exe
46                             -I${CMAKE_CURRENT_SOURCE_DIR}
47                             -o ${CMAKE_CURRENT_BINARY_DIR}/plasmaplugin.obj
48                             < ${CMAKE_CURRENT_SOURCE_DIR}/src/plasmaplugin.rc
49                         )
50 endif(WIN32)
52 set(plasmaplugin_SRCS 
53          src/fullview.cpp
54          src/pluginwidget.cpp
55          qtbrowserplugin/qtbrowserplugin.cpp
58 if(UNIX)
59     set(plasmaplugin_SRCS
60         ${plasmaplugin_SRCS}
61         qtbrowserplugin/qtbrowserplugin_x11.cpp
62     )
63 endif(UNIX)
65 if(WIN32)
66     set(plasmaplugin_SRCS
67         ${plasmaplugin_SRCS}
68         qtbrowserplugin/qtbrowserplugin_win.cpp
69         ${CMAKE_CURRENT_BINARY_DIR}/plasmaplugin.obj 
70     )
71 endif(WIN32)
73 set(plasmaplugin_MOC_HDRS 
74               src/fullview.h
75               src/pluginwidget.h
78 SET(plasmaplugindemo_SRCS
79         src/main.cpp
82 QT4_WRAP_CPP(plasmaplugin_MOC_SRCS ${plasmaplugin_MOC_HDRS})
84 add_library(plasmaplugin MODULE
85             ${plasmaplugin_SRCS}
86                 ${plasmaplugin_MOC_SRCS}
89 add_executable(plasmaplugindemo
90                ${plasmaplugin_SRCS}
91                ${plasmaplugin_MOC_SRCS}
92                ${plasmaplugindemo_SRCS}
95 if(WIN32)
96     set_target_properties(plasmaplugin PROPERTIES LINK_FLAGS
97                       "-enable-stdcall-fixup -Wl,${CMAKE_SOURCE_DIR}/qtbrowserplugin/qtbrowserplugin.def"
98     )
99 endif(WIN32)
101 target_link_libraries(plasmaplugin
102                       ${QT_LIBRARIES}
103                       ${X11_LIBRARIES}
104                       ${KDE4_PLASMA_LIBS}
105                       ${KDE4_KIO_LIBS})
107 target_link_libraries(plasmaplugindemo
108                       ${QT_LIBRARIES}
109                       ${X11_LIBRARIES}
110                       ${KDE4_PLASMA_LIBS}
111                       ${KDE4_KIO_LIBS})
113 install(TARGETS plasmaplugin DESTINATION ${MOZPLUGIN_INSTALL_DIR})
114 install(TARGETS plasmaplugindemo DESTINATION ${BIN_INSTALL_DIR})