Skip to content

Commit 245c4ab

Browse files
committed
Path varies by 'project'
1 parent ed0f715 commit 245c4ab

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ if(POLICY CMP0157)
1919
endif()
2020
endif()
2121

22+
set(SWT_SOURCE_ROOT_DIR ${PROJECT_SOURCE_DIR})
23+
2224
project(SwiftTesting
2325
LANGUAGES CXX Swift)
2426

Sources/TestingMacros/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ if(POLICY CMP0157)
1212
cmake_policy(SET CMP0157 NEW)
1313
endif()
1414

15+
set(SWT_SOURCE_ROOT_DIR ${CMAKE_SOURCE_DIR}/../..)
16+
1517
project(TestingMacros
1618
LANGUAGES Swift)
1719

cmake/modules/shared/CompilerSettings.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "WASI")
4343
add_compile_definitions("SWT_NO_PIPES")
4444
endif()
4545

46-
file(STRINGS "${PROJECT_SOURCE_DIR}/VERSION.txt" SWT_TESTING_LIBRARY_VERSION LIMIT_COUNT 1)
46+
file(STRINGS "${SWT_SOURCE_ROOT_DIR}/VERSION.txt" SWT_TESTING_LIBRARY_VERSION LIMIT_COUNT 1)
4747
if(SWT_TESTING_LIBRARY_VERSION)
4848
message(STATUS "Swift Testing version: ${SWT_TESTING_LIBRARY_VERSION}")
4949
add_compile_definitions("$<$<COMPILE_LANGUAGE:CXX>:SWT_TESTING_LIBRARY_VERSION=\"${SWT_TESTING_LIBRARY_VERSION}\">")

0 commit comments

Comments
 (0)