-
Notifications
You must be signed in to change notification settings - Fork 16
/
CMakeLists.txt
147 lines (123 loc) · 3.89 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
cmake_minimum_required(VERSION 3.15)
cmake_policy(SET CMP0048 NEW)
project(dovo VERSION 1.0.20)
add_definitions(-DDOVO_VERSION="${PROJECT_VERSION}")
if(WIN32 OR APPLE)
set(CMAKE_CXX_STANDARD 11)
else()
#ubuntu 22.04
set(CMAKE_CXX_STANDARD 17)
endif()
if(WIN32)
#VC++ stuff
add_definitions(-D_WIN32_WINNT=0x0601)
add_definitions(-D_UNICODE)
add_definitions(-D_BIND_TO_CURRENT_VCLIBS_VERSION=1)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif()
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREADED ON)
if(WIN32 OR APPLE)
set(Boost_USE_STATIC_RUNTIME ON)
endif()
find_package(Boost REQUIRED thread filesystem system regex date_time)
if(WIN32)
#enable dcmtk filename to have wide version, only affects WIN32. http://utf8everywhere.org/
add_definitions(-DDCMTK_WIDE_CHAR_FILE_IO_FUNCTIONS=1)
endif()
find_package(DCMTK REQUIRED)
#include zlib
find_package(ZLIB REQUIRED ${ZLIB_ROOT})
#include openjpeg
find_package(OpenJPEG REQUIRED)
add_definitions(-DOPJ_STATIC)
#include fmjpeg2koj
find_package(fmjpeg2k REQUIRED)
set (OPENSSL_USE_STATIC_LIBS TRUE)
set (OPENSSL_MSVC_STATIC_RT TRUE)
find_package(OpenSSL REQUIRED)
set(wxWidgets_USE_STATIC ON)
#define this so that wxWidgets doesn't define it. Conflicts w/ dcmtk's declaration
#add_definitions(-DHAVE_SSIZE_T)
find_package(wxWidgets COMPONENTS core base adv REQUIRED)
include(${wxWidgets_USE_FILE})
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/sqlite3 ${Boost_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/boost-wintls/include ${FMJPEG2K_INCLUDE_DIRS} ${DCMTK_INCLUDE_DIRS} ${VLD}/include)
LINK_DIRECTORIES(${FMJPEG2K}/lib ${Boost_LIBRARY_DIRS} ${VLD}/lib/Win64)
set(dovo_HEADERS
src/gui.h
src/dovo_about.h
src/dovo_changePatientInfo.h
src/dovo_destination.h
src/dovo_mainFrame.h
src/dovo_searchStatus.h
src/dovo_sendStatus.h
src/dovo_changePatientInfo.h
src/dovo_updateCheck.h
sqlite3/sqlite3.h
src/engine.h
src/patientdata.h
src/destinationentry.h
src/dicomscanner.h
src/dicomsender.h
src/dcm2img.h
src/update.h
src/alphanum.hpp
src/fetch.h
)
set(dovo_SRCS
${dovo_HEADERS}
src/main.cpp
src/gui.cpp
src/dovo_about.cpp
src/dovo_changePatientInfo.cpp
src/dovo_destination.cpp
src/dovo_mainFrame.cpp
src/dovo_searchStatus.cpp
src/dovo_sendStatus.cpp
src/dovo_changePatientInfo.cpp
src/dovo_updateCheck.cpp
sqlite3/sqlite3.c
sqlite3/sqlite3_exec_stmt.c
src/engine.cpp
src/patientdata.cpp
src/dicomscanner.cpp
src/dicomsender.cpp
src/dcm2img.cpp
src/update.cpp
src/fetch.cpp
)
if(WIN32)
set(dovo_SRCS ${dovo_SRCS} src/win/dovo.rc src/win/version.rc src/win/dovo.manifest)
string(REPLACE "." "," RC_DOVO_VERSION ${dovo_VERSION})
add_definitions(-DRC_DOVO_VERSION=${RC_DOVO_VERSION})
endif()
if(APPLE)
set(dovo_SRCS ${dovo_SRCS} src/osx/dovo.icns src/osx/Info.plist.in)
endif()
ADD_EXECUTABLE(dovo WIN32 MACOSX_BUNDLE ${dovo_SRCS})
IF(WIN32)
SET(OS_SPECIFIC_LIBS netapi32 wsock32 odbc32 Rpcrt4 Crypt32)
ELSE()
IF(APPLE)
ELSE()
SET(OS_SPECIFIC_LIBS dl)
ENDIF()
ENDIF()
if(APPLE)
set_target_properties(dovo PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_SOURCE_DIR}/src/osx/Info.plist.in)
set_target_properties(dovo PROPERTIES MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION})
SET_SOURCE_FILES_PROPERTIES(${CMAKE_SOURCE_DIR}/src/osx/dovo.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
ENDIF()
TARGET_LINK_LIBRARIES(dovo
${FMJPEG2K_LIBRARIES}
${OPENJPEG_LIBRARIES}
${ZLIB_LIBRARIES}
${LIBICONV_LIBRARIES}
${DCMTK_LIBRARIES}
${wxWidgets_LIBRARIES}
${Boost_LIBRARIES}
${OPENSSL_LIBRARIES}
${OS_SPECIFIC_LIBS}
)
configure_file("installers/wix/Product.wxs.in" "${CMAKE_CURRENT_SOURCE_DIR}/installers/wix/Product.wxs")
configure_file("installers/deb/control.in" "${CMAKE_CURRENT_SOURCE_DIR}/installers/deb/control")