This repository has been archived by the owner on Sep 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
66 lines (55 loc) · 2.14 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
cmake_minimum_required(VERSION 3.1.0)
include(FindPkgConfig)
project(renamifier VERSION 0.1.4 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
find_package(Qt5 COMPONENTS Widgets REQUIRED)
find_package(Qt5Test REQUIRED)
pkg_search_module(POPPLER REQUIRED poppler-qt5)
enable_testing(true)
add_library(renamifier-ui
mainwindow.cpp
renderer.cpp
viewer.cpp)
target_include_directories(renamifier-ui
SYSTEM PUBLIC ${POPPLER_INCLUDE_DIRS})
target_link_libraries(renamifier-ui
Qt5::Widgets ${POPPLER_LIBRARIES})
add_executable(renamifier WIN32
renamifier.cpp
renamifier.qrc)
target_include_directories(renamifier
SYSTEM PUBLIC ${POPPLER_INCLUDE_DIRS})
target_link_libraries(renamifier
Qt5::Widgets ${POPPLER_LIBRARIES} renamifier-ui)
add_executable(renamifier-test
test.cpp
test.qrc)
target_include_directories(renamifier-test
SYSTEM PUBLIC ${POPPLER_INCLUDE_DIRS})
target_link_libraries(renamifier-test
Qt5::Widgets Qt5::Test ${POPPLER_LIBRARIES} renamifier-ui)
add_test(NAME renamifier-test COMMAND renamifier-test)
if(WIN32)
# Deploy the Qt runtime
add_custom_command(TARGET renamifier
POST_BUILD
COMMAND windeployqt
-xml
--compiler-runtime
--dir $<TARGET_FILE_DIR:renamifier>
$<TARGET_FILE:renamifier>)
# Copy the NSIS script to build the installer
file(COPY ${CMAKE_SOURCE_DIR}/winsetup.nsi
DESTINATION ${CMAKE_BINARY_DIR})
# Copy the license for the installer, and convert it to DOS format
file(COPY ${CMAKE_SOURCE_DIR}/COPYING
DESTINATION ${CMAKE_BINARY_DIR})
add_custom_command(TARGET renamifier
POST_BUILD
COMMAND unix2dos
${CMAKE_BINARY_DIR}/COPYING)
endif(WIN32)