From: <da...@us...> - 2007-12-31 19:14:35
|
Revision: 2584 http://hugin.svn.sourceforge.net/hugin/?rev=2584&view=rev Author: dangelo Date: 2007-12-31 11:14:31 -0800 (Mon, 31 Dec 2007) Log Message: ----------- Win32: Debug build with MSVC works now. Modified Paths: -------------- hugin/trunk/CMakeLists.txt hugin/trunk/CMakeModules/FindJPEG.cmake hugin/trunk/CMakeModules/FindPNG.cmake hugin/trunk/CMakeModules/FindTIFF.cmake hugin/trunk/CMakeModules/FindZLIB.cmake hugin/trunk/CMakeModules/win_bundle.cmake hugin/trunk/platforms/windows/msi/WixFragmentRegistry.wxs hugin/trunk/src/CMakeLists.txt Added Paths: ----------- hugin/trunk/CMakeModules/FindLibraryWithDebug.cmake hugin/trunk/CMakeModules/FindPackageHandleStandardArgs.cmake Modified: hugin/trunk/CMakeLists.txt =================================================================== --- hugin/trunk/CMakeLists.txt 2007-12-30 22:21:49 UTC (rev 2583) +++ hugin/trunk/CMakeLists.txt 2007-12-31 19:14:31 UTC (rev 2584) @@ -88,6 +88,7 @@ FIND_PACKAGE(JPEG REQUIRED) INCLUDE_DIRECTORIES(${JPEG_INCLUDE_DIR}) FIND_PACKAGE(PNG REQUIRED) +INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR}) INCLUDE_DIRECTORIES(${PNG_INCLUDE_DIR}) FIND_PACKAGE(OpenEXR REQUIRED) @@ -116,6 +117,7 @@ ## +SET(Boost_LIB_SUFFIX_DEBUG gd) FIND_PACKAGE(Boost REQUIRED thread) IF (NOT Boost_thread_FOUND) MESSAGE(FATAL_ERROR "boost thread library not found. If it is installed with a\nunrecognized suffix, specify it with -DBoost_LIB_SUFFIX=<suffix>") Modified: hugin/trunk/CMakeModules/FindJPEG.cmake =================================================================== --- hugin/trunk/CMakeModules/FindJPEG.cmake 2007-12-30 22:21:49 UTC (rev 2583) +++ hugin/trunk/CMakeModules/FindJPEG.cmake 2007-12-31 19:14:31 UTC (rev 2584) @@ -20,20 +20,18 @@ ${wxWidgets_ROOT_DIR}/src/jpeg ) -FIND_LIBRARY( JPEG_LIBRARIES - NAMES jpeg wxjpeg +include(FindLibraryWithDebug) + +find_library_with_debug(JPEG_LIBRARIES + WIN32_DEBUG_POSTFIX d + NAMES jpeg libjpeg wxjpeg PATHS /usr/lib /usr/local/lib ${wxWidgets_LIB_DIR} ) -IF(JPEG_INCLUDE_DIR) - IF(JPEG_LIBRARIES) - SET( JPEG_FOUND "YES" ) - FIND_LIBRARY( JPEG_DEBUG_LIBRARIES - NAMES jpegd wxjpegd - PATHS /usr/lib /usr/local/lib ${wxWidgets_LIB_DIR} - ) - ENDIF(JPEG_LIBRARIES) -ENDIF(JPEG_INCLUDE_DIR) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(JPEG DEFAULT_MSG + JPEG_INCLUDE_DIR JPEG_LIBRARIES) +MARK_AS_ADVANCED(JPEG_INCLUDE_DIR JPEG_LIBRARIES ) Added: hugin/trunk/CMakeModules/FindLibraryWithDebug.cmake =================================================================== --- hugin/trunk/CMakeModules/FindLibraryWithDebug.cmake (rev 0) +++ hugin/trunk/CMakeModules/FindLibraryWithDebug.cmake 2007-12-31 19:14:31 UTC (rev 2584) @@ -0,0 +1,113 @@ +# +# FIND_LIBRARY_WITH_DEBUG +# -> enhanced FIND_LIBRARY to allow the search for an +# optional debug library with a WIN32_DEBUG_POSTFIX similar +# to CMAKE_DEBUG_POSTFIX when creating a shared lib +# it has to be the second and third argument + +# Copyright (c) 2007, Christian Ehrlicher, <ch....@gm...> +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +MACRO(FIND_LIBRARY_WITH_DEBUG var_name win32_dbg_postfix_name dgb_postfix libname) + + IF(NOT "${win32_dbg_postfix_name}" STREQUAL "WIN32_DEBUG_POSTFIX") + + # no WIN32_DEBUG_POSTFIX -> simply pass all arguments to FIND_LIBRARY + FIND_LIBRARY(${var_name} + ${win32_dbg_postfix_name} + ${dgb_postfix} + ${libname} + ${ARGN} + ) + + ELSE(NOT "${win32_dbg_postfix_name}" STREQUAL "WIN32_DEBUG_POSTFIX") + + IF(NOT WIN32) + # on non-win32 we don't need to take care about WIN32_DEBUG_POSTFIX + + FIND_LIBRARY(${var_name} ${libname} ${ARGN}) + + ELSE(NOT WIN32) + + # 1. get all possible libnames + SET(args ${ARGN}) + SET(newargs "") + SET(libnames_release "") + SET(libnames_debug "") + + LIST(LENGTH args listCount) + + IF("${libname}" STREQUAL "NAMES") + SET(append_rest 0) + LIST(APPEND args " ") + + FOREACH(i RANGE ${listCount}) + LIST(GET args ${i} val) + + IF(append_rest) + LIST(APPEND newargs ${val}) + ELSE(append_rest) + IF("${val}" STREQUAL "PATHS") + LIST(APPEND newargs ${val}) + SET(append_rest 1) + ELSE("${val}" STREQUAL "PATHS") + LIST(APPEND libnames_release "${val}") + LIST(APPEND libnames_debug "${val}${dgb_postfix}") + ENDIF("${val}" STREQUAL "PATHS") + ENDIF(append_rest) + + ENDFOREACH(i) + + ELSE("${libname}" STREQUAL "NAMES") + + # just one name + LIST(APPEND libnames_release "${libname}") + LIST(APPEND libnames_debug "${libname}${dgb_postfix}") + + SET(newargs ${args}) + + ENDIF("${libname}" STREQUAL "NAMES") + + # search the release lib + FIND_LIBRARY(${var_name}_RELEASE + NAMES ${libnames_release} + ${newargs} + ) + + # search the debug lib + FIND_LIBRARY(${var_name}_DEBUG + NAMES ${libnames_debug} + ${newargs} + ) + + IF(${var_name}_RELEASE AND ${var_name}_DEBUG) + + # both libs found + SET(${var_name} optimized ${${var_name}_RELEASE} + debug ${${var_name}_DEBUG}) + + ELSE(${var_name}_RELEASE AND ${var_name}_DEBUG) + + IF(${var_name}_RELEASE) + + # only release found + SET(${var_name} ${${var_name}_RELEASE}) + + ELSE(${var_name}_RELEASE) + + # only debug (or nothing) found + SET(${var_name} ${${var_name}_DEBUG}) + + ENDIF(${var_name}_RELEASE) + + ENDIF(${var_name}_RELEASE AND ${var_name}_DEBUG) + + MARK_AS_ADVANCED(${var_name}_RELEASE) + MARK_AS_ADVANCED(${var_name}_DEBUG) + + ENDIF(NOT WIN32) + + ENDIF(NOT "${win32_dbg_postfix_name}" STREQUAL "WIN32_DEBUG_POSTFIX") + +ENDMACRO(FIND_LIBRARY_WITH_DEBUG) Modified: hugin/trunk/CMakeModules/FindPNG.cmake =================================================================== --- hugin/trunk/CMakeModules/FindPNG.cmake 2007-12-30 22:21:49 UTC (rev 2583) +++ hugin/trunk/CMakeModules/FindPNG.cmake 2007-12-31 19:14:31 UTC (rev 2584) @@ -11,48 +11,33 @@ # defines cache variables # PNG_INCLUDE_DIR, where to find headers # PNG_LIBRARIES, list of release link libraries. -# PNG_DEBUG_LIBRARIES, list of release link libraries. # PNG_FOUND, If != "YES", do not try to use PNG. # None of the above will be defined unless ZLIB can be found INCLUDE(FindZLIB) +include(FindLibraryWithDebug) + SET(PNG_FOUND "NO") IF (ZLIB_FOUND) - FIND_PATH(PNG_PNG_INCLUDE_DIR png.h + FIND_PATH(PNG_INCLUDE_DIR png.h /usr/local/include /usr/include ${wxWidgets_ROOT_DIR}/src/png ) - FIND_LIBRARY(PNG_LIBRARY + find_library_with_debug(PNG_LIBRARIES + WIN32_DEBUG_POSTFIX d NAMES png libpng wxpng PATHS /usr/lib /usr/local/lib ${wxWidgets_LIB_DIR} ) - IF(PNG_PNG_INCLUDE_DIR AND PNG_LIBRARY) - SET(PNG_INCLUDE_DIR ${PNG_PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} ) - SET(PNG_LIBRARIES ${PNG_LIBRARY} ${ZLIB_LIBRARY}) + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(PNG DEFAULT_MSG + PNG_INCLUDE_DIR PNG_LIBRARIES) - SET( PNG_FOUND "YES" ) - FIND_LIBRARY( PNG_DEBUG_LIBRARY - NAMES pngd wxpngd - PATHS /usr/lib /usr/local/lib ${wxWidgets_LIB_DIR} - ) - SET(PNG_DEBUG_LIBRARIES ${PNG_DEBUGLIBRARY} ${ZLIB_DEBUG_LIBRARY}) - ENDIF(PNG_PNG_INCLUDE_DIR AND PNG_LIBRARY) + SET(PNG_LIBRARIES ${PNG_LIBRARIES} ${ZLIB_LIBRARIES}) + MARK_AS_ADVANCED(PNG_INCLUDE_DIR PNG_LIBRARIES ) ENDIF(ZLIB_FOUND) -IF (PNG_FOUND) - IF (NOT PNG_FIND_QUIETLY) - MESSAGE(STATUS "Found PNG: ${PNG_LIBRARY}") - ENDIF (NOT PNG_FIND_QUIETLY) -ELSE (PNG_FOUND) - IF (PNG_FIND_REQUIRED) - MESSAGE(FATAL_ERROR "Could not find PNG library") - ENDIF (PNG_FIND_REQUIRED) -ENDIF (PNG_FOUND) - -MARK_AS_ADVANCED(PNG_PNG_INCLUDE_DIR PNG_LIBRARY ) - Added: hugin/trunk/CMakeModules/FindPackageHandleStandardArgs.cmake =================================================================== --- hugin/trunk/CMakeModules/FindPackageHandleStandardArgs.cmake (rev 0) +++ hugin/trunk/CMakeModules/FindPackageHandleStandardArgs.cmake 2007-12-31 19:14:31 UTC (rev 2584) @@ -0,0 +1,58 @@ +# FIND_PACKAGE_HANDLE_STANDARD_ARGS(NAME (DEFAULT_MSG|"Custom failure message") VAR1 ... ) +# This macro is intended to be used in FindXXX.cmake modules files. +# It handles the REQUIRED and QUIET argument to FIND_PACKAGE() and +# it also sets the <UPPERCASED_NAME>_FOUND variable. +# The package is found if all variables listed are TRUE. +# Example: +# +# FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2 DEFAULT_MSG LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR) +# +# LibXml2 is considered to be found, if both LIBXML2_LIBRARIES and +# LIBXML2_INCLUDE_DIR are valid. Then also LIBXML2_FOUND is set to TRUE. +# If it is not found and REQUIRED was used, it fails with FATAL_ERROR, +# independent whether QUIET was used or not. +# If it is found, the location is reported using the VAR1 argument, so +# here a message "Found LibXml2: /usr/lib/libxml2.so" will be printed out. +# If the second argument is DEFAULT_MSG, the message in the failure case will +# be "Could NOT find LibXml2", if you don't like this message you can specify +# your own custom failure message there. + +MACRO(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FAIL_MSG _VAR1 ) + + IF("${_FAIL_MSG}" STREQUAL "DEFAULT_MSG") + IF (${_NAME}_FIND_REQUIRED) + SET(_FAIL_MESSAGE "Could not find REQUIRED package ${_NAME}") + ELSE (${_NAME}_FIND_REQUIRED) + SET(_FAIL_MESSAGE "Could not find OPTIONAL package ${_NAME}") + ENDIF (${_NAME}_FIND_REQUIRED) + ELSE("${_FAIL_MSG}" STREQUAL "DEFAULT_MSG") + SET(_FAIL_MESSAGE "${_FAIL_MSG}") + ENDIF("${_FAIL_MSG}" STREQUAL "DEFAULT_MSG") + + STRING(TOUPPER ${_NAME} _NAME_UPPER) + + SET(${_NAME_UPPER}_FOUND TRUE) + IF(NOT ${_VAR1}) + SET(${_NAME_UPPER}_FOUND FALSE) + ENDIF(NOT ${_VAR1}) + + FOREACH(_CURRENT_VAR ${ARGN}) + IF(NOT ${_CURRENT_VAR}) + SET(${_NAME_UPPER}_FOUND FALSE) + ENDIF(NOT ${_CURRENT_VAR}) + ENDFOREACH(_CURRENT_VAR) + + IF (${_NAME_UPPER}_FOUND) + IF (NOT ${_NAME}_FIND_QUIETLY) + MESSAGE(STATUS "Found ${_NAME}: ${${_VAR1}}") + ENDIF (NOT ${_NAME}_FIND_QUIETLY) + ELSE (${_NAME_UPPER}_FOUND) + IF (${_NAME}_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "${_FAIL_MESSAGE}") + ELSE (${_NAME}_FIND_REQUIRED) + IF (NOT ${_NAME}_FIND_QUIETLY) + MESSAGE(STATUS "${_FAIL_MESSAGE}") + ENDIF (NOT ${_NAME}_FIND_QUIETLY) + ENDIF (${_NAME}_FIND_REQUIRED) + ENDIF (${_NAME_UPPER}_FOUND) +ENDMACRO(FIND_PACKAGE_HANDLE_STANDARD_ARGS) Modified: hugin/trunk/CMakeModules/FindTIFF.cmake =================================================================== --- hugin/trunk/CMakeModules/FindTIFF.cmake 2007-12-30 22:21:49 UTC (rev 2583) +++ hugin/trunk/CMakeModules/FindTIFF.cmake 2007-12-31 19:14:31 UTC (rev 2584) @@ -20,20 +20,18 @@ ${wxWidgets_ROOT_DIR}/src/tiff ) -FIND_LIBRARY( TIFF_LIBRARIES - NAMES tiff wxtiff +include(FindLibraryWithDebug) + +find_library_with_debug(TIFF_LIBRARIES + WIN32_DEBUG_POSTFIX d + NAMES tiff libtiff wxtiff PATHS /usr/lib /usr/local/lib ${wxWidgets_LIB_DIR} ) -IF(TIFF_INCLUDE_DIR) - IF(TIFF_LIBRARIES) - SET( TIFF_FOUND "YES" ) - FIND_LIBRARY( TIFF_DEBUG_LIBRARIES - NAMES tiffd wxtiffd - PATHS /usr/lib /usr/local/lib ${wxWidgets_LIB_DIR} - ) - ENDIF(TIFF_LIBRARIES) -ENDIF(TIFF_INCLUDE_DIR) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(TIFF DEFAULT_MSG + TIFF_INCLUDE_DIR TIFF_LIBRARIES) +MARK_AS_ADVANCED(TIFF_INCLUDE_DIR TIFF_LIBRARIES) Modified: hugin/trunk/CMakeModules/FindZLIB.cmake =================================================================== --- hugin/trunk/CMakeModules/FindZLIB.cmake 2007-12-30 22:21:49 UTC (rev 2583) +++ hugin/trunk/CMakeModules/FindZLIB.cmake 2007-12-31 19:14:31 UTC (rev 2584) @@ -26,42 +26,20 @@ ${wxWidgets_ROOT_DIR}/src/zlib ) -SET(ZLIB_NAMES z zlib zdll wxzlib) -FIND_LIBRARY(ZLIB_LIBRARY - NAMES ${ZLIB_NAMES} - PATHS /usr/lib /usr/local/lib ${wxWidgets_LIB_DIR} -) +include(FindLibraryWithDebug) -SET(ZLIB_DEBUG_NAMES zd zlibd zdlld wxzlibd) -FIND_LIBRARY(ZLIB_DEBUG_LIBRARY - NAMES ${ZLIB_DEBUG_NAMES} +find_library_with_debug(ZLIB_LIBRARIES + WIN32_DEBUG_POSTFIX d + NAMES z zlib wxzlib PATHS /usr/lib /usr/local/lib ${wxWidgets_LIB_DIR} ) -IF (ZLIB_INCLUDE_DIR AND ZLIB_LIBRARY) - SET(ZLIB_FOUND TRUE) - SET( ZLIB_LIBRARIES ${ZLIB_LIBRARY} ) - IF (ZLIB_DEBUG_LIBRARY) - SET(ZLIB_DEBUG_LIBRARIES ${ZLIB_DEBUG_LIBRARY}) - ENDIF(ZLIB_DEBUG_LIBRARY) -ELSE (ZLIB_INCLUDE_DIR AND ZLIB_LIBRARY) - SET(ZLIB_FOUND FALSE) - SET( ZLIB_LIBRARIES ) -ENDIF (ZLIB_INCLUDE_DIR AND ZLIB_LIBRARY) -IF (ZLIB_FOUND) - IF (NOT ZLIB_FIND_QUIETLY) - MESSAGE(STATUS "Found ZLIB: ${ZLIB_LIBRARY}") - ENDIF (NOT ZLIB_FIND_QUIETLY) -ELSE (ZLIB_FOUND) - IF (ZLIB_FIND_REQUIRED) - MESSAGE(STATUS "Looked for Z libraries named ${ZLIBS_NAMES}.") - MESSAGE(FATAL_ERROR "Could NOT find z library") - ENDIF (ZLIB_FIND_REQUIRED) -ENDIF (ZLIB_FOUND) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(ZLIB DEFAULT_MSG + ZLIB_INCLUDE_DIR ZLIB_LIBRARIES) MARK_AS_ADVANCED( - ZLIB_LIBRARY - ZLIB_DEBUG_LIBRARY + ZLIB_LIBRARIES ZLIB_INCLUDE_DIR ) Modified: hugin/trunk/CMakeModules/win_bundle.cmake =================================================================== --- hugin/trunk/CMakeModules/win_bundle.cmake 2007-12-30 22:21:49 UTC (rev 2583) +++ hugin/trunk/CMakeModules/win_bundle.cmake 2007-12-31 19:14:31 UTC (rev 2584) @@ -7,6 +7,10 @@ CONFIGURE_FILE(platforms/windows/msi/top_banner.bmp ${CMAKE_CURRENT_BINARY_DIR}/INSTALL/top_banner.bmp COPYONLY) CONFIGURE_FILE(platforms/windows/msi/big_banner.bmp ${CMAKE_CURRENT_BINARY_DIR}/INSTALL/big_banner.bmp COPYONLY) + # install hugin readme, license etc. + INSTALL(FILES AUTHORS COPYING LICENCE LICENCE_JHEAD LICENCE_VIGRA + DESTINATION doc/hugin) + # find the path to enblend and panotools build directories # and copy required binaries into hugin installation folder FIND_PATH(PANO13_EXE_DIR PTmender.exe @@ -18,6 +22,19 @@ INSTALL(FILES ${PANO13_EXECUTABLES} DESTINATION ${BINDIR}) # TODO: install documentation for panotools? + FIND_PATH(PANO13_SRC_DIR filter.h + ${SOURCE_BASE_DIR}/libpano/pano13 + DOC "Location of pano13 source" + NO_DEFAULT_PATH) + INSTALL(FILES ${PANO13_SRC_DIR}/AUTHORS + ${PANO13_SRC_DIR}/gpl.txt + ${PANO13_SRC_DIR}/README + ${PANO13_SRC_DIR}/TODO + ${PANO13_SRC_DIR}/doc/Optimize.txt + ${PANO13_SRC_DIR}/doc/PTblender.readme + ${PANO13_SRC_DIR}/doc/PTmender.readme + ${PANO13_SRC_DIR}/doc/stitch.txt + DESTINATION doc/panotools) FIND_PATH(ENBLEND_EXE_DIR enblend.exe ${SOURCE_BASE_DIR}/enblend-3.1 Modified: hugin/trunk/platforms/windows/msi/WixFragmentRegistry.wxs =================================================================== --- hugin/trunk/platforms/windows/msi/WixFragmentRegistry.wxs 2007-12-30 22:21:49 UTC (rev 2583) +++ hugin/trunk/platforms/windows/msi/WixFragmentRegistry.wxs 2007-12-31 19:14:31 UTC (rev 2584) @@ -12,6 +12,11 @@ <ComponentRef Id="HuginAssociationComponent" /> </Feature> </FeatureRef> + <FeatureRef Id="HUGINSTITCHFEATURE" > + <Feature Id="HuginStitchAssociationFeature" Title="Association" Description="Associate .pto files with hugin stitch project" Level="1"> + <ComponentRef Id="HuginStitchAssociationComponent" /> + </Feature> + </FeatureRef> <Property Id="AUTOPANOSIFT"> <DirectorySearch Id="AutopanoSiftDirectory" Depth="1" Path="[ProgramFilesFolder]"> @@ -27,17 +32,26 @@ </Extension> </Component> + <Component Id="HuginStitchAssociationComponent" Guid="498B874E-837C-11DC-A44F-2A8755D89593" DiskId="1"> + <Extension Id="pto"> + <Verb Id="Stitch" Command="Open" TargetFile="HUGINSTITCHEXECUTABLE" Argument='"%1"' /> + </Extension> + </Component> + <Component Id="HuginRegistryComponent" Guid="FF46C478-8316-11DC-9F04-5B8056D89593" DiskId="1"> <Shortcut Id="HomePage" Name="hugin website" Target="[System64Folder]rundll32.exe" Arguments="url.dll,FileProtocolHandler http://hugin.sourceforge.net" Directory="ProgramMenuDir" Description="hugin website on the Internet" /> <Shortcut Id="UninstallProduct" Name="Uninstall hugin" Target="[System64Folder]msiexec.exe" Arguments="/x [ProductCode]" Directory="ProgramMenuDir" Description="Uninstalls hugin" /> + <!-- <RegistryKey Root="HKLM" Key="Software"> <RegistryKey Key="hugin" Action="create"> <RegistryValue Name="Install_Dir" Value="[APPLICATIONFOLDER]" Type="string" /> </RegistryKey> - </RegistryKey> + </RegistryKey> + --> + <!-- TODO: rework this section to respect the preferences of an earlier version <RegistryKey Root="HKCU" Key="Software"> <RegistryKey Key="hugin" Action="create" > @@ -60,7 +74,8 @@ </RegistryKey> </RegistryKey> - </RegistryKey> + </RegistryKey> + --> </Component> Modified: hugin/trunk/src/CMakeLists.txt =================================================================== --- hugin/trunk/src/CMakeLists.txt 2007-12-30 22:21:49 UTC (rev 2583) +++ hugin/trunk/src/CMakeLists.txt 2007-12-31 19:14:31 UTC (rev 2584) @@ -18,9 +18,8 @@ ENDIF (MSVC) set(image_libs huginvigraimpex ${OPENEXR_LIBRARIES} ${JPEG_LIBRARIES} ${TIFF_LIBRARIES} - ${PNG_LIBRARIES}) + ${PNG_LIBRARIES} ${ZLIB_LIBRARIES}) - add_subdirectory(foreign) add_subdirectory(hugin_base) add_subdirectory(tools) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |