Skip to content

Commit 80ce062

Browse files
committed
In-source builds are not allowed now
1 parent fbe7604 commit 80ce062

File tree

4 files changed

+38
-4
lines changed

4 files changed

+38
-4
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,7 @@ olderr
3838
.vs
3939
.vscode
4040
stagedir
41+
42+
# In-source builds are not allowed
43+
CMakeCache.txt
44+
CMakeFiles/

CMakeLists.txt

+4
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ set(TARGET_ALIAS ${TARGET_LIBRARY}::${TARGET_LIBRARY})
1515
set(TARGET_PACKAGE_NAME ${PROJECT_NAME}-config)
1616
set(TARGETS_EXPORT_NAME ${PROJECT_NAME}-targets)
1717

18+
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
19+
message(FATAL_ERROR "In-source builds are not allowed!")
20+
endif()
21+
1822
include(GNUInstallDirs)
1923
set(INSTALL_CONFIGDIR ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
2024

requirements.txt

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# =============================================================================
2+
# PYTHON PACKAGES (PIP)
3+
# =============================================================================
4+
# USE (python3): pip3 install -U -r <THIS_FILE_NAME>
5+
# =============================================================================
6+
7+
### python tools
8+
isort
9+
black
10+
pip-tools
11+
pylint
12+
pyaml
13+
14+
### cmake build context
15+
bump2version>=1.0.1
16+
check-jsonschema>=0.29.4
17+
cmake-format>=0.6.13
18+
cmake>=3.30
19+
codespell>=2.3.0
20+
# conan>=2.7.0
21+
gcovr>=7.2
22+
ninja>=1.12
23+
yamllint>=1.35

tests/beman/execution26/CMakeLists.txt

+7-4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ cmake_minimum_required(VERSION 3.25...3.31)
44

55
project(beman_execution26_tests LANGUAGES CXX)
66

7+
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
8+
message(FATAL_ERROR "In-source builds are not allowed!")
9+
endif()
10+
711
list(
812
APPEND
913
execution_tests
@@ -93,24 +97,23 @@ list(
9397
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
9498

9599
if(PROJECT_IS_TOP_LEVEL)
96-
set(TARGET_ALIAS beman_execution26::beman_execution26)
97100
enable_testing()
98101
find_package(beman_execution26 0.0.1 EXACT QUIET)
99102
if(beman_execution26_FOUND)
100103
set(execution_tests exec-awaitable.test) # only one sample to save time! CK
101104
else()
102-
add_subdirectory(../../../.. beman_execution26)
103-
include_directories(${PROJECT_SOURCE_DIR}/include)
105+
add_subdirectory(../../.. beman_execution26)
104106

105107
include(CMakePrintHelpers)
106108
cmake_print_variables(TARGET_ALIAS TARGET_LIBRARY TARGET_PREFIX PROJECT_SOURCE_DIR)
109+
# FIXME: include_directories(${PROJECT_SOURCE_DIR}/include)
107110
endif()
108111
endif()
109112

110113
foreach(test ${execution_tests})
111114
set(TEST_EXE ${TARGET_PREFIX}.${test})
112115
add_executable(${TEST_EXE} ${test}.cpp)
113-
target_link_libraries(${TEST_EXE} PRIVATE ${TARGET_ALIAS})
116+
target_link_libraries(${TEST_EXE} PRIVATE beman_execution26::beman_execution26)
114117
add_test(NAME ${TEST_EXE} COMMAND $<TARGET_FILE:${TEST_EXE}>)
115118
endforeach()
116119

0 commit comments

Comments
 (0)