title: Cmake Qt5 | undefined reference to `QPrinter::QPrinter(QPrinter::PrinterMode)
body: <p>I am preparing cmake build for qt application. where I am using following structure ..</p>
  
  <p>libMyApp
  which uses </p>
  
  <pre><code>SET(QT5_MODULES Widgets PrintSupport Network XmlPatterns)
  FIND_PACKAGE(Qt5 REQUIRED COMPONENTS ${QT5_MODULES})
  </code></pre>
  
  <p>and </p>
  
  <pre><code>TARGET_LINK_LIBRARIES(
      ${TARGET_NAME}
      Qt5::Widgets
      Qt5::PrintSupport 
      Qt5::Network
      Qt5::XmlPatterns
  )
  </code></pre>
  
  <p>libMyApp build successfully and generated libMyApp.a (static library)</p>
  
  <p>Now I am using this library in my application MyApp
  which uses</p>
  
  <pre><code>SET(QT5_MODULES Widgets PrintSupport XmlPatterns)
  FIND_PACKAGE(Qt5 REQUIRED COMPONENTS ${QT5_MODULES})
  
  TARGET_LINK_LIBRARIES(
      ${TARGET_NAME}
      Qt5::Widgets
      Qt5::PrintSupport 
      Qt5::XmlPatterns
      ${CODE_LIB_FILES}
  )
  </code></pre>
  
  <p>${CODE_LIB_FILES} is list holding path of libMyApp.a
  MyApp builds successfully and at last shows linking error</p>
  
  <pre><code>undefined reference to `QPrinter::QPrinter(QPrinter::PrinterMode)
  </code></pre>
  
  <p>Same thing happening with xml also</p>
  
  <pre><code>undefined reference to `QDomNode::isElement() const'
  </code></pre>
  
  <p>can anyone point out what is wrong here ?</p>
  
  <p>or any sample program depicting same scenario with printsupport and xmlpatterns module</p>