CMAKE: Allow building for Linux platform (Tested in Debian 11, codename bookworm)

This commit is contained in:
code liturgy 2022-11-06 12:21:55 -05:00
parent a1e98443c7
commit f05c9882ed
3 changed files with 32 additions and 6 deletions

View File

@ -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)

6
README
View File

@ -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

View File

@ -2,6 +2,10 @@
#include <sys/stat.h>
#include <sstream>
#ifdef __linux__
#include <cstring>
#endif
extern "C" {
inline bool path_exists (const std::string& name) {