Diff of /CMakeLists.txt [58f684] .. [0abf58] Maximize Restore

  Switch to side-by-side view

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -18,9 +18,30 @@
 #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)
@@ -32,39 +53,41 @@
   SET(PANO_LIBRARIES ${PANO13_LIBRARIES})
   SET(PANO_INCLUDE_DIR ${PANO13_INCLUDE_DIR})
 ELSE(PANO13_FOUND)
-  ERROR("Either libpano13 or libpano12 are required")
+  MESSAGE(SEND_ERROR "Either libpano13 or libpano12 are required")
 ENDIF(PANO13_FOUND) 
-
-FIND_PACKAGE(PNG REQUIRED)
-FIND_PACKAGE(OpenEXR)
-
-IF (OPENEXR_FOUND)
-include_directories(${OPENEXR_INCLUDE_DIR})
-ENDIF (OPENEXR_FOUND)
+INCLUDE_DIRECTORIES(${PANO_INCLUDE_DIR})
+
+##
+## Boost
+##
 
 FIND_PACKAGE(Boost REQUIRED)
 
-SET(wxWidgets_USE_LIBS base core xrc)
+
+##
+## 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 (hugin, nona_gui) disabled")
+  MESSAGE("wxWidgets was not found, GUI programs (hugin, nona_gui) disabled")
 ENDIF(NOT wxWidgets_FOUND) 
 
-FIND_PACKAGE(MSGFMT REQUIRED)
-IF(MSGFMT_FOUND)
-  MESSAGE(STATUS "Program msgfmt found (${MSGFMT_EXECUTABLE})")
-ENDIF(MSGFMT_FOUND)
-
-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)
-
-MESSAGE("tiff libraries: ${TIFF_LIBRARIES}")
-MESSAGE("tiff include dir: ${TIFF_INCLUDE_DIR}")
+
+
+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)
@@ -92,11 +115,12 @@
 #  SET(CMAKE_C_FLAGS_DEBUG "-g3 -O0 -Wall -DDEBUG" CACHE)
 #ENDIF(UNIX)
 
-IF (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})
@@ -107,21 +131,23 @@
     SET(HUGIN_SHARED_LIBS 1)
   ENDIF (${HUGIN_SHARED})
   MESSAGE("Using shared libraries")
-ELSEIF (WIN32)
-  SET(HUGINDATADIR "")
-  SET(DATADIR xrc)
-  SET(BINDIR  "")
-  SET(ICONDIR  "")
-  SET(LINKDIR  "")
+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)
-
-  # backward compatibility
-  SET(INSTALL_XRC_DIR xrc)
-  SET(INSTALL_LOCALE_DIR locale)
-ENDIF(UNIX)
+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
@@ -148,7 +174,6 @@
 LINK_DIRECTORIES( ${VIPSCC_LIBRARY_DIRS} )
 INCLUDE_DIRECTORIES( ${VIPSCC_INCLUDE_DIRS} )
 
-INCLUDE_DIRECTORIES(${PANO_INCLUDE_DIR})
 
 add_subdirectory(src)
 add_subdirectory(doc)