Skip to content

Commit 0413a2a

Browse files
cmake: check if test target exists before adding compile definitions (#104)
1 parent 1369a9b commit 0413a2a

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

Utilities/SilKitRegistry/config/CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,11 @@ target_link_libraries(O_SilKitRegistry_Config
3434

3535
add_silkit_test_executable(SilKitRegistryTests)
3636

37-
target_compile_definitions(SilKitRegistryTests
38-
PRIVATE EXPORT_SilKitAPI
39-
)
37+
if(TARGET SilKitRegistryTests)
38+
target_compile_definitions(SilKitRegistryTests
39+
PRIVATE EXPORT_SilKitAPI
40+
)
41+
endif()
4042

4143
add_silkit_test_to_executable(SilKitRegistryTests
4244
SOURCES

0 commit comments

Comments
 (0)