From f994cb22612660bb98bc9dc79a9594a84688089b Mon Sep 17 00:00:00 2001 From: Christian Burger Date: Sat, 23 Apr 2022 20:27:55 +0200 Subject: [PATCH] moved library system headers to separate folder Gave the library a version in case it is build statically. --- App.cpp | 2 +- CMakeLists.txt | 10 ++++++++-- SingleUserInput.cpp | 2 +- Window.cpp | 2 +- .../NCursesPtyWindow/SingleUserInput.hpp | 0 Window.hpp => include/NCursesPtyWindow/Window.hpp | 0 6 files changed, 11 insertions(+), 5 deletions(-) rename SingleUserInput.hpp => include/NCursesPtyWindow/SingleUserInput.hpp (100%) rename Window.hpp => include/NCursesPtyWindow/Window.hpp (100%) diff --git a/App.cpp b/App.cpp index fc05ba4..d471c5d 100644 --- a/App.cpp +++ b/App.cpp @@ -3,8 +3,8 @@ */ #include "App.hpp" -#include "Window.hpp" #include "Debug.hpp" +#include #include #include diff --git a/CMakeLists.txt b/CMakeLists.txt index e44d355..ec101bd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,6 +15,9 @@ enable_testing() add_library(NCursesPtyWindow Window.cpp SingleUserInput.cpp Debug.cpp) +### path to own system includes +include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/include") + ### libraries include("cmake/ncurses.cmake") @@ -40,9 +43,12 @@ add_executable(NCursesPtyApp main.cpp App.cpp) target_link_libraries(NCursesPtyApp NCursesPtyWindow) ### installation and packaging -set_target_properties(NCursesPtyWindow PROPERTIES PUBLIC_HEADER "Window.hpp;SingleUserInput.hpp" +set(NCURSES_PTY_WINDOW_SYSTEM_INCLUDE "include/NCursesPtyWindow") +set_target_properties(NCursesPtyWindow PROPERTIES PUBLIC_HEADER "${NCURSES_PTY_WINDOW_SYSTEM_INCLUDE}/Window.hpp;${NCURSES_PTY_WINDOW_SYSTEM_INCLUDE}/SingleUserInput.hpp" VERSION "${CMAKE_PROJECT_VERSION}") -install(TARGETS NCursesPtyWindow ARCHIVE PUBLIC_HEADER) +include(GNUInstallDirs) +install(TARGETS NCursesPtyWindow ARCHIVE + PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/NCursesPtyWindow/") set(CPACK_PROJECT_NAME ${PROJECT_NAME}) set(CPACK_PROJECT_VERSION ${PROJECT_VERSION}) diff --git a/SingleUserInput.cpp b/SingleUserInput.cpp index 5a0ff7b..ec01285 100644 --- a/SingleUserInput.cpp +++ b/SingleUserInput.cpp @@ -2,7 +2,7 @@ * @author Christian Burger (christian@krikkel.de) */ -#include "SingleUserInput.hpp" +#include #include "Debug.hpp" #include diff --git a/Window.cpp b/Window.cpp index 40eabaa..13ea035 100644 --- a/Window.cpp +++ b/Window.cpp @@ -2,7 +2,7 @@ * @author Christian Burger (christian@krikkel.de) */ -#include "Window.hpp" +#include #include "Debug.hpp" #include diff --git a/SingleUserInput.hpp b/include/NCursesPtyWindow/SingleUserInput.hpp similarity index 100% rename from SingleUserInput.hpp rename to include/NCursesPtyWindow/SingleUserInput.hpp diff --git a/Window.hpp b/include/NCursesPtyWindow/Window.hpp similarity index 100% rename from Window.hpp rename to include/NCursesPtyWindow/Window.hpp