diff --git a/CMakeLists.txt b/CMakeLists.txt index 54f4cfee..167114a7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,9 +27,9 @@ endif() ## -PROJECT( exiv2 ) -CMAKE_MINIMUM_REQUIRED( VERSION 2.6 ) SET(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required +CMAKE_MINIMUM_REQUIRED( VERSION 2.6 ) +PROJECT( exiv2 ) SET( PACKAGE_COPYRIGHT "Andreas Huggel" ) SET( PACKAGE_BUGREPORT "ahuggel@gmx.net" ) diff --git a/config/configure.ac b/config/configure.ac index e055afa9..ef4ee3c7 100644 --- a/config/configure.ac +++ b/config/configure.ac @@ -207,10 +207,10 @@ AC_SUBST(EXV_LIB_STATIC) # # This must happen after all other configure checks, because # the "-no-undefined" flag is only for libtool and must not be -# passed to GCC by accident. +# passed to GCC by accident. Add link psapi (for version.cpp) case "$host_os" in *mingw* | *cygwin*) - LDFLAGS="$LDFLAGS -no-undefined" + LDFLAGS="$LDFLAGS -no-undefined -lpsapi" ;; esac diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a4bdbfa6..0ac55174 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -235,6 +235,11 @@ IF( ICONV_FOUND ) TARGET_LINK_LIBRARIES( exiv2lib ${ICONV_LIBRARIES} ) ENDIF( ICONV_FOUND ) +IF (CYGWIN) + TARGET_LINK_LIBRARIES( exiv2lib psapi ) +ENDIF(CYGWIN) + + ## # copy header files (TODO: rewrite for NMake) IF (MSVC ) diff --git a/src/version.cpp b/src/version.cpp index 04fcbd00..5dc4b7d4 100644 --- a/src/version.cpp +++ b/src/version.cpp @@ -37,6 +37,10 @@ EXIV2_RCSID("@(#) $Id$") # include "exv_conf.h" #endif +#if defined(__CYGWIN__) +#include +#endif + #include "version.hpp" // + standard includes @@ -141,7 +145,7 @@ EXIV2API void dumpLibraryInfo(std::ostream& os) path[0]=0; // enumerate loaded libraries and determine path to executable -#if defined(WIN32) +#if defined(WIN32) || defined(__CYGWIN__) bReport = true; HMODULE handles[100]; DWORD cbNeeded; @@ -189,8 +193,6 @@ EXIV2API void dumpLibraryInfo(std::ostream& os) char proc[100]; sprintf(proc,"/proc/%d/exe", getpid()); path_l = readlink (proc, path, path_max); -#elif defined(__CYGWIN__) - bReport=true; #endif if ( bReport ) {