File tree Expand file tree Collapse file tree 2 files changed +8
-18
lines changed Expand file tree Collapse file tree 2 files changed +8
-18
lines changed Original file line number Diff line number Diff line change 31
31
[Oo ]bj /
32
32
[Ll ]og /
33
33
[Ll ]ogs /
34
+ build /
35
+ build-system-gtest /
34
36
35
37
# Visual Studio 2015/2017 cache/options directory
36
38
.vs /
Original file line number Diff line number Diff line change @@ -7,27 +7,14 @@ project(
7
7
LANGUAGES CXX
8
8
)
9
9
10
- if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME )
11
- set (IS_TOPLEVEL_PROJECT TRUE )
12
- else ()
13
- set (IS_TOPLEVEL_PROJECT FALSE )
14
- endif ()
15
-
16
10
option (SIMPLEINI_USE_SYSTEM_GTEST "Use system GoogleTest dependency" OFF )
17
11
18
- # Disable in-source builds:
19
- get_filename_component (srcdir "${CMAKE_SOURCE_DIR} " REALPATH )
20
- get_filename_component (bindir "${CMAKE_BINARY_DIR} " REALPATH )
21
-
22
- if ("${srcdir} " STREQUAL "${bindir} " )
23
- message ("" )
24
- message ("ERROR:: in-source builds are disabled!" )
25
- message ("Run cmake in a separate build directory:" )
26
- message ("$ cmake -S . -B build" )
27
- message ("" )
28
- message (FATAL_ERROR "Aborting..." )
12
+ # disable in-source builds
13
+ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR )
14
+ message (FATAL_ERROR "In-source builds are not allowed, use cmake -S . -B build." )
29
15
endif ()
30
16
17
+
31
18
# Define library paths and include directories
32
19
set (EXPORT_NAMESPACE "${PROJECT_NAME} ::" )
33
20
set (HEADERS SimpleIni.h )
@@ -70,7 +57,8 @@ target_include_directories(${PROJECT_NAME} INTERFACE
70
57
$< INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR} >
71
58
)
72
59
73
- if (IS_TOPLEVEL_PROJECT )
60
+ # only build tests when top level and testing enabled
61
+ if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME )
74
62
include (CTest )
75
63
if (BUILD_TESTING )
76
64
add_subdirectory (tests )
You can’t perform that action at this time.
0 commit comments