Skip to content

Commit

Permalink
Add CMakeLists for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fasterthanlime committed Nov 20, 2017
1 parent a528c2f commit 5583f7f
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 15 deletions.
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ cmake_minimum_required(VERSION 2.8)

project(lib7zip)

option(LIB7ZIP_BUILD_TESTS "Build tests for lib7zip" OFF)

add_subdirectory(Lib7Zip)
add_subdirectory(Test7Zip)

if (LIB7ZIP_BUILD_TESTS)
add_subdirectory(Test7Zip)
endif()

31 changes: 17 additions & 14 deletions Lib7Zip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,23 @@ include_directories(
# TODO: includes

set (lib7zip_SOURCES
7ZipArchive.cpp
7ZipArchiveItem.cpp
7zipLibrary.cpp
HelperFuncs.cpp
7ZipArchiveOpenCallback.cpp
7ZipCodecInfo.cpp
7ZipCompressCodecsInfo.cpp
7ZipDllHandler.cpp
7ZipFormatInfo.cpp
7ZipObjectPtrArray.cpp
7ZipOpenArchive.cpp
OSFunctions_UnixLike.cpp
OSFunctions_Win32.cpp
7ZipInStreamWrapper.cpp
${SOURCE_DIR}/7ZipArchive.cpp
${SOURCE_DIR}/7ZipArchiveItem.cpp
${SOURCE_DIR}/7zipLibrary.cpp
${SOURCE_DIR}/HelperFuncs.cpp
${SOURCE_DIR}/7ZipArchiveOpenCallback.cpp
${SOURCE_DIR}/7ZipCodecInfo.cpp
${SOURCE_DIR}/7ZipCompressCodecsInfo.cpp
${SOURCE_DIR}/7ZipDllHandler.cpp
${SOURCE_DIR}/7ZipFormatInfo.cpp
${SOURCE_DIR}/7ZipObjectPtrArray.cpp
${SOURCE_DIR}/7ZipOpenArchive.cpp
${SOURCE_DIR}/OSFunctions_UnixLike.cpp
${SOURCE_DIR}/OSFunctions_Win32.cpp
${SOURCE_DIR}/7ZipInStreamWrapper.cpp

${UPSTREAM_DIR}/CPP/Common/MyWindows.cpp
${UPSTREAM_DIR}/CPP/Windows/PropVariant.cpp
)

add_library(7zip STATIC ${lib7zip_SOURCES})
Expand Down
60 changes: 60 additions & 0 deletions Test7Zip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,63 @@ cmake_minimum_required(VERSION 2.8)

project(test7zip)

set(SRC ${CMAKE_CURRENT_SOURCE_DIR})

set(test7zip_SOURCES
${SRC}/stdafx.cpp
${SRC}/Test7Zip.cpp
)

set(test7zip2_SOURCES
${SRC}/stdafx.cpp
${SRC}/Test7Zip.cpp
)

set(test7zipmulti_SOURCES
${SRC}/stdafx.cpp
${SRC}/Test7ZipMulti.cpp
)

set(test7zprops_SOURCES
${SRC}/stdafx.cpp
${SRC}/test7ziprops.cpp
)

set(test7zcrypt_SOURCES
${SRC}/stdafx.cpp
${SRC}/Test7ZipCryptFileName.cpp
)

set(test7zipsig_SOURCES
${SRC}/stdafx.cpp
${SRC}/Test7ZipSignature.cpp
)

set(test7ziprar5_SOURCES
${SRC}/stdafx.cpp
${SRC}/Test7ZipRar5.cpp
)

add_executable(test7zip ${test7zip_SOURCES})
target_link_libraries(test7zip 7zip)

add_executable(test7zip2 ${test7zip_SOURCES})
target_link_libraries(test7zip2 7zip)

add_executable(test7zipmulti ${test7zipmulti_SOURCES})
target_link_libraries(test7zipmulti 7zip)

add_executable(test7zcrypt ${test7zcrypt_SOURCES})
target_link_libraries(test7zcrypt 7zip)

add_executable(test7zipsig ${test7zipsig_SOURCES})
target_link_libraries(test7zipsig 7zip)

add_executable(test7ziprar5 ${test7ziprar5_SOURCES})
target_link_libraries(test7ziprar5 7zip)

configure_file(${SRC}/Test7Zip.7z ${CMAKE_CURRENT_BINARY_DIR}/Test7Zip.7z COPYONLY)
configure_file(${SRC}/Test7Zip.zip ${CMAKE_CURRENT_BINARY_DIR}/Test7Zip.zip COPYONLY)
configure_file(${SRC}/Test7ZipCryptFileName.7z ${CMAKE_CURRENT_BINARY_DIR}/Test7ZipCryptFileName.7z COPYONLY)
configure_file(${SRC}/TestRar5.rar ${CMAKE_CURRENT_BINARY_DIR}/TestRar5.rar COPYONLY)

0 comments on commit 5583f7f

Please sign in to comment.