From df899bfbc3d0dddcfa73c9b76d4c2134e7adf1cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20D=C3=ADaz=20M=C3=A1s?= Date: Thu, 10 Aug 2017 19:37:35 +0200 Subject: [PATCH] exv_conf.h is now generated in the CMAKE_BINARY_DIR to not mess up the source tree. --- CMakeLists.txt | 13 ++----------- config/generateConfigFile.cmake | 3 +-- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6e536665..35df1054 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,17 +6,6 @@ # Redistribution and use is allowed according to the terms of the BSD license. # For details see the accompanying COPYING-CMAKE-SCRIPTS file. -## -# Running cmake in a tree in which we have run ./configure ; make -# creates include/exiv2/exv_conf.h which conflicts with cmake's own exv_conf.h -# This causes incorrect compilation and linking errors. -# -# It's OK to delete this as it will be recreated on demand by /Makefile -if( EXISTS "${CMAKE_SOURCE_DIR}/include/exiv2/exv_conf.h" ) - file(REMOVE "${CMAKE_SOURCE_DIR}/include/exiv2/exv_conf.h") -endif() -## - CMAKE_MINIMUM_REQUIRED( VERSION 3.1.0 ) PROJECT( exiv2 ) @@ -118,6 +107,8 @@ IF( EXIV2_ENABLE_XMP ) ENDIF( EXIV2_ENABLE_XMP ) include( config/generateConfigFile.cmake ) +include_directories(${CMAKE_BINARY_DIR}) # Make the exv_conf.h file visible for the full project + include( config/CMakeChecks.txt ) SET( INSTALL_TARGET_STANDARD_ARGS diff --git a/config/generateConfigFile.cmake b/config/generateConfigFile.cmake index 56fe5881..c4eb787f 100644 --- a/config/generateConfigFile.cmake +++ b/config/generateConfigFile.cmake @@ -64,5 +64,4 @@ return 0; ##################################################################################### -configure_file( config/config.h.cmake ${CMAKE_SOURCE_DIR}/include/exiv2/exv_conf.h @ONLY) -#configure_file( config/config.h.cmake ${CMAKE_SOURCE_DIR}/include/exiv2/exv_conf.h) +configure_file( config/config.h.cmake ${CMAKE_BINARY_DIR}/exv_conf.h @ONLY)