# HG changeset patch # User František Kučera # Date 1537790346 -7200 # Node ID 7ba3ae8cf1fc8b5e0033fab54b0a99e519484107 # Parent 0e791c64f38b00484f39c4e16b3725d4266feafe add relpipe pkg-config libraries using cmake diff -r 0e791c64f38b -r 7ba3ae8cf1fc nbproject/configurations.xml --- 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 @@ build/Debug/src/relpipe-out-chart + ../relpipe-lib-reader.cpp/include + ../relpipe-lib-cli.cpp/include build/Debug/src diff -r 0e791c64f38b -r 7ba3ae8cf1fc src/CMakeLists.txt --- 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}) diff -r 0e791c64f38b -r 7ba3ae8cf1fc src/relpipe-out-chart.cpp --- 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 +#include +#include +#include +#include +#include + + +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 reader(Factory::create(std::cin)); + + int resultCode = CLI::EXIT_CODE_UNEXPECTED_ERROR; + + return resultCode; }