File tree Expand file tree Collapse file tree 7 files changed +16
-17
lines changed Expand file tree Collapse file tree 7 files changed +16
-17
lines changed Original file line number Diff line number Diff line change @@ -7,15 +7,22 @@ project(${This} C CXX)
7
7
set (CMAKE_C_STANDARD 11 )
8
8
set (CMAKE_CXX_STANDARD 17 )
9
9
10
- add_subdirectory (googletest )
10
+ SET (CMAKE_INSTALL_PREFIX /usr/include )
11
+
12
+ add_subdirectory (googletest EXCLUDE_FROM_ALL )
11
13
12
14
enable_testing ()
13
15
14
16
set (Headers
15
- ExpiringLRUCache .hpp
17
+ gh-lru/expiring_lru_cache .hpp
16
18
)
17
19
18
- add_library (${This} STATIC ${Headers} )
20
+ add_library (${This} INTERFACE )
21
+
22
+ target_include_directories (${This} INTERFACE include / )
19
23
20
24
add_subdirectory (examples )
21
- add_subdirectory (tests )
25
+ add_subdirectory (tests )
26
+
27
+ install (DIRECTORY include /
28
+ DESTINATION / )
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ See the examples folder:
19
19
#include < iostream>
20
20
#include < string>
21
21
#include < unistd.h>
22
- #include " ../ExpiringLRUCache .hpp"
22
+ #include < gh-lru/expiring_lru_cache .hpp>
23
23
24
24
int main ()
25
25
{
Original file line number Diff line number Diff line change @@ -6,11 +6,7 @@ set(Sources
6
6
Example.cpp
7
7
)
8
8
9
- # Needed as the library provides only a ".hpp" file which is not automatically
10
- # recognized by cmake.
11
- set_target_properties (ExpiringLRUCache PROPERTIES LINKER_LANGUAGE CXX )
12
-
13
9
add_executable (${This} ${Sources} )
14
- target_link_libraries (${This} PUBLIC
10
+ target_link_libraries (${This}
15
11
ExpiringLRUCache
16
12
)
Original file line number Diff line number Diff line change 1
1
#include < iostream>
2
2
#include < string>
3
3
#include < unistd.h>
4
- #include " ../ExpiringLRUCache .hpp"
4
+ #include < gh-lru/expiring_lru_cache .hpp>
5
5
6
6
int main ()
7
7
{
File renamed without changes.
Original file line number Diff line number Diff line change @@ -3,13 +3,9 @@ cmake_minimum_required(VERSION 3.16)
3
3
set (This ExpiringLRUCacheTests )
4
4
5
5
set (Sources
6
- ExpiringLRUCacheTests .cpp
6
+ expiring_lru_cache_tests .cpp
7
7
)
8
8
9
- # Needed as the library provides only a ".hpp" file which is not automatically
10
- # recognized by cmake.
11
- set_target_properties (ExpiringLRUCache PROPERTIES LINKER_LANGUAGE CXX )
12
-
13
9
add_executable (${This} ${Sources} )
14
10
target_link_libraries (${This} PUBLIC
15
11
gtest_main
Original file line number Diff line number Diff line change 1
- #include " ../ExpiringLRUCache .hpp"
1
+ #include < gh-lru/expiring_lru_cache .hpp>
2
2
#include < boost/functional/hash.hpp>
3
3
#include < gtest/gtest.h>
4
4
You can’t perform that action at this time.
0 commit comments