forked from itchio/lib7zip
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add first CMakeLists.txt, lib7zip builds on msys2 win64
- Loading branch information
1 parent
5bc54ca
commit c353aae
Showing
4 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
cmake_minimum_required(VERSION 2.8) | ||
|
||
project(lib7zip) | ||
|
||
add_subdirectory(Lib7Zip) | ||
add_subdirectory(Test7Zip) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
diff -Naur upstream-7zip/CPP/Windows/FileIO.h upstream-7zip-patched/CPP/Windows/FileIO.h | ||
--- upstream-7zip/CPP/Windows/FileIO.h 2015-08-02 13:42:34.000000000 +0200 | ||
+++ upstream-7zip-patched/CPP/Windows/FileIO.h 2017-11-20 11:21:37.699451700 +0100 | ||
@@ -6,7 +6,7 @@ | ||
#include "../Common/MyWindows.h" | ||
|
||
#if defined(_WIN32) && !defined(UNDER_CE) | ||
-#include <winioctl.h> | ||
+// #include <winioctl.h> | ||
#endif | ||
|
||
#include "../Common/MyString.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
cmake_minimum_required(VERSION 2.8) | ||
|
||
project(lib7zip) | ||
|
||
set (SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
||
# ==> 7-zip source download start | ||
|
||
set(UPSTREAM_SRC_URL http://www.7-zip.org/a/7z1604-src.7z) | ||
set(UPSTREAM_DIR ${PROJECT_BINARY_DIR}/upstream-7zip) | ||
include(ExternalProject) | ||
ExternalProject_Add( | ||
upstream | ||
URL ${UPSTREAM_SRC_URL} | ||
SOURCE_DIR ${UPSTREAM_DIR} | ||
CONFIGURE_COMMAND "" | ||
BUILD_COMMAND "" | ||
INSTALL_COMMAND "" | ||
PATCH_COMMAND dos2unix ${CMAKE_CURRENT_SOURCE_DIR}/001_avoid_duplicate_guids.patch COMMAND patch --ignore-whitespace --strip 1 < ${CMAKE_CURRENT_SOURCE_DIR}/001_avoid_duplicate_guids.patch COMMAND unix2dos ${UPSTREAM_DIR}/CPP/Windows/FileIO.h | ||
) | ||
|
||
set(UPSTREAM_INCLUDE_DIR ${UPSTREAM_DIR}) | ||
|
||
# <== 7-zip source download end | ||
|
||
include_directories( | ||
${UPSTREAM_INCLUDE_DIR} | ||
${UPSTREAM_INCLUDE_DIR}/CPP | ||
) | ||
|
||
# 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 | ||
) | ||
|
||
add_library(7zip STATIC ${lib7zip_SOURCES}) | ||
add_dependencies(7zip upstream) | ||
|
||
target_compile_options(7zip PRIVATE -std=c++11) | ||
|
||
if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") | ||
target_link_libraries(7zip -lole32 -loleaut32 -luuid) | ||
target_compile_options(7zip PRIVATE -DUNICODE -D_UNICODE) | ||
endif() # Windows |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
cmake_minimum_required(VERSION 2.8) | ||
|
||
project(test7zip) | ||
|