Skip to content

Commit 4fd92ec

Browse files
committed
Restructure project
* Move headers to relevant include directories within the target tree(s) * Adjust doxygen configuration to search correct paths * Adjust CMake configuration to use new include paths
1 parent 1bec477 commit 4fd92ec

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+37
-28
lines changed

CMakeLists.txt

+5-2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ elseif (CMAKE_C_COMPILER_ID STREQUAL "MSVC")
2424
add_compile_options(${win_cflags})
2525
endif()
2626

27+
set(core_INCLUDE ${CMAKE_CURRENT_SOURCE_DIR}/src/lib/core/include)
28+
set(delivery_INCLUDE ${CMAKE_CURRENT_SOURCE_DIR}/src/lib/delivery/include)
29+
set(SYSCONFDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_SYSCONFDIR}")
30+
configure_file(${PROJECT_SOURCE_DIR}/include/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/include/config.h @ONLY)
31+
include_directories(${PROJECT_BINARY_DIR}/include)
2732
add_subdirectory(src)
2833

2934
# Toggle extremely verbose output
@@ -52,8 +57,6 @@ else()
5257
message(CHECK_PASS "no")
5358
endif()
5459

55-
set(SYSCONFDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_SYSCONFDIR}")
56-
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/include/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/include/config.h @ONLY)
5760
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/stasis_pandoc.css DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/stasis)
5861
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/stasis.ini DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/stasis)
5962
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/mission DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/stasis)

docs/Doxyfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ WARN_LOGFILE =
124124
#---------------------------------------------------------------------------
125125
# Configuration options related to the input files
126126
#---------------------------------------------------------------------------
127-
INPUT = devel.md ../README.md ../src ../include
127+
INPUT = devel.md ../README.md ../src/lib
128128
INPUT_ENCODING = UTF-8
129129
INPUT_FILE_ENCODING =
130130
FILE_PATTERNS = *.c \
@@ -177,7 +177,7 @@ FILE_PATTERNS = *.c \
177177
*.ucf \
178178
*.qsf \
179179
*.ice
180-
RECURSIVE = NO
180+
RECURSIVE = YES
181181
EXCLUDE =
182182
EXCLUDE_SYMLINKS = NO
183183
EXCLUDE_PATTERNS =

src/CMakeLists.txt

-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
include_directories(${CMAKE_BINARY_DIR}/include)
2-
include_directories(${CMAKE_SOURCE_DIR}/include)
3-
include_directories(${PROJECT_BINARY_DIR})
4-
51
add_subdirectory(lib)
62
add_subdirectory(cli)
73

src/cli/stasis/CMakeLists.txt

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
include_directories(${CMAKE_SOURCE_DIR})
21
add_executable(stasis
32
stasis_main.c
43
args.c
@@ -10,6 +9,11 @@ target_link_libraries(stasis PRIVATE
109
stasis_core
1110
stasis_delivery
1211
)
12+
target_include_directories(stasis PRIVATE
13+
${core_INCLUDE}
14+
${delivery_INCLUDE}
15+
${CMAKE_CURRENT_SOURCE_DIR}/include
16+
)
1317
target_link_libraries(stasis PUBLIC LibXml2::LibXml2)
1418

1519
install(TARGETS stasis RUNTIME)
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/cli/stasis_indexer/CMakeLists.txt

+5-3
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@ add_executable(stasis_indexer
55
helpers.c
66
junitxml_report.c
77
website.c
8-
website.h
98
readmes.c
10-
readmes.h
119
)
12-
target_include_directories(stasis_indexer PRIVATE ${CMAKE_SOURCE_DIR})
10+
target_include_directories(stasis_indexer PRIVATE
11+
${core_INCLUDE}
12+
${delivery_INCLUDE}
13+
${CMAKE_CURRENT_SOURCE_DIR}/include
14+
)
1315
target_link_libraries(stasis_indexer PRIVATE
1416
stasis_core
1517
stasis_delivery
File renamed without changes.

src/lib/core/CMakeLists.txt

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
include_directories(${PROJECT_BINARY_DIR})
2-
31
add_library(stasis_core STATIC
42
globals.c
53
str.c
@@ -24,4 +22,8 @@ add_library(stasis_core STATIC
2422
envctl.c
2523
multiprocessing.c
2624
)
27-
25+
target_include_directories(stasis_core PRIVATE
26+
${core_INCLUDE}
27+
${delivery_INCLUDE}
28+
${CMAKE_CURRENT_SOURCE_DIR}/include
29+
)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/lib/delivery/CMakeLists.txt

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
include_directories(${PROJECT_BINARY_DIR})
2-
31
add_library(stasis_delivery STATIC
42
delivery_postprocess.c
53
delivery_conda.c
@@ -13,4 +11,9 @@ add_library(stasis_delivery STATIC
1311
delivery_init.c
1412
delivery.c
1513
)
14+
target_include_directories(stasis_delivery PRIVATE
15+
${core_INCLUDE}
16+
${delivery_INCLUDE}
17+
${CMAKE_CURRENT_SOURCE_DIR}/include
18+
)
1619
target_link_libraries(stasis_delivery stasis_core)

include/delivery.h renamed to src/lib/delivery/include/delivery.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@
99
#include <sys/utsname.h>
1010
#include <fnmatch.h>
1111
#include <sys/statvfs.h>
12-
#include "core.h"
12+
#include "artifactory.h"
13+
#include "conda.h"
1314
#include "copy.h"
15+
#include "core.h"
16+
#include "docker.h"
1417
#include "environment.h"
15-
#include "conda.h"
1618
#include "ini.h"
17-
#include "artifactory.h"
18-
#include "docker.h"
19-
#include "wheel.h"
2019
#include "multiprocessing.h"
2120
#include "recipe.h"
21+
#include "wheel.h"
2222

2323
#define DELIVERY_PLATFORM_MAX 4
2424
#define DELIVERY_PLATFORM_MAXLEN 65

tests/CMakeLists.txt

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
include_directories(
2-
${CMAKE_SOURCE_DIR}/include
3-
${CMAKE_BINARY_DIR}/include
4-
)
51
find_program(BASH_PROGRAM bash)
62
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/tests)
73
set(CTEST_BINARY_DIRECTORY ${PROJECT_BINARY_DIR}/tests)
@@ -22,8 +18,6 @@ if (BASH_PROGRAM AND BUILD_TESTING_RT)
2218
string(REGEX REPLACE ${ext_pattern} "" rt_name ${rt_file})
2319
add_test (${rt_name} ${BASH_PROGRAM} ${rt_file})
2420
endforeach()
25-
add_test (rt_generic_based_on ${BASH_PROGRAM} ${CMAKE_CURRENT_SOURCE_DIR}/rt_generic_based_on.sh)
26-
add_test (rt_generic ${BASH_PROGRAM} ${CMAKE_CURRENT_SOURCE_DIR}/rt_generic.sh)
2721
endif()
2822

2923
foreach(source_file ${source_files})
@@ -36,6 +30,11 @@ foreach(source_file ${source_files})
3630
elseif (CMAKE_C_COMPILER_ID STREQUAL "MSVC")
3731
target_compile_options(${test_executable} PRIVATE ${win_cflags} ${win_msvc_cflags})
3832
endif()
33+
target_include_directories(${test_executable} PRIVATE
34+
${core_INCLUDE}
35+
${delivery_INCLUDE}
36+
${CMAKE_CURRENT_SOURCE_DIR}/include
37+
)
3938
target_link_libraries(${test_executable} PRIVATE
4039
stasis_core
4140
stasis_delivery
File renamed without changes.

0 commit comments

Comments
 (0)