# libpentobi_kde_thumbnailer contains the files needed by
# the pentobi_kde_thumbnailer plugin compiled with shared library options
# (usually -fPIC) because this is required for building shared libraries on
# some targets (e.g. x86_64).
#
# The alternative would be to add -fPIC to the global compiler flags even for
# executables but this slows down Pentobi's search by 10% on some targets.
#
# Adding the source files directly to pentobi_kde_thumbnailer/CMakeList.txt is
# not possible because the KDE CMake macros add -fno-exceptions to the
# compiler flags which causes errors in the Pentobi sources that use
# exceptions (which should be fine as long as no exceptions are thrown
# from the thumbnailer plugin functions).

include(${QT_USE_FILE})

add_definitions(${CMAKE_SHARED_LIBRARY_CXX_FLAGS})

include_directories(
  ${CMAKE_SOURCE_DIR}/src
  ${Boost_INCLUDE_DIRS}
)

set(pentobi_kde_thumbnailer_STAT_SRCS
  ../libboardgame_util/Assert.cpp
  ../libboardgame_util/Exception.cpp
  ../libboardgame_util/Log.cpp
  ../libboardgame_util/StringUtil.cpp
  ../libboardgame_base/SpreadsheetStringRep.cpp
  ../libboardgame_sgf/InvalidPropertyValue.cpp
  ../libboardgame_sgf/InvalidTree.cpp
  ../libboardgame_sgf/MissingProperty.cpp
  ../libboardgame_sgf/Node.cpp
  ../libboardgame_sgf/Reader.cpp
  ../libboardgame_sgf/Tree.cpp
  ../libboardgame_sgf/TreeReader.cpp
  ../libpentobi_base/NodeUtil.cpp
  ../libpentobi_base/StartingPoints.cpp
  ../libpentobi_base/Variant.cpp
  ../libpentobi_gui/BoardPainter.cpp
  ../libpentobi_gui/Util.cpp
  ../libpentobi_thumbnail/CreateThumbnail.cpp
  )

add_library(pentobi_kde_thumbnailer STATIC
  ${pentobi_kde_thumbnailer_STAT_SRCS}
)
