examples
[duncan/yast2-web-wt.git] / CMakeLists.txt
1 PROJECT(yast2-webui)
2
3 SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O3 -Wall -Woverloaded-virtual" )
4 SET( CMAKE_C_FLAGS   "${CMAKE_C_FLAGS}   -g -O3 -Wall" )
5
6 # Library
7 IF ( DEFINED LIB )
8   SET ( LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${LIB}" )
9 ELSE ( DEFINED  LIB )
10   IF (CMAKE_SIZEOF_VOID_P MATCHES "8")
11     SET( LIB_SUFFIX "64" )
12   ENDIF(CMAKE_SIZEOF_VOID_P MATCHES "8")
13   SET ( LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" )
14 ENDIF ( DEFINED  LIB )
15 MESSAGE(STATUS "Libraries will be installed in ${LIB_INSTALL_DIR}" )
16
17 # where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
18 SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})
19 #SET(CMAKE_MODULE_PATH ${CMAKE_INSTALL_PREFIX}/share/cmake/Modules ${CMAKE_MODULE_PATH})
20
21 SET( PACKAGE "yast2-web" )
22 INCLUDE(${CMAKE_SOURCE_DIR}/VERSION.cmake)
23 SET ( VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}" )
24
25 SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Web UI for YaST")
26 SET(CPACK_PACKAGE_VENDOR "Novell Inc.")
27 #SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/ReadMe.txt")
28 #SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
29 SET(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR})
30 SET(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR})
31 SET(CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH})
32
33 SET( CPACK_GENERATOR "TBZ2")
34 SET( CPACK_SOURCE_GENERATOR "TBZ2")
35 SET( CPACK_SOURCE_PACKAGE_FILE_NAME "${PACKAGE}-${VERSION}" )
36
37 # The following components are regex's to match anywhere (unless anchored)
38 # in absolute path + filename to find files or directories to be excluded
39 # from source tarball.
40 SET (CPACK_SOURCE_IGNORE_FILES
41 "/CVS/;/.svn/;/.libs/;/.deps/;.swp$;.#;/#;/build/"
42 "~$"
43 "\\\\.cvsignore$"
44 "/package"
45 "Makefile\\\\.in$"
46 )
47
48 INCLUDE(CPack)
49
50 FIND_PACKAGE(Wt REQUIRED)
51 FIND_PACKAGE(Yast REQUIRED)
52
53 ####################################################################
54 # RPM SPEC                                                         #
55 ####################################################################
56 MESSAGE(STATUS "Writing spec file...")
57 CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/${PACKAGE}.spec.in ${CMAKE_BINARY_DIR}/package/${PACKAGE}.spec @ONLY)
58
59 ADD_SUBDIRECTORY(src)
60
61 INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
62
63 ADD_CUSTOM_TARGET( svncheck
64   COMMAND cd $(CMAKE_SOURCE_DIR) && ! LC_ALL=C svn status --show-updates --quiet | grep -v '^Status against revision'
65 )
66
67 SET( AUTOBUILD_COMMAND
68   COMMAND ${CMAKE_MAKE_PROGRAM} package_source
69   COMMAND ${CMAKE_COMMAND} -E copy ${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.bz2 ${CMAKE_BINARY_DIR}/package
70   COMMAND ${CMAKE_COMMAND} -E remove ${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.bz2
71   COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/package/${PACKAGE}.changes" "${CMAKE_BINARY_DIR}/package/${PACKAGE}.changes"
72 )
73
74 ADD_CUSTOM_TARGET( autobuild_local
75   ${AUTOBUILD_COMMAND}
76 )
77
78 ADD_CUSTOM_TARGET( autobuild
79   COMMAND ${CMAKE_MAKE_PROGRAM} svncheck
80   ${AUTOBUILD_COMMAND}
81 )
82