project(qonjugatorplugin_it)
cmake_minimum_required(VERSION 2.6)

### don't create the uninstall rule if this plugin is compiled as part of the Qonjugator package
if (qonjugator_compile_not_standalone)
	set(qonjugator_uninstall_rule_created TRUE)
endif (qonjugator_compile_not_standalone)

### find the Qonjugator library and set some useful definitions
find_package(QonjugatorLib REQUIRED)
add_definitions(-DQT_NO_DEBUG -DQT_SHARED)
include_directories(${QONJUGATOR_INCLUDES})

### include custom paths defined by the user
include(ConfigureCustom.cmake)

### tell the user where we will install everything
message("Italian Plugin")
message("   The plugin will be installed in ${QONJUGATOR_PLUGINSDIR}")
message("   The translations will be installed in ${QONJUGATOR_TRANSLATIONSDIR}")

### compile
set(qonjugatorplugin_it_SRCS
    qonjugator_it.cpp
    qonjugator_itcontext.cpp
    qonjugator_itirreg.cpp)
set(qonjugatorplugin_it_MOC_HDRS
    qonjugator_it.h)
qt4_wrap_cpp(qonjugatorplugin_it_MOC_SRCS
             ${qonjugatorplugin_it_MOC_HDRS})
qt4_add_resources(qonjugatorplugin_it_RSRCS
                  qonjugator_it.qrc)
qt4_add_translation(qonjugatorplugin_it_TRANS
                    qonjugatorplugin_it_es.ts
                    qonjugatorplugin_it_fr.ts)

add_library(qonjugatorplugin_it
            SHARED
            ${qonjugatorplugin_it_SRCS}
            ${qonjugatorplugin_it_MOC_SRCS}
            ${qonjugatorplugin_it_RSRCS}
            ${qonjugatorplugin_it_TRANS})
target_link_libraries(qonjugatorplugin_it
                      ${QT_LIBRARIES} ${QONJUGATOR_LIBRARIES})

### install
install(TARGETS qonjugatorplugin_it
        DESTINATION ${QONJUGATOR_PLUGINSDIR})
install(FILES ${qonjugatorplugin_it_TRANS}
        DESTINATION ${QONJUGATOR_TRANSLATIONSDIR})
