CMake/Cygwin fix. autotools generated src/exv_conf.h being used by cmake (instead of his own).

- Added file detector and error message to CMakeLists.txt
- Added code to src/Makefile to delete src/exv_conf with $ make clean
v0.27.3
Robin Mills 13 years ago
parent b77c25f3d4
commit 14aa8806d8

@ -8,9 +8,23 @@
SET(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required SET(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required
PROJECT( exiv2 ) PROJECT( exiv2 )
CMAKE_MINIMUM_REQUIRED( VERSION 2.6 ) CMAKE_MINIMUM_REQUIRED( VERSION 2.6 )
##
# Running cmake in a tree in which we have run ./configure ; make
# creates src/exv_conf.h which conflicts with cmake's own exv_conf.h
# This causes incorrect compilation and linking errors.
#
# Halt processing and ask the user to fix this.
# Remedy $ cd src; make clean -or- $ rm -rf src/exv_conf.h
macro(trouble M)
message(FATAL_ERROR ${M})
endmacro(trouble)
if( EXISTS ${CMAKE_SOURCE_DIR}/src/exv_conf.h )
trouble("${CMAKE_SOURCE_DIR}/src/exv_conf.h exists. Please remove file and re-run cmake!")
endif()
##
SET( PACKAGE_COPYRIGHT "Andreas Huggel" ) SET( PACKAGE_COPYRIGHT "Andreas Huggel" )
SET( PACKAGE_BUGREPORT "ahuggel@gmx.net" ) SET( PACKAGE_BUGREPORT "ahuggel@gmx.net" )
SET( PACKAGE "exiv2" ) SET( PACKAGE "exiv2" )
@ -45,6 +59,7 @@ IF( MINGW OR UNIX )
) )
ENDIF( MINGW OR UNIX ) ENDIF( MINGW OR UNIX )
if( MSVC ) if( MSVC )
include(CMake_msvc.txt) include(CMake_msvc.txt)
msvc_runtime_report() msvc_runtime_report()

@ -95,15 +95,15 @@ CCSRC = asfvideo.cpp \
panasonicmn.cpp \ panasonicmn.cpp \
pgfimage.cpp pgfimage.cpp
ifdef HAVE_LIBZ ifdef HAVE_LIBZ
CCSRC += pngimage.cpp \ CCSRC += pngimage.cpp \
pngchunk.cpp pngchunk.cpp
endif endif
CCSRC += preview.cpp \ CCSRC += preview.cpp \
properties.cpp \ properties.cpp \
psdimage.cpp \ psdimage.cpp \
quicktimevideo.cpp \ quicktimevideo.cpp \
rafimage.cpp \ rafimage.cpp \
riffvideo.cpp \ riffvideo.cpp \
rw2image.cpp \ rw2image.cpp \
samsungmn.cpp \ samsungmn.cpp \
sigmamn.cpp \ sigmamn.cpp \
@ -315,6 +315,7 @@ mostlyclean:
$(RM) $(CCSRC:.cpp=.ii) $(RM) $(CCSRC:.cpp=.ii)
$(RM) lib $(RM) lib
$(RM) path-test.o $(RM) path-test.o
$(RM) exv_conf.h
$(RM) $(CCSRC:%.cpp=.libs/%.d) $(CSRC:%.c=.libs/%.d) $(RM) $(CCSRC:%.cpp=.libs/%.d) $(CSRC:%.c=.libs/%.d)
@$(LIBTOOL) --mode=clean $(RM) $(LOBJ) $(sort $(BINOBJ) $(EXIV2OBJ) $(EXIV2COBJ) $(MCOBJ)) @$(LIBTOOL) --mode=clean $(RM) $(LOBJ) $(sort $(BINOBJ) $(EXIV2OBJ) $(EXIV2COBJ) $(MCOBJ))
@ -326,7 +327,7 @@ clean: mostlyclean
# Run `make distclean' from the top source directory to also remove # Run `make distclean' from the top source directory to also remove
# files created by configuring the program. # files created by configuring the program.
distclean: clean distclean: clean
$(RM) exv_conf.h doxygen.hpp $(RM) doxygen.hpp
ifdef DEP_TRACKING ifdef DEP_TRACKING
$(RM) $(DEP) $(RM) $(DEP)
-rmdir $(DEPDIR) -rmdir $(DEPDIR)
@ -339,3 +340,6 @@ endif
maintainer-clean: uninstall distclean maintainer-clean: uninstall distclean
-$(RM) -r .deps -$(RM) -r .deps
-$(RM) -r .libs -$(RM) -r .libs
# That's all Folks!
##

Loading…
Cancel
Save