title: Qt Custom QObject Static Library with CMake Problem
body: <p>I am working on a cmake qt project. While I was trying to compile a custom library, which is a QObject, and a custom executable, which is a QApplication, a linker error was occured.</p>
  <pre><code>[build] Undefined symbols for architecture x86_64:
  [build]   &quot;vtable for ChessieObjects::Syntax&quot;, referenced from:
  [build]       ChessieObjects::Syntax::Syntax(QObject*) in libChessieSyntaxObject.a(ChessieSyntaxObject.cpp.o)
  [build]       ChessieObjects::Syntax::~Syntax() in libChessieSyntaxObject.a(ChessieSyntaxObject.cpp.o)
  [build]   NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
  [build] ld: symbol(s) not found for architecture x86_64
  </code></pre>
  <p>Header  file is below:</p>
  <pre><code>class Syntax : public QObject
  {
      Q_OBJECT
      
  public:
      Syntax(QObject* parent = NULL);
      virtual ~Syntax();
  
  };
  </code></pre>
  <p>Source file is below:</p>
  <pre><code>Syntax::Syntax(QObject* parent)
      : QObject(parent)
  {
      CHESSIE_EXPECT(TRUE);
  }
  
  Syntax::~Syntax()
  {
      CHESSIE_EXPECT(TRUE);
  }
  </code></pre>
  <p>CMakeLists.txt is below</p>
  <pre><code>add_library(
      ChessieSyntaxObject
  )
  
  target_link_libraries(
      ChessieSyntaxObject
      PUBLIC
          ChessieCore
          Qt5::Core
          Qt5::Widgets
  )
  target_sources(
      ChessieSyntaxObject
      PRIVATE
          ChessieSyntaxObject.cpp
  )
  </code></pre>
  <p>I could not find where the problem is. If you help me, I will be very appreciate.</p>