diff --git a/CMakeLists.txt b/CMakeLists.txt index a19e2c5..d0b37a9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,18 +1,34 @@ cmake_minimum_required(VERSION 3.21) project(clAugeas VERSION 1.0.1 DESCRIPTION "clAugeas description") - -include_directories(/opt/homebrew/opt/augeas/include/) -link_directories(/opt/homebrew/opt/augeas/lib) - set(CMAKE_CXX_STANDARD 14) -set(GCC_COVERAGE_COMPILE_FLAGS "-fdeclspec") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS}") + +if(WIN32) + message("TODO: Windows instructions") +elseif(APPLE) + include_directories(/opt/homebrew/opt/augeas/include/) + #link_directories(/opt/homebrew/opt/augeas/lib) # TODO: Check if works with this commente.d +elseif(UNIX) + include_directories(/usr/include/libxml2/) +endif() + + +find_library( + AUGEAS + augeas + +) +find_library( + xml2 + xml +) add_library(clAugeas SHARED augSettings.cpp augSettings.h main.cpp main.h) +target_link_libraries(clAugeas xml2) + target_link_libraries(clAugeas augeas) diff --git a/README b/README index a4d62dc..8d02972 100644 --- a/README +++ b/README @@ -3,3 +3,9 @@ claugeas - Augeas Wrapper Library that facilitates C# and other language bindings. This is a necessary library for the Augeas C# bindings. +Mac Os install: + +brew install --build-from-source augeas + +Unix Dependencies: +libaugeas-dev, libxml2, readline-dev, readline \ No newline at end of file diff --git a/main.cpp b/main.cpp index 9636d72..b722b87 100644 --- a/main.cpp +++ b/main.cpp @@ -2,6 +2,10 @@ #include #include + +#ifdef __linux__ +#include +#endif extern "C" { inline bool path_exists (const std::string& name) {