move most sources into libpermissioner
Stefan Schuermans

Stefan Schuermans commited on 2020-08-18 20:27:07
Showing 14 changed files, with 39 additions and 32 deletions.

... ...
@@ -27,5 +27,6 @@ add_custom_target(
27 27
   exports
28 28
 )
29 29
 
30
+add_subdirectory(libpermissioner)
30 31
 add_subdirectory(permissionerd)
31 32
 add_subdirectory(tests)
... ...
@@ -0,0 +1,24 @@
1
+add_library(
2
+  permissioner
3
+  STATIC
4
+  include/permissioner/Config.h
5
+  include/permissioner/Permissions.h
6
+  include/permissioner/StringUtils.h
7
+  include/permissioner/Tree.h
8
+  src/Config.cpp
9
+  src/Permissions.cpp
10
+  src/StringUtils.cpp
11
+  src/Tree.cpp
12
+)
13
+
14
+target_include_directories(
15
+  permissioner
16
+  PUBLIC
17
+  include
18
+)
19
+
20
+target_link_libraries(
21
+  permissioner
22
+  PUBLIC
23
+  Boost::filesystem
24
+)
... ...
@@ -1,7 +1,7 @@
1 1
 #ifndef CONFIG_H
2 2
 #define CONFIG_H
3 3
 
4
-#include "Tree.h"
4
+#include <permissioner/Tree.h>
5 5
 
6 6
 #include <boost/filesystem.hpp>
7 7
 #include <map>
... ...
@@ -1,7 +1,7 @@
1 1
 #ifndef TREE_H
2 2
 #define TREE_H
3 3
 
4
-#include "Permissions.h"
4
+#include <permissioner/Permissions.h>
5 5
 
6 6
 #include <boost/filesystem.hpp>
7 7
 #include <boost/optional.hpp>
... ...
@@ -1,7 +1,7 @@
1
-#include "Config.h"
2
-#include "StringUtils.h"
1
+#include <permissioner/Config.h>
2
+#include <permissioner/StringUtils.h>
3 3
 
4
-#include "Tree.h"
4
+#include <permissioner/Tree.h>
5 5
 
6 6
 #include <boost/filesystem.hpp>
7 7
 #include <fstream>
... ...
@@ -1,4 +1,4 @@
1
-#include "Permissions.h"
1
+#include <permissioner/Permissions.h>
2 2
 
3 3
 #include <string>
4 4
 
... ...
@@ -1,4 +1,4 @@
1
-#include "StringUtils.h"
1
+#include <permissioner/StringUtils.h>
2 2
 
3 3
 #include <stdexcept>
4 4
 #include <sstream>
... ...
@@ -1,7 +1,7 @@
1
-#include "Tree.h"
1
+#include <permissioner/Tree.h>
2 2
 
3
-#include "Permissions.h"
4
-#include "StringUtils.h"
3
+#include <permissioner/Permissions.h>
4
+#include <permissioner/StringUtils.h>
5 5
 
6 6
 #include <boost/filesystem.hpp>
7 7
 #include <boost/optional.hpp>
... ...
@@ -1,18 +1,10 @@
1 1
 add_executable(
2 2
   permissionerd
3
-  src/Config.cpp
4
-  src/Config.h
5 3
   src/permissionerd.cpp
6
-  src/Permissions.cpp
7
-  src/Permissions.h
8
-  src/StringUtils.cpp
9
-  src/StringUtils.h
10
-  src/Tree.cpp
11
-  src/Tree.h
12 4
 )
13 5
 
14 6
 target_link_libraries(
15 7
   permissionerd
16 8
   PUBLIC
17
-  Boost::filesystem
9
+  permissioner
18 10
 )
... ...
@@ -1,4 +1,4 @@
1
-#include "Config.h"
1
+#include <permissioner/Config.h>
2 2
 
3 3
 #include <cstdlib>
4 4
 #include <iostream>
... ...
@@ -1,22 +1,12 @@
1 1
 add_executable(
2 2
   testConfig
3 3
   testConfig.cpp
4
-  ${CMAKE_SOURCE_DIR}/permissionerd/src/Config.cpp
5
-  ${CMAKE_SOURCE_DIR}/permissionerd/src/Permissions.cpp
6
-  ${CMAKE_SOURCE_DIR}/permissionerd/src/StringUtils.cpp
7
-  ${CMAKE_SOURCE_DIR}/permissionerd/src/Tree.cpp
8
-)
9
-
10
-target_include_directories(
11
-  testConfig
12
-  PUBLIC
13
-  ${CMAKE_SOURCE_DIR}/permissionerd/src
14 4
 )
15 5
 
16 6
 target_link_libraries(
17 7
   testConfig
18 8
   PUBLIC
19
-  Boost::filesystem
9
+  permissioner
20 10
 )
21 11
 
22 12
 add_test(
... ...
@@ -1,4 +1,4 @@
1
-#include "Config.h"
1
+#include <permissioner/Config.h>
2 2
 
3 3
 #include <cstdlib>
4 4
 
5 5