This repository has been archived by the owner on Oct 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
79 lines (64 loc) · 2.95 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
cmake_minimum_required(VERSION 2.6)
project(ZipPicView CXX)
set(CMAKE_CXX_STANDARD 11)
option(USE_CIMG "Use CImg for image scaling (much slower, disabled by defaults)")
set(SRC Entry.cpp MainFrame.cpp ZipPicViewApp.cpp ImageViewPanel.cpp ZipEntry.cpp
FileEntry.cpp ThumbnailLoadThread.cpp ThumbnailLoadThread.h ArchiveExtractor.cpp)
if (MSYS)
enable_language(RC)
set(SRC ${SRC} resource.rc)
INCLUDE(InstallRequiredSystemLibraries)
get_filename_component( Mingw_Path ${CMAKE_CXX_COMPILER} PATH )
set( CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS
${Mingw_Path}/libarchive-13.dll
${Mingw_Path}/libbz2-1.dll
${Mingw_Path}/libexpat-1.dll
${Mingw_Path}/libiconv-2.dll
${Mingw_Path}/libjpeg-8.dll
${Mingw_Path}/liblzma-5.dll
${Mingw_Path}/liblzo2-2.dll
${Mingw_Path}/libnettle-6-2.dll
${Mingw_Path}/libpng16-16.dll
${Mingw_Path}/libtiff-5.dll
${Mingw_Path}/libwinpthread-1.dll
${Mingw_Path}/libzip-4.dll
${Mingw_Path}/wxbase30u_gcc_custom.dll
${Mingw_Path}/wxmsw30u_core_gcc_custom.dll
${Mingw_Path}/zlib1.dll)
if(CMAKE_SIZEOF_VOID_P EQUAL 8) #win64
set ( CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}
${Mingw_Path}/libgcc_s_seh-1.dll ${Mingw_Path}/libstdc++-6.dll)
else() #win32
set ( CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}
${Mingw_Path}/libgcc_s_dw2-1.dll ${Mingw_Path}/libstdc++-6.dll)
endif(CMAKE_SIZEOF_VOID_P EQUAL 8)
endif (MSYS)
add_executable(${PROJECT_NAME} ${SRC} )
set(wxWidgets_CONFIGURATION mswu)
find_package(wxWidgets COMPONENTS core base REQUIRED)
find_package(PkgConfig REQUIRED)
pkg_check_modules(LIBZIP REQUIRED libzip)
pkg_check_modules(LIBARCHIVE REQUIRED libarchive)
include(${wxWidgets_USE_FILE})
include_directories(${LIBZIP_INCLUDE_DIRS})
include_directories(${LIBARCHIVE_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} ${wxWidgets_LIBRARIES} ${LIBZIP_LIBRARIES} ${LIBARCHIVE_LIBRARIES})
if(USE_CIMG)
add_definitions(-DUSE_CIMG)
endif()
if (WINDOWS OR MSYS)
install( PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} DESTINATION . )
endif (WINDOWS OR MSYS)
install( TARGETS ${PROJECT_NAME} RUNTIME DESTINATION . )
SET(CPACK_PACKAGE_VERSION_MAJOR "0" CACHE STRING "Major Version")
SET(CPACK_PACKAGE_VERSION_MINOR "0" CACHE STRING "Minor Version")
SET(CPACK_PACKAGE_VERSION_PATCH "0" CACHE STRING "Patch Version")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "In-ZIP file imager viewer")
SET(CPACK_PACKAGE_VENDOR "Wutipong Wongsakuldej aka mr_tawan")
set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/res/appicon.ico")
set(CPACK_PACKAGE_EXECUTABLES ${PROJECT_NAME} ${PROJECT_NAME})
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt")
set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
set(CPACK_WIX_UPGRADE_GUID "C36E8433-FF32-4CBA-B574-96060B209EA6")
include(CPack)