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

### compile
set(qonjugatorplugin_fr_SRCS
    qonjugator_fr.cpp
    qonjugator_frcontext.cpp
    qonjugator_frirreg.cpp)
set(qonjugatorplugin_fr_MOC_HDRS
    qonjugator_fr.h)
qt4_wrap_cpp(qonjugatorplugin_fr_MOC_SRCS
             ${qonjugatorplugin_fr_MOC_HDRS})
qt4_add_resources(qonjugatorplugin_fr_RSRCS
                  qonjugator_fr.qrc)
qt4_add_translation(qonjugatorplugin_fr_TRANS
                    qonjugatorplugin_fr_es.ts
                    qonjugatorplugin_fr_fr.ts)

add_library(qonjugatorplugin_fr
            SHARED
            ${qonjugatorplugin_fr_SRCS}
            ${qonjugatorplugin_fr_MOC_SRCS}
            ${qonjugatorplugin_fr_RSRCS}
            ${qonjugatorplugin_fr_TRANS})
target_link_libraries(qonjugatorplugin_fr
                      ${QT_LIBRARIES} ${QONJUGATOR_LIBRARIES})

### install
install(TARGETS qonjugatorplugin_fr
        DESTINATION ${QONJUGATOR_PLUGINSDIR})
install(FILES ${qonjugatorplugin_fr_TRANS}
        DESTINATION ${QONJUGATOR_TRANSLATIONSDIR})
