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

### compile
set(qonjugatorplugin_tmp_SRCS
    qonjugator_tmp.cpp)
set(qonjugatorplugin_tmp_MOC_HDRS
    qonjugator_tmp.h)
qt4_wrap_cpp(qonjugatorplugin_tmp_MOC_SRCS
             ${qonjugatorplugin_tmp_MOC_HDRS})
qt4_add_resources(qonjugatorplugin_tmp_RSRCS
                  qonjugator_tmp.qrc)
qt4_add_translation(qonjugatorplugin_tmp_TRANS
                    qonjugatorplugin_tmp_es.ts
                    qonjugatorplugin_tmp_fr.ts)

add_library(qonjugatorplugin_tmp
            SHARED
            ${qonjugatorplugin_tmp_SRCS}
            ${qonjugatorplugin_tmp_MOC_SRCS}
            ${qonjugatorplugin_tmp_RSRCS}
            ${qonjugatorplugin_tmp_TRANS})
target_link_libraries(qonjugatorplugin_tmp
                      ${QT_LIBRARIES} ${QONJUGATOR_LIBRARIES})

### install
install(TARGETS qonjugatorplugin_tmp
        DESTINATION ${QONJUGATOR_PLUGINSDIR})
install(FILES ${qonjugatorplugin_tmp_TRANS}
        DESTINATION ${QONJUGATOR_TRANSLATIONSDIR})
