add Qt libraries using cmake v_0
authorFrantišek Kučera <franta-hg@frantovo.cz>
Mon, 24 Sep 2018 14:03:46 +0200
branchv_0
changeset 3 0d857519a4c9
parent 2 7ba3ae8cf1fc
child 4 1622c087f3ea
add Qt libraries using cmake
nbproject/configurations.xml
nbproject/project.xml
src/CMakeLists.txt
src/relpipe-out-chart.cpp
--- a/nbproject/configurations.xml	Mon Sep 24 13:59:06 2018 +0200
+++ b/nbproject/configurations.xml	Mon Sep 24 14:03:46 2018 +0200
@@ -40,11 +40,24 @@
 -->
 <configurationDescriptor version="100">
   <logicalFolder name="root" displayName="root" projectFiles="true" kind="ROOT">
+    <logicalFolder name="Modules"
+                   displayName="Modules"
+                   projectFiles="true"
+                   root="/usr/share/cmake-3.10/Modules">
+      <itemPath>/usr/share/cmake-3.10/Modules/CMakeCXXCompilerABI.cpp</itemPath>
+      <itemPath>/usr/share/cmake-3.10/Modules/CMakeCompilerABI.h</itemPath>
+    </logicalFolder>
     <df root="." name="0">
       <df name="src">
         <in>relpipe-out-chart.cpp</in>
       </df>
     </df>
+    <logicalFolder name="relpipe-out-chart_autogen"
+                   displayName="relpipe-out-chart_autogen"
+                   projectFiles="true"
+                   root="build/Debug/src/relpipe-out-chart_autogen">
+      <itemPath>build/Debug/src/relpipe-out-chart_autogen/mocs_compilation.cpp</itemPath>
+    </logicalFolder>
     <logicalFolder name="ExternalFiles"
                    displayName="Important Files"
                    projectFiles="false"
@@ -67,7 +80,7 @@
         <rebuildPropChanged>false</rebuildPropChanged>
       </toolsSet>
       <flagsDictionary>
-        <element flagsID="0" commonFlags="-fsanitize=address"/>
+        <element flagsID="0" commonFlags="-fsanitize=address -fPIC -std=gnu++11"/>
       </flagsDictionary>
       <codeAssistance>
       </codeAssistance>
@@ -79,10 +92,22 @@
           <executablePath>build/Debug/src/relpipe-out-chart</executablePath>
           <ccTool>
             <incDir>
+              <pElem>build/Debug/src</pElem>
+              <pElem>src</pElem>
+              <pElem>build/Debug/src/relpipe-out-chart_autogen/include</pElem>
               <pElem>../relpipe-lib-reader.cpp/include</pElem>
               <pElem>../relpipe-lib-cli.cpp/include</pElem>
-              <pElem>build/Debug/src</pElem>
+              <pElem>/usr/include/x86_64-linux-gnu/qt5</pElem>
+              <pElem>/usr/include/x86_64-linux-gnu/qt5/QtWidgets</pElem>
+              <pElem>/usr/include/x86_64-linux-gnu/qt5/QtGui</pElem>
+              <pElem>/usr/include/x86_64-linux-gnu/qt5/QtCore</pElem>
+              <pElem>/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++</pElem>
             </incDir>
+            <preprocessorList>
+              <Elem>QT_CORE_LIB</Elem>
+              <Elem>QT_GUI_LIB</Elem>
+              <Elem>QT_WIDGETS_LIB</Elem>
+            </preprocessorList>
           </ccTool>
         </makeTool>
         <preBuild>
@@ -91,7 +116,26 @@
           <preBuildFirst>true</preBuildFirst>
         </preBuild>
       </makefileType>
-      <item path="src/relpipe-out-chart.cpp" ex="false" tool="1" flavor2="0">
+      <item path="/usr/share/cmake-3.10/Modules/CMakeCXXCompilerABI.cpp"
+            ex="false"
+            tool="1"
+            flavor2="0">
+      </item>
+      <item path="build/Debug/src/relpipe-out-chart_autogen/mocs_compilation.cpp"
+            ex="false"
+            tool="1"
+            flavor2="8">
+        <ccTool flags="0">
+        </ccTool>
+      </item>
+      <folder path="usr/share/cmake-3.10/Modules">
+        <ccTool>
+          <incDir>
+            <pElem>/usr/include</pElem>
+          </incDir>
+        </ccTool>
+      </folder>
+      <item path="src/relpipe-out-chart.cpp" ex="false" tool="1" flavor2="8">
         <ccTool flags="0">
         </ccTool>
       </item>
--- a/nbproject/project.xml	Mon Sep 24 13:59:06 2018 +0200
+++ b/nbproject/project.xml	Mon Sep 24 14:03:46 2018 +0200
@@ -45,7 +45,7 @@
             <name>relpipe-out-chart.qt.cpp</name>
             <c-extensions/>
             <cpp-extensions>cpp</cpp-extensions>
-            <header-extensions/>
+            <header-extensions>h</header-extensions>
             <sourceEncoding>UTF-8</sourceEncoding>
             <sourceRootList>
                 <sourceRootElem>.</sourceRootElem>
--- a/src/CMakeLists.txt	Mon Sep 24 13:59:06 2018 +0200
+++ b/src/CMakeLists.txt	Mon Sep 24 14:03:46 2018 +0200
@@ -1,5 +1,11 @@
 set(EXECUTABLE_FILE "relpipe-out-chart")
 
+# Qt:
+set(CMAKE_INCLUDE_CURRENT_DIR ON) # Find includes in corresponding build directories
+set(CMAKE_AUTOMOC ON) # Instruct CMake to run moc automatically when needed
+set(CMAKE_AUTOUIC ON) # Create code from a list of Qt designer ui files
+find_package(Qt5Widgets CONFIG REQUIRED) # Find the QtWidgets library
+
 # Add ASan AddressSanitizer
 set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address")
 set(CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address")
@@ -13,3 +19,4 @@
 add_executable (${EXECUTABLE_FILE} relpipe-out-chart.cpp)
 
 target_link_libraries(${EXECUTABLE_FILE} ${RELPIPE_LIB_READER_LIBRARIES})
+target_link_libraries(${EXECUTABLE_FILE} Qt5::Widgets)
--- a/src/relpipe-out-chart.cpp	Mon Sep 24 13:59:06 2018 +0200
+++ b/src/relpipe-out-chart.cpp	Mon Sep 24 14:03:46 2018 +0200
@@ -1,5 +1,7 @@
 #include <iostream>
 
+#include <QApplication>
+
 #include <relpipe/cli/CLI.h>
 #include <relpipe/cli/RelpipeCLIException.h>
 #include <relpipe/reader/Factory.h>
@@ -12,6 +14,8 @@
 
 int main(int argc, char**argv) {
 	CLI cli(argc, argv);
+	QApplication app(argc, argv);
+	
 	std::cout << "TODO: relpipe-out-chart..." << std::endl;
 	
 	std::shared_ptr<RelationalReader> reader(Factory::create(std::cin));