Skip to content

Commit 10509ba

Browse files
committed
Set CMAKE_EXPORT_COMPILE_COMMANDS too
1 parent a3bc933 commit 10509ba

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

cmake/tools.cmake

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ if(NOT PROJECT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
66
return()
77
endif()
88

9+
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
10+
911
include(${CMAKE_CURRENT_LIST_DIR}/CPM.cmake)
1012

1113
# enables sanitizers support using the the `USE_SANITIZER` flag available values are: Address,

test/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ project(GreeterTests LANGUAGES CXX)
55
# ---- Options ----
66

77
option(ENABLE_TEST_COVERAGE "Enable test coverage" OFF)
8-
option(TEST_INSTALLED_VERSION "Test the version found by find_package" OFF)
8+
option(TEST_INSTALLED_VERSION "Test the version found by find_package" ${PROJECT_IS_TOP_LEVEL})
99

1010
# --- Import tools ----
1111

@@ -59,7 +59,7 @@ if(EXISTS ${doctest_SOURCE_DIR}/scripts/cmake/doctest.cmake)
5959
doctest_discover_tests(${PROJECT_NAME})
6060
else()
6161
add_test(NAME ${PROJECT_NAME} COMMAND ${PROJECT_NAME})
62-
endif
62+
endif()
6363

6464
# ---- code coverage ----
6565

0 commit comments

Comments
 (0)