CMakeLists.txt
changeset 1 6a9a25d32364
child 2 a48121a74017
equal deleted inserted replaced
0:6784d21ed078 1:6a9a25d32364
       
     1 ## Copyright 2010 Cornu Nicolas
       
     2 # This file is part of mcabber module writing howto examples.
       
     3 #
       
     4 # Examples are free software: you can redistribute it and/or modify
       
     5 # it under the terms of the GNU General Public License as published by
       
     6 # the Free Software Foundation, either version 2 of the License, or
       
     7 # (at your option) any later version.
       
     8 #
       
     9 # This program is distributed in the hope that it will be useful,
       
    10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       
    12 # GNU General Public License for more details.
       
    13 #
       
    14 # You should have received a copy of the GNU General Public License
       
    15 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
       
    16 
       
    17 cmake_minimum_required(VERSION 2.6) 
       
    18 project(Notify) 
       
    19 set(PROJECT_VERSION "0.0.1")
       
    20 
       
    21 ## User settable options
       
    22  
       
    23 ## Check for build dependencies
       
    24 find_package(PkgConfig REQUIRED) 
       
    25 pkg_check_modules(GLIB REQUIRED glib-2.0) 
       
    26 pkg_check_modules(GTK REQUIRED gtk+-2.0) 
       
    27 pkg_check_modules(LM REQUIRED loudmouth-1.0) 
       
    28 pkg_check_modules(MCABBER REQUIRED mcabber)
       
    29 link_directories(${GLIB_LIBRARY_DIRS}
       
    30 				 ${LM_LIBRARY_DIRS}
       
    31 				 ${MCABBER_LIBRARY_DIRS}
       
    32 				 ${GTK_LIBRARY_DIRS})
       
    33 
       
    34 ## Target definitions
       
    35 add_library(jingle MODULE jingle.c) 
       
    36 
       
    37 ## Compiler setup
       
    38 #configure_file(config.h.in config.h)
       
    39 include_directories(SYSTEM ${GLIB_INCLUDE_DIRS} 
       
    40                     ${LM_INCLUDE_DIRS}
       
    41 					${MCABBER_INCLUDE_DIRS}
       
    42 					${GTK_INCLUDE_DIRS})
       
    43 target_link_libraries(jingle ${GLIB_LIBRARIES} 
       
    44 					  ${LM_LIBRARIES}
       
    45 					  ${MCABBER_LIBRARIES}
       
    46 					  ${GTK_LIBRARIES}
       
    47 					 )
       
    48 include_directories(${notify_SOURCE_DIR} 
       
    49                     ${notify_BINARY_DIR})
       
    50 set_target_properties(jingle PROPERTIES COMPILE_FLAGS "-Wall")
       
    51 
       
    52 ## Packaging information
       
    53 set(CPACK_PACKAGE_NAME libmcabber-jingle)
       
    54 set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
       
    55 set(CPACK_PACKAGE_VENDOR "alkino")
       
    56 set(CPACK_PACKAGE_CONTACT "Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>")
       
    57 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Some notification for Mcabber")
       
    58 #set(CPACK_RESOURCE_FILE_LICENSE ${notify_SOURCE_DIR}/COPYING)
       
    59 set(CPACK_SOURCE_GENERATOR TBZ2)
       
    60 set(CPACK_GENERATOR DEB CACHE TEXT "Binary package generator, eg DEB, RPM, TGZ, NSIS...")
       
    61 set(CPACK_DEBIAN_PACKAGE_SECTION libs)
       
    62 find_program(DPKG_EXECUTABLE dpkg)
       
    63 if(DPKG_EXECUTABLE)
       
    64 	execute_process(COMMAND ${DPKG_EXECUTABLE} --print-architecture OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE)
       
    65 else()
       
    66 	set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE i386 CACHE TEXT "Architecture of package")
       
    67 endif()
       
    68 set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
       
    69 set(CPACK_SOURCE_IGNORE_FILES "/\\\\..*;\\\\.swp;~$;/build/;\\\\.tar\\\\.;\\\\.deb;\\\\.so")
       
    70 include(CPack)
       
    71 
       
    72 ## Installation
       
    73 install(TARGETS jingle DESTINATION lib/mcabber)