2015-09-28 19:53:46 +01:00
|
|
|
cmake_minimum_required(VERSION 3.1)
|
2013-09-26 12:49:58 +01:00
|
|
|
|
2017-05-05 00:34:01 +01:00
|
|
|
project(MultiMC_unpack200)
|
2013-09-26 01:58:09 +01:00
|
|
|
|
2015-09-28 19:53:46 +01:00
|
|
|
option(PACK200_BUILD_BINARY "Build a tiny utility that decompresses pack200 streams" OFF)
|
|
|
|
|
2013-09-26 01:58:09 +01:00
|
|
|
# Find ZLIB for quazip
|
2015-09-28 19:53:46 +01:00
|
|
|
find_package(ZLIB REQUIRED)
|
2014-04-06 18:43:09 +01:00
|
|
|
|
|
|
|
set(PACK200_SRC
|
2014-04-09 14:41:49 +01:00
|
|
|
include/unpack200.h
|
|
|
|
src/bands.cpp
|
|
|
|
src/bands.h
|
|
|
|
src/bytes.cpp
|
|
|
|
src/bytes.h
|
|
|
|
src/coding.cpp
|
|
|
|
src/coding.h
|
|
|
|
src/constants.h
|
|
|
|
src/defines.h
|
|
|
|
src/unpack200.cpp
|
|
|
|
src/unpack.cpp
|
|
|
|
src/unpack.h
|
|
|
|
src/utils.cpp
|
|
|
|
src/utils.h
|
|
|
|
src/zip.cpp
|
|
|
|
src/zip.h
|
2013-09-26 01:58:09 +01:00
|
|
|
)
|
|
|
|
|
2017-05-06 16:22:14 +01:00
|
|
|
if (Qt5_POSITION_INDEPENDENT_CODE)
|
|
|
|
SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
|
|
|
endif()
|
2013-09-29 20:11:30 +01:00
|
|
|
|
2017-05-05 00:34:01 +01:00
|
|
|
add_library(MultiMC_unpack200 SHARED ${PACK200_SRC})
|
|
|
|
target_include_directories(MultiMC_unpack200 PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" "${CMAKE_CURRENT_BINARY_DIR}" PRIVATE ${ZLIB_INCLUDE_DIRS} "${CMAKE_CURRENT_SOURCE_DIR}/src")
|
|
|
|
target_link_libraries(MultiMC_unpack200 ${ZLIB_LIBRARIES})
|
2013-09-26 01:58:09 +01:00
|
|
|
|
2017-05-05 00:34:01 +01:00
|
|
|
set_target_properties(MultiMC_unpack200 PROPERTIES CXX_VISIBILITY_PRESET hidden VISIBILITY_INLINES_HIDDEN 1)
|
|
|
|
generate_export_header(MultiMC_unpack200)
|
2013-09-29 20:11:30 +01:00
|
|
|
|
2018-01-22 03:28:07 +00:00
|
|
|
# Install it
|
2018-01-27 01:42:27 +00:00
|
|
|
install(
|
|
|
|
TARGETS MultiMC_unpack200
|
|
|
|
RUNTIME DESTINATION ${LIBRARY_DEST_DIR}
|
|
|
|
LIBRARY DESTINATION ${LIBRARY_DEST_DIR}
|
|
|
|
)
|
2018-01-22 03:28:07 +00:00
|
|
|
|
2015-09-28 19:53:46 +01:00
|
|
|
if(PACK200_BUILD_BINARY)
|
|
|
|
add_executable(anti200 anti200.cpp)
|
2017-05-05 00:34:01 +01:00
|
|
|
target_link_libraries(anti200 MultiMC_unpack200)
|
2015-09-28 19:53:46 +01:00
|
|
|
endif()
|