Minor build file cleanup.
[gnome-file-browser-applet:gnome-file-browser-applet.git] / CMakeLists.txt
1 CMAKE_MINIMUM_REQUIRED (VERSION 2.4.7)
2
3 PROJECT (FILE_BROWSER_APPLET C)
4
5 #compiler flags
6 SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -g -Wall -ansi")
7 SET (EXEC file-browser-applet)
8
9 #install path options
10 ################################################################################
11 IF (NOT DEFINED CMAKE_INSTALL_PREFIX)
12     SET (CMAKE_INSTALL_PREFIX "/usr")
13 ENDIF (NOT DEFINED CMAKE_INSTALL_PREFIX)
14 MESSAGE (STATUS "Using CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}")
15 ################################################################################
16 IF (NOT DEFINED CMAKE_INSTALL_LIB_PREFIX)
17     SET (CMAKE_INSTALL_LIB_PREFIX "${CMAKE_INSTALL_PREFIX}/lib")
18 ENDIF (NOT DEFINED CMAKE_INSTALL_LIB_PREFIX)
19 MESSAGE (STATUS "Using CMAKE_INSTALL_LIB_PREFIX=${CMAKE_INSTALL_LIB_PREFIX}")
20 ################################################################################
21 IF (NOT DEFINED CMAKE_INSTALL_LIB_EXEC_DIR)
22     SET (CMAKE_INSTALL_LIB_EXEC_DIR "${CMAKE_INSTALL_LIB_PREFIX}/${EXEC}")
23 ENDIF (NOT DEFINED CMAKE_INSTALL_LIB_EXEC_DIR)
24 MESSAGE (STATUS "Using CMAKE_INSTALL_LIB_EXEC_DIR=${CMAKE_INSTALL_LIB_EXEC_DIR}")
25 ################################################################################
26 IF (NOT DEFINED CMAKE_INSTALL_BONOBO_DIR)
27     SET (CMAKE_INSTALL_BONOBO_DIR "${CMAKE_INSTALL_LIB_PREFIX}/bonobo/servers")
28 ENDIF (NOT DEFINED CMAKE_INSTALL_BONOBO_DIR)
29 MESSAGE (STATUS "Using CMAKE_INSTALL_BONOBO_DIR=${CMAKE_INSTALL_BONOBO_DIR}")
30 ################################################################################
31 IF (NOT DEFINED CMAKE_INSTALL_GCONF_SCHEMA_DIR)
32     SET(CMAKE_INSTALL_GCONF_SCHEMA_DIR "${CMAKE_INSTALL_PREFIX}/share/gconf/schemas")
33 ENDIF(NOT DEFINED CMAKE_INSTALL_GCONF_SCHEMA_DIR)
34 MESSAGE (STATUS "Using CMAKE_INSTALL_GCONF_SCHEMA_DIR=${CMAKE_INSTALL_GCONF_SCHEMA_DIR}")
35 ################################################################################
36 IF (NOT DEFINED CMAKE_INSTALL_BUILDER_UI_DIR)
37     SET(CMAKE_INSTALL_BUILDER_UI_DIR "${CMAKE_INSTALL_PREFIX}/share/${EXEC}/builder")
38 ENDIF(NOT DEFINED CMAKE_INSTALL_BUILDER_UI_DIR)
39 MESSAGE (STATUS "Using CMAKE_INSTALL_BUILDER_UI_DIR=${CMAKE_INSTALL_BUILDER_UI_DIR}\n")
40 ################################################################################
41
42 # compile time options
43 SET (ENABLE_CONTEXT_MENU TRUE)
44 #SET (ENABLE_HELP_DOC TRUE)
45
46 ADD_SUBDIRECTORY (data)
47 ADD_SUBDIRECTORY (pixmaps)
48 ADD_SUBDIRECTORY (src)
49
50 #uninstall target
51 CONFIGURE_FILE ("${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
52                 "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
53                 IMMEDIATE @ONLY)
54 ADD_CUSTOM_TARGET (uninstall
55                    "${CMAKE_COMMAND}" -P 
56                    "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
57
58 #target to generate a distribution-ready tarball
59 SET (CPACK_PACKAGE_DESCRIPTION_SUMMARY "File Browser Applet")
60 SET (CPACK_PACKAGE_VENDOR "Axel von Bertoldi")
61 SET (CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
62 SET (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
63 SET (CPACK_PACKAGE_VERSION_MAJOR 0)
64 SET (CPACK_PACKAGE_VERSION_MINOR 6)
65 SET (CPACK_PACKAGE_VERSION_PATCH 5)
66 SET (CPACK_GENERATOR TGZ)
67 SET (CPACK_SOURCE_PACKAGE_FILE_NAME
68     "${EXEC}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
69 SET (CPACK_SOURCE_GENERATOR TGZ)
70 SET (CPACK_SOURCE_IGNORE_FILES
71      "GNOME_FileBrowserApplet_Factory.server$"
72      "config.h$"
73      ".svn"
74      "build"
75      "doc"
76      "po")
77 INCLUDE (CPack)
78
79 ADD_CUSTOM_TARGET (deb checkinstall -D --pkgname="${EXEC}"
80                                        --pkgversion="${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}"
81                                        --install=0
82                                        --deldoc=1
83                                        --backup=0
84                                        --pkglicense="GPLv2"
85                                        --maintainer="bertoldia@gmail.com"
86                                        --pkggroup="GNOME Desktop Environment"
87                                        --requires="libpanel-applet2-0")
88
89 ADD_CUSTOM_TARGET (really-clean rm -fr CMakeCache.txt
90                                        cmake_install.cmake
91                                        ${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.gz
92                                        *.deb
93                                        CPackConfig.cmake
94                                        cmake_uninstall.cmake
95                                        CMakeFiles
96                                        CPackSourceConfig.cmake
97                                        install_manifest.txt
98                                        Makefile
99                                        _CPack_Packages
100                                        pixmaps/CMakeFiles
101                                        pixmaps/cmake_install.cmake
102                                        pixmaps/Makefile
103                                        src/${EXEC}
104                                        src/cmake_install.cmake
105                                        src/config.h
106                                        src/CMakeFiles
107                                        src/Makefile
108                                        data/CMakeFiles
109                                        data/cmake_install.cmake
110                                        data/GNOME_FileBrowserApplet_Factory.server
111                                        data/Makefile) 
112
113 ADD_CUSTOM_TARGET (xgettext xgettext ${CMAKE_CURRENT_SOURCE_DIR}/src/*.c --output-dir=${CMAKE_CURRENT_SOURCE_DIR}/po --from-code="UTF-8" -C --keyword="_")