Fix bug with calls on hold
[skype-call-recorder.git] / CMakeLists.txt
blobc83e2186aae1a9e1c9aa6dfe0494a2a2cfe3395d
2 # versions before 2.4.8 do not seem to know about Qt's DBus
3 CMAKE_MINIMUM_REQUIRED(VERSION 2.4.8 FATAL_ERROR)
5 PROJECT(skype-call-recorder)
6 SET(TARGET skype-call-recorder)
8 SET(CMAKE_BUILD_TYPE RELEASE)
9 #SET(CMAKE_BUILD_TYPE DEBUG)
11 # compiler flags
13 SET(CMAKE_CXX_FLAGS "-Wall -W -pipe -fno-rtti -fno-exceptions")
14 SET(CMAKE_CXX_FLAGS_DEBUG "-ggdb")
15 SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -s")
17 # sources
19 SET(SOURCES
20         about.cpp
21         call.cpp
22         callgui.cpp
23         common.cpp
24         mp3writer.cpp
25         preferences.cpp
26         recorder.cpp
27         skype.cpp
28         trayicon.cpp
29         utils.cpp
30         version.cpp
31         wavewriter.cpp
32         writer.cpp
35 SET(MOC_HEADERS
36         call.h
37         callgui.h
38         preferences.h
39         recorder.h
40         skype.h
41         smartwidgets.h
42         trayicon.h
45 SET(RESOURCES resources.qrc)
47 # generation of version.cpp
49 ADD_CUSTOM_TARGET(Version
50         ${CMAKE_CURRENT_SOURCE_DIR}/makeversion ${CMAKE_CURRENT_SOURCE_DIR}
51         COMMENT "Checking version.cpp" VERBATIM)
52 SET_SOURCE_FILES_PROPERTIES(version.cpp PROPERTIES GENERATED TRUE)
53 SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES version.cpp)
54 # required when building out of source, so version.cpp finds headers
55 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
57 # external libraries
59 SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeModules")
60 SET(LIBRARIES)
62 # lame
64 FIND_PACKAGE(lame REQUIRED)
65 INCLUDE_DIRECTORIES(${LAME_INCLUDE_DIR})
66 SET(LIBRARIES ${LIBRARIES} ${LAME_LIBRARY})
68 # id3
70 FIND_PACKAGE(id3 REQUIRED)
71 INCLUDE_DIRECTORIES(${ID3_INCLUDE_DIR})
72 SET(LIBRARIES ${LIBRARIES} ${ID3_LIBRARY})
74 # Qt
76 SET(QT_USE_QTDBUS TRUE)
77 SET(QT_USE_QTNETWORK TRUE)
78 FIND_PACKAGE(Qt4 REQUIRED)
79 INCLUDE(${QT_USE_FILE})
80 SET(LIBRARIES ${LIBRARIES} ${QT_LIBRARIES})
81 QT4_WRAP_CPP(MOC_SOURCES ${MOC_HEADERS})
82 QT4_ADD_RESOURCES(RESOURCES_SOURCES ${RESOURCES})
83 SET(SOURCES ${SOURCES} ${MOC_SOURCES} ${RESOURCES_SOURCES})
85 # main target
87 ADD_EXECUTABLE(${TARGET} ${SOURCES})
88 TARGET_LINK_LIBRARIES(${TARGET} ${LIBRARIES})
89 ADD_DEPENDENCIES(${TARGET} Version)
91 # installation
93 INSTALL(TARGETS ${TARGET} RUNTIME DESTINATION bin)