summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrediano Ziglio <fziglio@redhat.com>2019-11-30 09:47:53 +0000
committerFrediano Ziglio <fziglio@redhat.com>2019-12-06 09:42:52 +0000
commit981b5f0dd1c32d4098f973a7119ace35e12bfc67 (patch)
tree0cdfebf3930af17f0e54b222cc15ac1cb84f061d
parentd59123bdeecb84963290771bbc84e78a1154e122 (diff)
build: Do not generate CMake config.h in source directory
Allows to build out-of-tree and have a clean working directory. Autoconf used to work with out-of-tree and "config.h" in the build directory as a "common" directory in the build directory was created, so including "../config.h" in version.rc and having "-I $(top_builddir)/common" used to work. CMake does not create "common" under the build directory so the "../config.h" inclusion fails. Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
-rw-r--r--CMakeLists.txt4
-rw-r--r--Makefile.am4
-rw-r--r--common/version.rc2
3 files changed, 5 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7debd27..d5504fc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -42,7 +42,7 @@ endif()
config_write("#define RC_PRODUCTVERSION ${RC_PRODUCTVERSION}\n")
config_write("#define RC_PRODUCTVERSION_STR \"${RC_PRODUCTVERSION}\"\n")
-configure_file(${CMAKE_BINARY_DIR}/config.h.in ${CMAKE_SOURCE_DIR}/config.h)
+configure_file(${CMAKE_BINARY_DIR}/config.h.in ${CMAKE_BINARY_DIR}/config.h)
if(MSVC)
@@ -76,7 +76,7 @@ else(MSVC)
set(COMMSUPPW_LIBRARY)
endif(MSVC)
-include_directories(common . spice-protocol ${PNG_INCLUDE_DIR})
+include_directories(common ${CMAKE_BINARY_DIR} spice-protocol ${PNG_INCLUDE_DIR})
add_definitions(-DUNICODE -D_UNICODE -DOLDMSVCRT -DWINVER=0x0601)
add_executable(vdagent WIN32
diff --git a/Makefile.am b/Makefile.am
index 24d2446..b87c072 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -51,7 +51,7 @@ vdagent_SOURCES = \
$(NULL)
vdagent_rc.$(OBJEXT): vdagent/vdagent.rc
- $(AM_V_GEN)$(WINDRES) -I $(top_builddir)/common -i $< -o $@
+ $(AM_V_GEN)$(WINDRES) -I $(top_builddir) -i $< -o $@
MAINTAINERCLEANFILES += vdagent_rc.$(OBJEXT)
@@ -66,7 +66,7 @@ vdservice_SOURCES = \
$(NULL)
vdservice_rc.$(OBJEXT): vdservice/vdservice.rc
- $(AM_V_GEN)$(WINDRES) -I $(top_builddir)/common -i $< -o $@
+ $(AM_V_GEN)$(WINDRES) -I $(top_builddir) -i $< -o $@
MAINTAINERCLEANFILES += vdservice_rc.$(OBJEXT)
diff --git a/common/version.rc b/common/version.rc
index 2603dce..9981157 100644
--- a/common/version.rc
+++ b/common/version.rc
@@ -1,7 +1,7 @@
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
-#include "../config.h"
+#include "config.h"
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32