forked from ffsup2/RawTherapee-Fork
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
executable file
·115 lines (107 loc) · 5.2 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
cmake_minimum_required(VERSION 2.6)
set (CMAKE_BUILD_TYPE Debug CACHE STRING "One of: None Debug Release RelWithDebInfo MinSizeRel." FORCE)
option (BUILD_SHARED "Build rawtherapee with shared libraries" OFF)
option (WITH_RAWZOR "Build with Rawzor support" ON)
# set install directories
if (NOT DEFINED DATADIR)
if (WIN32 OR APPLE)
set (DATADIR ${CMAKE_CURRENT_SOURCE_DIR}/release)
else (WIN32 OR APPLE)
set (DATADIR ${CMAKE_INSTALL_PREFIX}/share/rawtherapee)
endif (WIN32 OR APPLE)
endif (NOT DEFINED DATADIR)
if (NOT DEFINED BINDIR)
if (WIN32 OR APPLE)
set (BINDIR ${CMAKE_CURRENT_SOURCE_DIR}/release)
else (WIN32 OR APPLE)
set (BINDIR ${CMAKE_INSTALL_PREFIX}/bin)
endif (WIN32 OR APPLE)
endif (NOT DEFINED BINDIR)
if (NOT DEFINED LIBDIR)
if (WIN32 OR APPLE)
set (LIBDIR ${CMAKE_CURRENT_SOURCE_DIR}/release)
else (WIN32 OR APPLE)
set (LIBDIR ${CMAKE_INSTALL_PREFIX}/lib)
endif (WIN32 OR APPLE)
endif (NOT DEFINED LIBDIR)
# check for libraries
find_package(PkgConfig)
pkg_check_modules (GTK REQUIRED gtk+-2.0>=2.12)
pkg_check_modules (GLIB2 REQUIRED glib-2.0>=2.16)
pkg_check_modules (GLIBMM REQUIRED glibmm-2.4>=2.16)
pkg_check_modules (GTKMM REQUIRED gtkmm-2.4>=2.12)
pkg_check_modules (GIO REQUIRED gio-2.0>=2.16)
pkg_check_modules (GIOMM REQUIRED giomm-2.4>=2.12)
pkg_check_modules (GTHREAD REQUIRED gthread-2.0>=2.16)
pkg_check_modules (GOBJECT REQUIRED gobject-2.0>=2.16)
pkg_check_modules (SIGC REQUIRED sigc++-2.0)
# NOTE: dependencies should be handled by pkg_check_modules and FIND_PACKAGE
# on windows too but I don't want to break current build chain
if (WIN32)
set (EXTRA_LIBDIR "${CMAKE_CURRENT_SOURCE_DIR}/lib")
set (EXTRA_INCDIR "${CMAKE_CURRENT_SOURCE_DIR}/winclude")
set (EXTRA_LIB "ws2_32")
set (IPTCDATA_LIBRARIES iptcdata)
set (LCMS_LIBRARIES liblcms.a)
set (JPEG_LIBRARIES libjpeg.a)
set (PNG_LIBRARIES libpng.a)
set (TIFF_LIBRARIES libtiff.a)
set (ZLIB_LIBRARIES libz.a)
else (WIN32)
pkg_check_modules (IPTCDATA REQUIRED libiptcdata)
pkg_check_modules (LCMS REQUIRED lcms)
find_package (JPEG REQUIRED)
find_package (PNG REQUIRED)
find_package (TIFF REQUIRED)
find_package (ZLIB REQUIRED)
endif (WIN32)
# link rawzor
if (WITH_RAWZOR)
if (WIN32)
set (EXTRA_INCDIR ${EXTRA_INCDIR} "${CMAKE_CURRENT_SOURCE_DIR}/rawzor_win")
set (EXTRA_LIBDIR ${EXTRA_LIBDIR} "${CMAKE_CURRENT_SOURCE_DIR}/rawzor_win")
set (EXTRA_LIB ${EXTRA_LIB} "${CMAKE_CURRENT_SOURCE_DIR}/rawzor_win/rwz_sdk_s.a")
add_definitions (-DRAWZOR_SUPPORT)
install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/rawzor_win/rwz_sdk_s.dll DESTINATION ${BINDIR}
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ)
elseif (APPLE)
set (EXTRA_INCDIR "${CMAKE_CURRENT_SOURCE_DIR}/rawzor_mac")
set (EXTRA_LIBDIR "${CMAKE_CURRENT_SOURCE_DIR}/rawzor_mac")
set (EXTRA_LIB "-lrwz_sdk_64")
add_definitions (-DRAWZOR_SUPPORT)
install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/rawzor_mac/librwz_sdk_64.dylib DESTINATION ${BINDIR}
PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ RENAME rwz_sdk_64.dylib)
if (BUILD_SHARED)
install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/rawzor_mac/librwz_sdk_64.dylib DESTINATION ${LIBDIR}
PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ RENAME rwz_sdk_64.dylib)
endif (BUILD_SHARED)
else (WIN32)
if (CMAKE_SIZEOF_VOID_P EQUAL 4)
set (EXTRA_INCDIR ${EXTRA_INCDIR} "${CMAKE_CURRENT_SOURCE_DIR}/rawzor_lin32")
set (EXTRA_LIBDIR ${EXTRA_LIBDIR} "${CMAKE_CURRENT_SOURCE_DIR}/rawzor_lin32")
set (EXTRA_LIB ${EXTRA_LIB} "-lrwz_sdk")
add_definitions (-DRAWZOR_SUPPORT)
install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/rawzor_lin32/librwz_sdk.so DESTINATION ${BINDIR}
PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ RENAME rwz_sdk.so)
if (BUILD_SHARED)
install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/rawzor_lin32/librwz_sdk.so DESTINATION ${LIBDIR}
PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ RENAME rwz_sdk.so)
endif (BUILD_SHARED)
elseif (CMAKE_SIZEOF_VOID_P EQUAL 8)
set (EXTRA_INCDIR ${EXTRA_INCDIR} "${CMAKE_CURRENT_SOURCE_DIR}/rawzor_lin64")
set (EXTRA_LIBDIR ${EXTRA_LIBDIR} "${CMAKE_CURRENT_SOURCE_DIR}/rawzor_lin64")
set (EXTRA_LIB ${EXTRA_LIB} "-lrwz_sdk")
add_definitions (-DRAWZOR_SUPPORT)
install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/rawzor_lin64/librwz_sdk.so DESTINATION ${BINDIR}
PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ RENAME rwz_sdk.so)
if (BUILD_SHARED)
install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/rawzor_lin64/librwz_sdk.so DESTINATION ${LIBDIR}
PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ RENAME rwz_sdk.so)
endif (BUILD_SHARED)
endif (CMAKE_SIZEOF_VOID_P EQUAL 4)
endif (WIN32)
endif (WITH_RAWZOR)
add_subdirectory (rtexif)
add_subdirectory (rtengine)
add_subdirectory (rtgui)
add_subdirectory (rtdata)