project( smb4k )

set( VERSION 0.10.4 )
set( VERSION_MAJOR 0 )
set( VERSION_MINOR 10 )
set( VERSION_PATCH 4 )

cmake_minimum_required( VERSION 2.6 )

find_package(KDE4 REQUIRED)

include(KDE4Defaults)
include(MacroLibrary)
include(FindGettext)
include(ConvenienceLibs.cmake)
include(ConfigureChecks.cmake)

# Disallow in-source builds
# macro_ensure_out_of_source_build( "Smb4K requires an out of source build. Please create a separate build directory and
# run 'cmake [options] <path_to_source_directory>' there." )

add_definitions( ${QT_DEFINITIONS} ${KDE4_DEFINITIONS})

include_directories( ${KDE4_INCLUDES}
                     ${KDE4_INCLUDE_DIR}
                     ${QT_INCLUDES}
                     ${CMAKE_CURRENT_SOURCE_DIR}
                     ${CMAKE_CURRENT_BINARY_DIR} )

configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake
                ${CMAKE_CURRENT_BINARY_DIR}/config.h )

add_subdirectory( core )
add_subdirectory( smb4k )
add_subdirectory( utilities )
add_subdirectory( po )
add_subdirectory( doc )
add_subdirectory( data )

########### Konqueror plugin ############

# The decision what to do with the Konqueror plugin has been
# postponed. It has not been ported to KDE 4 yet, so it is
# disabled here.

# option( COMPILE_KONQPLUGIN "Compile Smb4K with Konqueror plugin" OFF )
#
# if( COMPILE_KONQPLUGIN )
#   message( STATUS "Building Konqueror plugin (-DCOMPILE_KONQPLUGIN=false to disable)" )
#   add_subdirectory( plugin )
# elseif( NOT COMPILE_KONQPLUGIN )
#   message( STATUS "Building without Konqueror plugin (-DCOMPILE_KONQPLUGIN=true to enable)" )
# endif( COMPILE_KONQPLUGIN )

########### install files ###############



########### CPack part ##################

set( CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR} )
set( CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR} )
set( CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH} )

set( CPACK_SOURCE_PACKAGE_FILE_NAME smb4k-${VERSION}
     CACHE INTERNAL "source package base name" )
set( CPACK_SOURCE_GENERATOR TBZ2 )
set( CPACK_SOURCE_IGNORE_FILES
     "~$"
     "^${PROJECT_SOURCE_DIR}.*/CVS/"
     "^${PROJECT_SOURCE_DIR}/Messages.sh"
     "^${PROJECT_SOURCE_DIR}/po/scripts/"
     "^${PROJECT_SOURCE_DIR}.*kdevelop*" )

include( CPack )
