project(qonjugatorplugin_es)
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("Spanish Plugin")
message("   The plugin will be installed in ${QONJUGATOR_PLUGINSDIR}")
message("   The translations will be installed in ${QONJUGATOR_TRANSLATIONSDIR}")

### compile
set(qonjugatorplugin_es_SRCS
    qonjugator_es.cpp
    qonjugator_esirreg.cpp)
set(qonjugatorplugin_es_MOC_HDRS
    qonjugator_es.h)
qt4_wrap_cpp(qonjugatorplugin_es_MOC_SRCS
             ${qonjugatorplugin_es_MOC_HDRS})
qt4_add_resources(qonjugatorplugin_es_RSRCS
                  qonjugator_es.qrc)
qt4_add_translation(qonjugatorplugin_es_TRANS
                    qonjugatorplugin_es_es.ts
                    qonjugatorplugin_es_fr.ts)

add_library(qonjugatorplugin_es
            SHARED
            ${qonjugatorplugin_es_SRCS}
            ${qonjugatorplugin_es_MOC_SRCS}
            ${qonjugatorplugin_es_RSRCS}
            ${qonjugatorplugin_es_TRANS})
target_link_libraries(qonjugatorplugin_es
                      ${QT_LIBRARIES} ${QONJUGATOR_LIBRARIES})

### install
install(TARGETS qonjugatorplugin_es
        DESTINATION ${QONJUGATOR_PLUGINSDIR})
install(FILES ${qonjugatorplugin_es_TRANS}
        DESTINATION ${QONJUGATOR_TRANSLATIONSDIR})
