cmake_minimum_required(VERSION 3.9 FATAL_ERROR)

project(ExamplePlugin VERSION 17.09.06 LANGUAGES C CXX)

find_package(Qt5 COMPONENTS Widgets REQUIRED)

set(EXAMPLE_SOURCES
  example.cc
  )

add_library(Example MODULE ${EXAMPLE_SOURCES})
target_include_directories(Example PRIVATE ${PROJECT_ROOT})
target_compile_definitions(Example
  PUBLIC -DSPAGHETTI_SHARED
  PRIVATE -DSPAGHETTI_EXPORTS
  )
set_target_properties(Example PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/plugins")
set_target_properties(Example PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/plugins")

target_link_libraries(Example Spaghetti)

install(TARGETS Example
  COMPONENT ExamplePlugin
  EXPORT Example
  LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/spaghetti
  )

cmake_minimum_required(VERSION 3.9 FATAL_ERROR)

project(ExamplePlugin VERSION 17.09.06 LANGUAGES C CXX)

find_package(Qt5 COMPONENTS Widgets REQUIRED)

set(EXAMPLE_SOURCES
  example.cc
  )

add_library(Example MODULE ${EXAMPLE_SOURCES})
target_include_directories(Example PRIVATE ${PROJECT_ROOT})
target_compile_definitions(Example
  PUBLIC SPAGHETTI_SHARED
  PRIVATE SPAGHETTI_EXPORTS ${SPAGHETTI_DEFINITIONS}
  PRIVATE $<$<CONFIG:Debug>:${SPAGHETTI_DEFINITIONS_DEBUG}>
  PRIVATE $<$<CONFIG:Release>:${SPAGHETTI_DEFINITIONS_RELEASE}>
  )
target_compile_options(Example
  PRIVATE ${SPAGHETTI_FLAGS}
  PRIVATE ${SPAGHETTI_FLAGS_C}
  PRIVATE ${SPAGHETTI_FLAGS_CXX}
  PRIVATE ${SPAGHETTI_FLAGS_LINKER}
  PRIVATE $<$<CONFIG:Debug>:${SPAGHETTI_FLAGS_DEBUG}>
  PRIVATE $<$<CONFIG:Debug>:${SPAGHETTI_WARNINGS}>
  PRIVATE $<$<CONFIG:Release>:${SPAGHETTI_FLAGS_RELEASE}>
  )
set_target_properties(Example PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/plugins")
set_target_properties(Example PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/plugins")

target_link_libraries(Example Spaghetti)

install(TARGETS Example
  COMPONENT ExamplePlugin
  EXPORT Example
  LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/spaghetti
  )

Add missing target flags/options for example plugin
Add missing target flags/options for example plugin
