@@ -10,15 +10,20 @@ project(
10
10
11
11
include (GNUInstallDirs )
12
12
include (CheckSymbolExists )
13
- include (cmake/export.cmake )
14
13
15
14
# Create vatomic header library
16
15
add_library (vatomic INTERFACE )
17
16
target_include_directories (
18
17
vatomic INTERFACE "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR} /include>"
19
18
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR} >" )
20
19
20
+ # Enable testing and other targes only if this is the top level project
21
+ if (NOT CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME )
22
+ return ()
23
+ endif ()
24
+
21
25
# Prepare install targets
26
+ include (cmake/export.cmake )
22
27
install (DIRECTORY include /vsync DESTINATION include )
23
28
install (FILES vmm.cat DESTINATION share/vsync/ )
24
29
install (TARGETS vatomic EXPORT ${PROJECT_TARGETS} )
@@ -52,12 +57,10 @@ add_dependencies(clang-format-apply sanitize-vatomic)
52
57
# General diff check for pipeline
53
58
add_custom_target (diff-check COMMAND git --no-pager diff --exit-code )
54
59
55
- # Enable testing and verification only if this is the top level project
56
- if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME )
57
- include (CTest )
58
- include (ProcessorCount )
59
- include (cmake/v_add_test.cmake )
60
- enable_testing ()
61
- add_subdirectory (test )
62
- add_subdirectory (verify )
63
- endif ()
60
+ # Configure testing
61
+ include (CTest )
62
+ include (ProcessorCount )
63
+ include (cmake/v_add_test.cmake )
64
+ enable_testing ()
65
+ add_subdirectory (test )
66
+ add_subdirectory (verify )
0 commit comments