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)
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")
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})
59 SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeModules")
64 FIND_PACKAGE(lame REQUIRED)
65 INCLUDE_DIRECTORIES(${LAME_INCLUDE_DIR})
66 SET(LIBRARIES ${LIBRARIES} ${LAME_LIBRARY})
70 FIND_PACKAGE(id3 REQUIRED)
71 INCLUDE_DIRECTORIES(${ID3_INCLUDE_DIR})
72 SET(LIBRARIES ${LIBRARIES} ${ID3_LIBRARY})
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})
87 ADD_EXECUTABLE(${TARGET} ${SOURCES})
88 TARGET_LINK_LIBRARIES(${TARGET} ${LIBRARIES})
89 ADD_DEPENDENCIES(${TARGET} Version)
93 INSTALL(TARGETS ${TARGET} RUNTIME DESTINATION bin)