Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,12 @@ if(SystemC_FOUND)
if (NOT (DEFINED CMAKE_CXX_CLANG_TIDY OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang"))
add_subdirectory(examples)
endif()
if(Catch2_FOUND)
message(STATUS "SCC: Including Catch2 based tests")
include(Catch)
set(WITH_SCP4SCC ON)
add_subdirectory(tests)
endif()
endif()

# Define the scc library
Expand Down Expand Up @@ -174,13 +180,6 @@ if(SystemC_FOUND)
add_library(scc::scc_shared ALIAS scc_shared)
endif()

if(Catch2_FOUND)
message(STATUS "SCC: Including Catch2 based tests")
include(Catch)
set(WITH_SCP4SCC ON)
add_subdirectory(tests)
endif()

install(TARGETS scc
EXPORT scc-targets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
Expand Down
10 changes: 6 additions & 4 deletions tests/io-redirector/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
project (io_redirector)
add_executable (${PROJECT_NAME} test.cpp)
target_link_libraries (io_redirector LINK_PUBLIC scc-util Catch2::Catch2WithMain)
if(TARGET Catch2::Catch2WithMain)
add_executable (${PROJECT_NAME} test.cpp)
target_link_libraries (io_redirector LINK_PUBLIC scc-util Catch2::Catch2WithMain)

#add_test(NAME io_redirector_test COMMAND io_redirector)
catch_discover_tests(${PROJECT_NAME})
#add_test(NAME io_redirector_test COMMAND io_redirector)
catch_discover_tests(${PROJECT_NAME})
endif()