[0abf58]: CMakeLists.txt  Maximize  Restore  History

Download this file

219 lines (177 with data), 5.7 kB

  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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMakeModules )
include(HuginMacros)
include(CheckIncludeFiles)
## global setup
project(hugin)
# version
set(V_MAJOR 0)
set(V_MINOR 7)
set(V_PATCH 0)
# version for internal libraries.
set(HUGIN_LIB_VERSION 0.0)
#FIND_PACKAGE(BISON REQUIRED)
#FIND_PACKAGE(FLEX REQUIRED)
# find dependencies
IF (UNIX)
FIND_PACKAGE(PkgConfig)
ENDIF (UNIX)
##
## Graphics libraries
##
FIND_PACKAGE(TIFF REQUIRED)
INCLUDE_DIRECTORIES(${TIFF_INCLUDE_DIR})
FIND_PACKAGE(JPEG REQUIRED)
INCLUDE_DIRECTORIES(${JPEG_INCLUDE_DIR})
FIND_PACKAGE(PNG REQUIRED)
INCLUDE_DIRECTORIES(${PNG_INCLUDE_DIR})
FIND_PACKAGE(OpenEXR)
IF (OPENEXR_FOUND)
include_directories(${OPENEXR_INCLUDE_DIR})
ENDIF (OPENEXR_FOUND)
##
## Panotools
##
FIND_PACKAGE(PANO13)
FIND_PACKAGE(PANO12)
IF(PANO13_FOUND)
SET(PANO_LIBRARIES ${PANO13_LIBRARIES})
SET(PANO_INCLUDE_DIR ${PANO13_INCLUDE_DIR})
ELSEIF(PANO12_FOUND)
SET(PANO_LIBRARIES ${PANO13_LIBRARIES})
SET(PANO_INCLUDE_DIR ${PANO13_INCLUDE_DIR})
ELSE(PANO13_FOUND)
MESSAGE(SEND_ERROR "Either libpano13 or libpano12 are required")
ENDIF(PANO13_FOUND)
INCLUDE_DIRECTORIES(${PANO_INCLUDE_DIR})
##
## Boost
##
FIND_PACKAGE(Boost REQUIRED)
##
## wxWidgets
##
SET(wxWidgets_USE_LIBS base core xrc html xml adv)
FIND_PACKAGE(wxWidgets REQUIRED)
IF(NOT wxWidgets_FOUND)
MESSAGE("wxWidgets was not found, GUI programs (hugin, nona_gui) disabled")
ENDIF(NOT wxWidgets_FOUND)
IF (WIN32)
# todo: check for vips (not needed right now)
ELSE (WIN32)
pkg_check_modules(VIPS vips-7.12)
LIST2STRING(VIPS_CFLAGS_OTHER VIPS_CFLAGS_OTHER_STRING)
LIST2STRING(VIPS_LDFLAGS_OTHER VIPS_LDFLAGS_OTHER_STRING)
pkg_check_modules(VIPSCC vipsCC-7.12)
LIST2STRING(VIPSCC_CFLAGS_OTHER VIPSCC_CFLAGS_OTHER_STRING)
LIST2STRING(VIPSCC_LDFLAGS_OTHER VIPSCC_LDFLAGS_OTHER_STRING)
ENDIF (WIN32)
#BUILD SETUP
IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
FORCE)
ENDIF(NOT CMAKE_BUILD_TYPE)
# allow user to specify lib suffix
set(LIB_SUFFIX "" CACHE STRING "Define suffix of lib directory name (32/64)" )
set(HUGIN_SHARED "1" CACHE STRING "Build shared internal libraries" )
IF(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
MESSAGE("Building in Debug mode, resulting programs will be SLOW")
ADD_DEFINITIONS(-DDEBUG)
IF(UNIX)
ADD_DEFINITIONS(-Wall)
ENDIF(UNIX)
ENDIF(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
#IF(UNIX)
# SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -Wall" CACHE)
# SET(CMAKE_C_FLAGS_RELEASE "-O2 -Wall" CACHE)
# SET(CMAKE_CXX_FLAGS_DEBUG "-g3 -O0 -Wall -DDEBUG" qCACHE)
# SET(CMAKE_C_FLAGS_DEBUG "-g3 -O0 -Wall -DDEBUG" CACHE)
#ENDIF(UNIX)
IF (UNIX OR APPLE)
# define destination dirs (relative to prefix)
SET(HUGINDATADIR share/hugin)
SET(DATADIR share)
SET(BINDIR bin)
SET(LOCALEDIR share/locale)
SET(ICONDIR share/icons)
SET(LINKDIR share/applications)
SET(LIBDIR lib${LIB_SUFFIX})
SET(INSTALL_XRC_DIR ${CMAKE_INSTALL_PREFIX}/share/hugin/xrc)
IF (${HUGIN_SHARED})
# use shared internal libraries
SET(HUGIN_SHARED_LIBS 1)
ENDIF (${HUGIN_SHARED})
MESSAGE("Using shared libraries")
ELSE (UNIX OR APPLE)
# Windows
SET(BINDIR ${CMAKE_INSTALL_PREFIX})
SET(DATADIR ${CMAKE_INSTALL_PREFIX})
SET(HUGINDATADIR ${CMAKE_INSTALL_PREFIX})
SET(LIBDIR ${CMAKE_INSTALL_PREFIX})
SET(LOCALEDIR ${CMAKE_INSTALL_PREFIX}/share/locale)
# no shared libs DLL on windows. The code is just
# not set up for that..
ADD_DEFINITIONS(-DVIGRA_STATIC_LIB)
ENDIF (UNIX OR APPLE)
FIND_PACKAGE(MSGFMT REQUIRED)
IF(MSGFMT_FOUND)
MESSAGE(STATUS "Program msgfmt found (${MSGFMT_EXECUTABLE})")
ENDIF(MSGFMT_FOUND)
#This namespace workaround is not needed for CMake >= 2.5.x
IF (APPLE)
## Add needed Compiler and Linker flags for OSX
IF (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -flat_namespace -undefined suppress" )
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flat_namespace -undefined suppress" )
SET (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -flat_namespace -undefined suppress" )
SET (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -flat_namespace -undefined suppress" )
SET (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -flat_namespace -undefined suppress" )
ENDIF (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
ENDIF (APPLE)
# create config.h file
configure_file(src/hugin_config.h.in.cmake ${CMAKE_BINARY_DIR}/src/hugin_config.h)
# setup some common compilation flags
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
LINK_DIRECTORIES( ${VIPSCC_LIBRARY_DIRS} )
INCLUDE_DIRECTORIES( ${VIPSCC_INCLUDE_DIRS} )
add_subdirectory(src)
add_subdirectory(doc)
SET(CPACK_PACKAGE_VERSION_MAJOR "${V_MAJOR}")
SET(CPACK_PACKAGE_VERSION_MINOR "${V_MINOR}")
SET(CPACK_PACKAGE_VERSION_PATCH "${V_PATCH}")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${V_MAJOR}.${V_MINOR}")
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "hugin-${V_MAJOR}.${V_MINOR}.${V_PATCH}")
SET(CPACK_SOURCE_GENERATOR "TGZ")
SET(CPACK_SOURCE_IGNORE_FILES
"/_CPack_Packages/"
"/CMakeCache.txt$"
"\\\\.dir/"
"\\\\.tar\\\\.gz$"
"\\\\.tar\\\\.Z$"
"\\\\.svn/"
"\\\\.cvsignore$"
"\\\\.swp$"
"~$"
"\\\\.#"
"/#"
"/tools/autooptimiser$"
"/tools/fulla$"
"/tools/nona$"
"/tools/vig_optimize$"
"/hugin/hugin$"
"/nona_gui/nona_gui$"
"/stitch_project/hugin_stitch_project$"
"/deghosting/hugin_hdrmerge$"
"/build/"
"/CVS/"
"/\\\\.libs/"
"/\\\\.deps/"
"\\\\.o$"
"\\\\.a$"
"\\\\.lo$"
"\\\\.so$"
"\\\\.la$"
"Makefile\\\\.in$"
)
INCLUDE(CPack)

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks