add relpipe pkg-config libraries using cmake v_0
authorFrantišek Kučera <franta-hg@frantovo.cz>
Mon, 24 Sep 2018 13:59:06 +0200
branchv_0
changeset 2 7ba3ae8cf1fc
parent 1 0e791c64f38b
child 3 0d857519a4c9
add relpipe pkg-config libraries using cmake
nbproject/configurations.xml
src/CMakeLists.txt
src/relpipe-out-chart.cpp
--- a/nbproject/configurations.xml	Mon Sep 24 13:47:02 2018 +0200
+++ b/nbproject/configurations.xml	Mon Sep 24 13:59:06 2018 +0200
@@ -79,6 +79,8 @@
           <executablePath>build/Debug/src/relpipe-out-chart</executablePath>
           <ccTool>
             <incDir>
+              <pElem>../relpipe-lib-reader.cpp/include</pElem>
+              <pElem>../relpipe-lib-cli.cpp/include</pElem>
               <pElem>build/Debug/src</pElem>
             </incDir>
           </ccTool>
--- a/src/CMakeLists.txt	Mon Sep 24 13:47:02 2018 +0200
+++ b/src/CMakeLists.txt	Mon Sep 24 13:59:06 2018 +0200
@@ -1,6 +1,15 @@
+set(EXECUTABLE_FILE "relpipe-out-chart")
+
 # 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")
 # From ASan wiki: "To get nicer stack traces in error messages add -fno-omit-frame-pointer."
 
-add_executable (relpipe-out-chart relpipe-out-chart.cpp)
+INCLUDE(FindPkgConfig)
+pkg_check_modules (RELPIPE_LIB_READER relpipe-lib-reader.cpp relpipe-lib-cli.cpp)
+include_directories(${RELPIPE_LIB_READER_INCLUDE_DIRS})  
+link_directories(${RELPIPE_LIB_READER_LIBRARY_DIRS})
+
+add_executable (${EXECUTABLE_FILE} relpipe-out-chart.cpp)
+
+target_link_libraries(${EXECUTABLE_FILE} ${RELPIPE_LIB_READER_LIBRARIES})
--- a/src/relpipe-out-chart.cpp	Mon Sep 24 13:47:02 2018 +0200
+++ b/src/relpipe-out-chart.cpp	Mon Sep 24 13:59:06 2018 +0200
@@ -1,7 +1,22 @@
 #include <iostream>
 
+#include <relpipe/cli/CLI.h>
+#include <relpipe/cli/RelpipeCLIException.h>
+#include <relpipe/reader/Factory.h>
+#include <relpipe/reader/RelationalReader.h>
+#include <relpipe/reader/RelpipeReaderException.h>
+
+
+using namespace relpipe::cli;
+using namespace relpipe::reader;
+
 int main(int argc, char**argv) {
+	CLI cli(argc, argv);
 	std::cout << "TODO: relpipe-out-chart..." << std::endl;
-	// char * x = new char[1000]; // simulate a memory leak and test that ASan is working
-	return 0;
+	
+	std::shared_ptr<RelationalReader> reader(Factory::create(std::cin));
+
+	int resultCode = CLI::EXIT_CODE_UNEXPECTED_ERROR;
+
+	return resultCode;
 }