Skip to content
Draft
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
11 changes: 8 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,13 @@ option(BUILD_SHARED_LIBS "Build siphon as a shared library" OFF)
option(SIPHON_BUILD_TESTS "Build siphon tests" OFF)

# == Dependencies ==
set(CONFLUENCE_DOL_YAML OFF CACHE BOOL "" FORCE)
if(TARGET confluence AND NOT TARGET Confluence::confluence)
add_library(Confluence::confluence ALIAS confluence)
endif()

find_package(Confluence REQUIRED)
if(NOT TARGET Confluence::confluence)
find_package(Confluence REQUIRED)
endif()
find_package(ZLIB REQUIRED)
find_package(PkgConfig)
if(PkgConfig_FOUND)
Expand Down Expand Up @@ -93,5 +97,6 @@ else()
endif()

if(SIPHON_BUILD_TESTS)
enable_testing()
add_subdirectory(test)
endif()
endif()
11 changes: 5 additions & 6 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
enable_testing()

set(SIPHON_TEST_WORKDIR ${CMAKE_SOURCE_DIR})
set(SIPHON_TEST_WORKDIR ${PROJECT_BINARY_DIR})
file(COPY "${PROJECT_SOURCE_DIR}/test/fixtures" DESTINATION "${SIPHON_TEST_WORKDIR}/test")

add_executable(test_rarc test_rarc.c)
target_link_libraries(test_rarc PRIVATE siphon)
Expand All @@ -12,12 +11,12 @@ add_test(

add_executable(test_aes test_aes.c)
target_link_libraries(test_aes PRIVATE siphon)
target_include_directories(test_aes PRIVATE ${CMAKE_SOURCE_DIR}/src)
target_include_directories(test_aes PRIVATE ${PROJECT_SOURCE_DIR}/src)
add_test(NAME test_aes COMMAND test_aes)

add_executable(test_lzma test_lzma.c)
target_link_libraries(test_lzma PRIVATE siphon)
target_include_directories(test_lzma PRIVATE ${CMAKE_SOURCE_DIR}/src/disc)
target_include_directories(test_lzma PRIVATE ${PROJECT_SOURCE_DIR}/src/disc)
add_test(NAME test_lzma COMMAND test_lzma)

add_executable(test_disc_local test_disc_local.c)
Expand All @@ -29,7 +28,7 @@ macro(add_disc_test name)
add_executable(test_${name} test_${name}.c test_disc_common.c)
target_link_libraries(test_${name} PRIVATE siphon)
target_compile_definitions(test_${name} PRIVATE
SIPHON_TEST_ROOT="${CMAKE_SOURCE_DIR}")
SIPHON_TEST_ROOT="${PROJECT_BINARY_DIR}")
add_test(NAME test_${name} COMMAND test_${name})
endmacro()

Expand Down
Loading