File: CMakeLists.txt

package info (click to toggle)
fatrat-unpack 1.1.2-1
  • links: PTS, VCS
  • area: non-free
  • in suites: squeeze
  • size: 1,104 kB
  • ctags: 2,579
  • sloc: cpp: 18,714; makefile: 6
file content (117 lines) | stat: -rw-r--r-- 2,679 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
project(fatrat-unpack)
add_subdirectory(unrar)

cmake_minimum_required(VERSION 2.4.0)
if(COMMAND cmake_policy)
	cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)

find_package(Qt4 REQUIRED)

set(CMAKE_MODULE_PATH cmake_modules)

if(WITH_EVERYTHING)
	set(WITH_NLS ON)
	set(WITH_ZIP ON)
endif(WITH_EVERYTHING)

set(fatrat_DIR ${CMAKE_MODULE_PATH})
find_package(fatrat REQUIRED)

set(QT_USE_QTNETWORK TRUE)
set(QT_USE_QTXML TRUE)

if(FATRAT_FOUND)
	message(STATUS "fatrat found OK")
	include_directories(${FATRAT_INCLUDE_DIRS})
else(FATRAT_FOUND)
	message(FATAL_ERROR "No FatRat development headers found")
endif(FATRAT_FOUND)

if(WITH_ZIP)
	set(libzip_DIR ${CMAKE_MODULE_PATH})
	find_package(libzip REQUIRED)
	
	if(LIBZIP_FOUND)
		message(STATUS "libzip found OK: ${LIBZIP_LIBRARY}")
		include_directories(${LIBZIP_INCLUDE_DIRS})
	else(LIBZIP_FOUND)
		message(FATAL_ERROR "No libzip")
	endif(LIBZIP_FOUND)
endif(WITH_ZIP)

include( ${QT_USE_FILE} )
add_definitions(${QT_DEFINITIONS})
add_definitions(-fvisibility=hidden)

if(CMAKE_BUILD_TYPE MATCHES Debug)
	ADD_DEFINITIONS(-ggdb)
	ADD_DEFINITIONS(-DDEBUG)
	ADD_DEFINITIONS(-Wall)
endif(CMAKE_BUILD_TYPE MATCHES Debug)

include_directories(./ ${CMAKE_CURRENT_BINARY_DIR} ${QT_INCLUDE_DIR})
CONFIGURE_FILE(config.h.in config.h)

set(fatrat-unpack_SRCS
	fr_unpack.cpp
	Unpacker.cpp
	RarUnpacker.cpp
	UnpackDlg.cpp
	)

set(fatrat-unpack_MOC_HDRS
	RarUnpacker.h
	UnpackDlg.h
	Unpacker.h
	PasswordDlg.h
	PipeDlg.h
	)

set(fatrat-unpack_UIS
	ProgressWidget.ui
	PasswordDlg.ui
	UnpackDlg.ui
	FilesDlg.ui
	PipeDlg.ui
	)

if(WITH_ZIP)
	set(fatrat-unpack_SRCS
		${fatrat-unpack_SRCS}
		ZipUnpacker.cpp
	)
endif(WITH_ZIP)

qt4_wrap_cpp(fatrat-unpack_MOC_SRCS ${fatrat-unpack_MOC_HDRS})

set(fatrat-unpack_RCS
	#gfx/opensubtitles.qrc
)

qt4_wrap_ui(fatrat-unpack_UIS_H ${fatrat-unpack_UIS})
qt4_add_translation(lrelease_outputs locale/fatrat-unpack_cs_CZ.ts locale/fatrat-unpack_sk_SK.ts locale/fatrat-unpack_tr_TR.ts)

add_library(fatrat-unpack SHARED ${fatrat-unpack_SRCS} ${fatrat-unpack_MOC_SRCS} ${fatrat-unpack_UIS_H} ${fatrat-unpack_QRC_H} ${lrelease_outputs})
#add_dependencies(fatrat-unpack unrar)

target_link_libraries(fatrat-unpack ${QT_LIBRARIES} ${LIBZIP_LIBRARY} unrar)

if(WITH_NLS)
	install(FILES ${lrelease_outputs} DESTINATION share/fatrat/lang)
endif(WITH_NLS)

install(TARGETS fatrat-unpack DESTINATION lib/fatrat/plugins)

install(FILES
	${CMAKE_CURRENT_SOURCE_DIR}/data/pipecmds
	DESTINATION share/fatrat/data/plugins/fatrat-unpack
	)

install(FILES
        ${CMAKE_CURRENT_SOURCE_DIR}/data/TRANSLATIONS
        ${CMAKE_CURRENT_SOURCE_DIR}/data/3RDPARTIES
        DESTINATION share/doc/fatrat-unpack
        )