<commit_before>cmake_minimum_required(VERSION 2.6)

# additional cmake files
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)

OPTION(ENABLE_POLICYKIT "Enable policykit integration" ON)

if (ENABLE_POLICYKIT)

find_package(PolkitQt-1)

if (NOT POLKITQT-1_LIB_DIR AND NOT POLKITQT-1_INCLUDE_DIR)
    message(WARNING "Qt bindings for policykit are not found. LxQt policykit integration won't be built")
    message(STATUS "Hint: package libpolkit-qt-1-devel on openSUSE")
else ()
    project(lxqt-policykit-agent)

    message(STATUS "PolkitQt-1: ${POLKITQT-1_VERSION_STRING}")
    message(STATUS "      libs: ${POLKITQT-1_CORE_LIBRARY} ${POLKITQT-1_AGENT_LIBRARY}")
    message(STATUS "   include: ${POLKITQT-1_INCLUDE_DIR}")
    
    find_package(PkgConfig)
    pkg_check_modules(POLKIT_AGENT REQUIRED polkit-agent-1)
    message(STATUS "polkit agent: ${POLKIT_AGENT_INCLUDE_DIRS} ${POLKIT_AGENT_LIBRARIES}")

    # lxde-qt tools for cmake
    find_package(LXQT REQUIRED )
    include(${LXQT_USE_FILE})

    find_package(QTXDG REQUIRED QUIET)
    include(${QTXDG_USE_FILE})

    # TODO/FIXME: pkg-config for hardcoded paths
    # pkg-config --cflags glib-2.0
    # pkg-config --cflags polkit-agent-1
    include_directories(
        ${CMAKE_CURRENT_SOURCE_DIR}/src
        ${CMAKE_CURRENT_BINARY_DIR}
        ${POLKIT_AGENT_INCLUDE_DIRS}
        ${POLKITQT-1_INCLUDE_DIR}
    )

    set(lxqt-policykit-agent_SRCS
        src/main.cpp
        src/policykitagent.cpp
        src/policykitagentgui.cpp
    )

    set(lxqt-policykit-agent_H
        src/policykitagent.h
        src/policykitagentgui.h
    )

    set(lxqt-policykit-agent_UI
        src/policykitagentgui.ui
    )

    # Translations **********************************
    include(LxQtTranslate)
    lxqt_translate_ts(lxqt-policykit-agent_QM_FILES
        SOURCES
            ${lxqt-policykit-agent_H}
            ${lxqt-policykit-agent_SRCS}
            ${lxqt-policykit-agent_UI}
    )
    #************************************************
    
    QT4_WRAP_CPP(lxqt-policykit-agent_MOCS ${lxqt-policykit-agent_H})
    QT4_WRAP_UI(lxqt-policykit-agent_UI_CPP ${lxqt-policykit-agent_UI})

    add_executable(lxqt-policykit-agent
        ${lxqt-policykit-agent_SRCS}
        ${lxqt-policykit-agent_MOCS}
        ${lxqt-policykit-agent_UI_CPP}
        ${lxqt-policykit-agent_QM_FILES}
    )

    target_link_libraries(lxqt-policykit-agent
        ${QT_QTCORE_LIBRARY}
        ${QT_QTGUI_LIBRARY}
        ${QTXDG_LIBRARY}
        ${LXQT_LIBRARIES}
        ${POLKITQT-1_CORE_LIBRARY}
        ${POLKITQT-1_AGENT_LIBRARY}
        ${POLKIT_AGENT_LIBRARIES}
    )
    
    # install
    install(TARGETS lxqt-policykit-agent DESTINATION bin)

endif()

endif (ENABLE_POLICYKIT)
<commit_msg>Add CPack rules for creating tarball<commit_after>cmake_minimum_required(VERSION 2.6)

# additional cmake files
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)

OPTION(ENABLE_POLICYKIT "Enable policykit integration" ON)

if (ENABLE_POLICYKIT)

find_package(PolkitQt-1)

if (NOT POLKITQT-1_LIB_DIR AND NOT POLKITQT-1_INCLUDE_DIR)
    message(WARNING "Qt bindings for policykit are not found. LxQt policykit integration won't be built")
    message(STATUS "Hint: package libpolkit-qt-1-devel on openSUSE")
