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
PROJECT( exiv2 )
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_BUGREPORT "ahuggel@gmx.net" )
SET( PACKAGE "exiv2" )
@ -45,6 +59,7 @@ IF( MINGW OR UNIX )
)
ENDIF( MINGW OR UNIX )
if( MSVC )
include(CMake_msvc.txt)
msvc_runtime_report()

@ -315,6 +315,7 @@ mostlyclean:
$(RM) $(CCSRC:.cpp=.ii)
$(RM) lib
$(RM) path-test.o
$(RM) exv_conf.h
$(RM) $(CCSRC:%.cpp=.libs/%.d) $(CSRC:%.c=.libs/%.d)
@$(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
# files created by configuring the program.
distclean: clean
$(RM) exv_conf.h doxygen.hpp
$(RM) doxygen.hpp
ifdef DEP_TRACKING
$(RM) $(DEP)
-rmdir $(DEPDIR)
@ -339,3 +340,6 @@ endif
maintainer-clean: uninstall distclean
-$(RM) -r .deps
-$(RM) -r .libs
# That's all Folks!
##

Loading…
Cancel
Save