include_directories(${CMAKE_CURRENT_BINARY_DIR})

set(QML_SOURCES PageComponent.qml)
add_library(example-plugin MODULE example-plugin.cpp example-plugin.h ${QML_SOURCES})
target_link_libraries(example-plugin Qt5::Qml Qt5::Core LomiriSystemSettings)
add_definitions(-DPLUGIN_QML_DIR="${PLUGIN_QML_DIR}")


# This plugin is only an example so let's not install it.
#install(FILES example.settings DESTINATION ${PLUGIN_MANIFEST_DIR})
#install(FILES ${QML_SOURCES} DESTINATION ${PLUGIN_QML_DIR}/example)
#install(TARGETS example-plugin DESTINATION ${PLUGIN_MODULE_DIR})


# to rename the entire example plugin you need to:
# rename example-plugin.cpp: L68, #include "(nameofplugin)-plugin.moc"
# rename example-plugin.cpp: L53, file://usr/share/lomiri-system-settings/qml-plugins/(nameofplugin)/PageComponent.qml
# rename example-plugin.cpp: L21, #include "(nameofplugin)-plugin.h"
# rename example.settings: L13, "plugin": "(nameofplugin)-plugin"
# rename all example* files to nameofplugin of course.
# don't forget to rename everything in this CMakeLists file as well.