Skip to content

Commit 882daf7

Browse files
committed
Add Install + Rename Files
1 parent d7a5afd commit 882daf7

File tree

7 files changed

+16
-17
lines changed

7 files changed

+16
-17
lines changed

CMakeLists.txt

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,22 @@ project(${This} C CXX)
77
set(CMAKE_C_STANDARD 11)
88
set(CMAKE_CXX_STANDARD 17)
99

10-
add_subdirectory(googletest)
10+
SET(CMAKE_INSTALL_PREFIX /usr/include)
11+
12+
add_subdirectory(googletest EXCLUDE_FROM_ALL)
1113

1214
enable_testing()
1315

1416
set(Headers
15-
ExpiringLRUCache.hpp
17+
gh-lru/expiring_lru_cache.hpp
1618
)
1719

18-
add_library(${This} STATIC ${Headers})
20+
add_library(${This} INTERFACE)
21+
22+
target_include_directories(${This} INTERFACE include/)
1923

2024
add_subdirectory(examples)
21-
add_subdirectory(tests)
25+
add_subdirectory(tests)
26+
27+
install(DIRECTORY include/
28+
DESTINATION /)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ See the examples folder:
1919
#include <iostream>
2020
#include <string>
2121
#include <unistd.h>
22-
#include "../ExpiringLRUCache.hpp"
22+
#include <gh-lru/expiring_lru_cache.hpp>
2323

2424
int main()
2525
{

examples/CMakeLists.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@ set(Sources
66
Example.cpp
77
)
88

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-
139
add_executable(${This} ${Sources})
14-
target_link_libraries(${This} PUBLIC
10+
target_link_libraries(${This}
1511
ExpiringLRUCache
1612
)

examples/Example.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include <iostream>
22
#include <string>
33
#include <unistd.h>
4-
#include "../ExpiringLRUCache.hpp"
4+
#include <gh-lru/expiring_lru_cache.hpp>
55

66
int main()
77
{
File renamed without changes.

tests/CMakeLists.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,9 @@ cmake_minimum_required(VERSION 3.16)
33
set(This ExpiringLRUCacheTests)
44

55
set(Sources
6-
ExpiringLRUCacheTests.cpp
6+
expiring_lru_cache_tests.cpp
77
)
88

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-
139
add_executable(${This} ${Sources})
1410
target_link_libraries(${This} PUBLIC
1511
gtest_main

tests/ExpiringLRUCacheTests.cpp renamed to tests/expiring_lru_cache_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "../ExpiringLRUCache.hpp"
1+
#include <gh-lru/expiring_lru_cache.hpp>
22
#include <boost/functional/hash.hpp>
33
#include <gtest/gtest.h>
44

0 commit comments

Comments
 (0)