mirror of https://github.com/libAthena/athena.git
Disable tests when included as subdirectory
This commit is contained in:
parent
b690d4d7da
commit
bec2665741
|
@ -267,6 +267,7 @@ install(EXPORT AthenaTargets DESTINATION ${INSTALL_CMAKE_DIR} COMPONENT athena)
|
|||
################
|
||||
|
||||
add_subdirectory(atdna)
|
||||
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
|
||||
# Test target
|
||||
add_executable(atdna-test atdna/test.cpp atdna/test.hpp)
|
||||
target_atdna(atdna-test atdna_test.cpp atdna/test.hpp)
|
||||
|
@ -276,6 +277,7 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Switch")
|
|||
else()
|
||||
target_link_libraries(atdna-test athena-core)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#########
|
||||
# CPack #
|
||||
|
|
|
@ -192,9 +192,11 @@ install(EXPORT atdnaTargets DESTINATION ${INSTALL_CMAKE_DIR} COMPONENT atdna)
|
|||
# CTest #
|
||||
#########
|
||||
|
||||
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
|
||||
enable_testing()
|
||||
add_test(NAME test-dna COMMAND $<TARGET_FILE:atdna> -o test.cpp
|
||||
"-I${ATHENA_INCLUDE_DIR}" ${CMAKE_SOURCE_DIR}/test.hpp)
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
|
|
Loading…
Reference in New Issue