else ()
    project(lxqt-policykit-agent)

    message(STATUS "PolkitQt-1: ${POLKITQT-1_VERSION_STRING}")
    message(STATUS "      libs: ${POLKITQT-1_CORE_LIBRARY} ${POLKITQT-1_AGENT_LIBRARY}")
    message(STATUS "   include: ${POLKITQT-1_INCLUDE_DIR}")
    
    find_package(PkgConfig)
    pkg_check_modules(POLKIT_AGENT REQUIRED polkit-agent-1)
    message(STATUS "polkit agent: ${POLKIT_AGENT_INCLUDE_DIRS} ${POLKIT_AGENT_LIBRARIES}")

    # lxde-qt tools for cmake
    find_package(LXQT REQUIRED )
    include(${LXQT_USE_FILE})

    find_package(QTXDG REQUIRED QUIET)
    include(${QTXDG_USE_FILE})

    # TODO/FIXME: pkg-config for hardcoded paths
    # pkg-config --cflags glib-2.0
    # pkg-config --cflags polkit-agent-1
    include_directories(
        ${CMAKE_CURRENT_SOURCE_DIR}/src
        ${CMAKE_CURRENT_BINARY_DIR}
        ${POLKIT_AGENT_INCLUDE_DIRS}
        ${POLKITQT-1_INCLUDE_DIR}
    )

    set(lxqt-policykit-agent_SRCS
        src/main.cpp
        src/policykitagent.cpp
        src/policykitagentgui.cpp
    )

    set(lxqt-policykit-agent_H
        src/policykitagent.h
        src/policykitagentgui.h
    )

    set(lxqt-policykit-agent_UI
        src/policykitagentgui.ui
    )

    # Translations **********************************
    include(LxQtTranslate)
    lxqt_translate_ts(lxqt-policykit-agent_QM_FILES
        SOURCES
            ${lxqt-policykit-agent_H}
            ${lxqt-policykit-agent_SRCS}
            ${lxqt-policykit-agent_UI}
    )
    #************************************************
    
    QT4_WRAP_CPP(lxqt-policykit-agent_MOCS ${lxqt-policykit-agent_H})
    QT4_WRAP_UI(lxqt-policykit-agent_UI_CPP ${lxqt-policykit-agent_UI})

    add_executable(lxqt-policykit-agent
        ${lxqt-policykit-agent_SRCS}
        ${lxqt-policykit-agent_MOCS}
        ${lxqt-policykit-agent_UI_CPP}
        ${lxqt-policykit-agent_QM_FILES}
    )

    target_link_libraries(lxqt-policykit-agent
        ${QT_QTCORE_LIBRARY}
        ${QT_QTGUI_LIBRARY}
        ${QTXDG_LIBRARY}
        ${LXQT_LIBRARIES}
        ${POLKITQT-1_CORE_LIBRARY}
        ${POLKITQT-1_AGENT_LIBRARY}
        ${POLKIT_AGENT_LIBRARIES}
    )
    
    # install
    install(TARGETS lxqt-policykit-agent DESTINATION bin)

endif()

endif (ENABLE_POLICYKIT)

# building tarball with CPack -------------------------------------------------
include (InstallRequiredSystemLibraries)
set (CPACK_PACKAGE_VERSION_MAJOR ${LXQT_MAJOR_VERSION})
set (CPACK_PACKAGE_VERSION_MINOR ${LXQT_MINOR_VERSION})
set (CPACK_PACKAGE_VERSION_PATCH ${LXQT_PATCH_VERSION})
set (CPACK_GENERATOR TBZ2)
set (CPACK_SOURCE_GENERATOR TBZ2)
set (CPACK_SOURCE_IGNORE_FILES /build/;.gitignore;.*~;.git;.kdev4;temp)
include (CPack)

{'fraction_non_alphanumeric': 0.1322011322011322, 'fraction_numerical': 0.00715950715950716, 'mean_word_length': 3.403958944281525, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3044707', 'n_tokens_mistral': 2380, 'n_tokens_neox': 2194, 'n_words': 293}