Skip to content

Commit ccb04f0

Browse files
authored
Merge pull request #6 from DeveloperPaul123/fix/small-build-setup-changes
Minor build setup changes
2 parents 70368ca + 3233156 commit ccb04f0

File tree

5 files changed

+31
-53
lines changed

5 files changed

+31
-53
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*build

CMakeLists.txt

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,36 @@
44
# cmake-format: on
55

66
cmake_minimum_required(VERSION 3.23)
7+
78
project(
8-
beman.inplace_vector
9-
VERSION 1.0.0
10-
DESCRIPTION "A dynamically-resizable vector with fixed capacity and embedded storage"
11-
LANGUAGES CXX
12-
)
9+
beman.inplace_vector
10+
VERSION 1.0.0
11+
DESCRIPTION
12+
"A dynamically-resizable vector with fixed capacity and embedded storage"
13+
LANGUAGES CXX)
14+
15+
add_library(beman.inplace_vector INTERFACE)
16+
target_include_directories(
17+
beman.inplace_vector
18+
INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
19+
$<INSTALL_INTERFACE:include>)
1320

14-
include(CTest)
15-
add_subdirectory(src/beman/inplace_vector)
21+
# Install the InplaceVector library to the appropriate destination
22+
install(
23+
TARGETS beman.inplace_vector
24+
EXPORT ${TARGETS_EXPORT_NAME}
25+
DESTINATION ${CMAKE_INSTALL_LIBDIR})
26+
27+
# Install the header files to the appropriate destination
28+
install(
29+
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/
30+
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${CMAKE_PROJECT_NAME}
31+
FILES_MATCHING
32+
PATTERN
33+
"${CMAKE_CURRENT_SOURCE_DIR}/include/beman/inplace_vector/inplace_vector.hpp"
34+
)
1635

17-
if (BUILD_TESTING)
18-
add_subdirectory(src/beman/inplace_vector/tests)
19-
endif ()
36+
if(BUILD_TESTING)
37+
include(CTest)
38+
add_subdirectory(src/beman/inplace_vector/tests)
39+
endif()

src/beman/inplace_vector/CMakeLists.txt

Lines changed: 0 additions & 40 deletions
This file was deleted.

src/beman/inplace_vector/inplace_vector.cpp

Lines changed: 0 additions & 2 deletions
This file was deleted.

src/beman/inplace_vector/tests/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ add_executable(
1010
target_link_libraries(beman.inplace_vector.test PRIVATE
1111
beman.inplace_vector)
1212

13-
1413
add_test(
1514
NAME beman.inplace_vector.test
1615
COMMAND beman.inplace_vector.test

0 commit comments

Comments
 (0)