2014-04-06 23:13:09 +05:30
|
|
|
cmake_minimum_required(VERSION 2.6)
|
2013-09-26 06:28:09 +05:30
|
|
|
|
2014-04-06 23:13:09 +05:30
|
|
|
if(WIN32)
|
2013-10-06 05:39:21 +05:30
|
|
|
# In Qt 5.1+ we have our own main() function, don't autolink to qtmain on Windows
|
|
|
|
cmake_policy(SET CMP0020 OLD)
|
2014-04-06 23:13:09 +05:30
|
|
|
endif()
|
2013-09-26 17:19:58 +05:30
|
|
|
|
2013-09-26 06:28:09 +05:30
|
|
|
project(unpack200)
|
|
|
|
|
|
|
|
# Find ZLIB for quazip
|
|
|
|
# Use system zlib on unix and Qt ZLIB on Windows
|
2014-04-06 23:13:09 +05:30
|
|
|
if(UNIX)
|
2013-09-26 06:28:09 +05:30
|
|
|
find_package(ZLIB REQUIRED)
|
2014-04-06 23:13:09 +05:30
|
|
|
else(UNIX)
|
|
|
|
get_filename_component(ZLIB_FOUND_DIR "${Qt5Core_DIR}/../../../include/QtZlib" ABSOLUTE)
|
|
|
|
set(ZLIB_INCLUDE_DIRS ${ZLIB_FOUND_DIR} CACHE PATH "Path to ZLIB headers of Qt")
|
|
|
|
set(ZLIB_LIBRARIES "")
|
|
|
|
if(NOT EXISTS "${ZLIB_INCLUDE_DIRS}/zlib.h")
|
|
|
|
message("Please specify a valid zlib include dir")
|
|
|
|
endif(NOT EXISTS "${ZLIB_INCLUDE_DIRS}/zlib.h")
|
|
|
|
endif(UNIX)
|
|
|
|
|
|
|
|
set(PACK200_SRC
|
2013-09-30 00:41:30 +05:30
|
|
|
include/unpack200.h
|
2013-09-26 06:28:09 +05:30
|
|
|
src/bands.cpp
|
|
|
|
src/bands.h
|
|
|
|
src/bytes.cpp
|
|
|
|
src/bytes.h
|
|
|
|
src/coding.cpp
|
|
|
|
src/coding.h
|
|
|
|
src/constants.h
|
|
|
|
src/defines.h
|
2013-09-30 00:41:30 +05:30
|
|
|
src/unpack200.cpp
|
2013-09-26 06:28:09 +05:30
|
|
|
src/unpack.cpp
|
|
|
|
src/unpack.h
|
|
|
|
src/utils.cpp
|
|
|
|
src/utils.h
|
|
|
|
src/zip.cpp
|
|
|
|
src/zip.h
|
|
|
|
)
|
|
|
|
|
2013-09-30 06:56:23 +05:30
|
|
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
2013-09-30 00:41:30 +05:30
|
|
|
|
2014-04-06 23:13:09 +05:30
|
|
|
set(PACK200_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include" PARENT_SCOPE)
|
2013-09-30 06:56:23 +05:30
|
|
|
include_directories(
|
|
|
|
include
|
|
|
|
${ZLIB_INCLUDE_DIRS}
|
|
|
|
)
|
2013-09-30 00:41:30 +05:30
|
|
|
add_library(unpack200 STATIC ${PACK200_SRC})
|
2013-09-26 06:28:09 +05:30
|
|
|
|
2014-04-06 23:13:09 +05:30
|
|
|
if(UNIX)
|
2013-09-26 06:28:09 +05:30
|
|
|
target_link_libraries(unpack200 ${ZLIB_LIBRARIES})
|
2014-04-06 23:13:09 +05:30
|
|
|
else()
|
2013-09-26 06:28:09 +05:30
|
|
|
# zlib is part of Qt on windows. use it.
|
2014-04-06 23:13:09 +05:30
|
|
|
qt5_use_modules(unpack200 Core)
|
|
|
|
endif()
|
2013-09-30 00:41:30 +05:30
|
|
|
|
|
|
|
add_executable(anti200 anti200.cpp)
|
|
|
|
target_link_libraries(anti200 unpack200)
|