summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2018-01-18 12:26:59 +0100
committerMilan Crha <mcrha@redhat.com>2018-01-18 12:26:59 +0100
commit6b51d2f605f16eeeebb031d38b3078ad700ad58d (patch)
tree1f7d642bb80dec1bfa59596aa9889764f54521dc
parent6e302394c6f1b753c47e391c0d008426e8a1c850 (diff)
downloadevolution-data-server-6b51d2f605f16eeeebb031d38b3078ad700ad58d.tar.gz
Bug 792302 - CMake build fails to include iconv-detect.h
-rw-r--r--CMakeLists.txt5
-rw-r--r--iconv-detect.c2
2 files changed, 5 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bcb01e4d6..be416bc84 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -521,7 +521,10 @@ if(NOT HAVE_ICONV)
endif(NOT HAVE_ICONV)
set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBS})
-CHECK_C_SOURCE_RUNS("#include \"${CMAKE_SOURCE_DIR}/iconv-detect.c\"" _correct_iconv)
+file(TO_NATIVE_PATH "${CMAKE_BINARY_DIR}/" _binary_dir_with_separator)
+CHECK_C_SOURCE_RUNS("#define ICONV_DETECT_BUILD_DIR \"${_binary_dir_with_separator}\"
+ #include \"${CMAKE_SOURCE_DIR}/iconv-detect.c\"" _correct_iconv)
+unset(_binary_dir_with_separator)
unset(CMAKE_REQUIRED_LIBRARIES)
if(NOT _correct_iconv)
diff --git a/iconv-detect.c b/iconv-detect.c
index bc7d872a1..e44ad94e3 100644
--- a/iconv-detect.c
+++ b/iconv-detect.c
@@ -128,7 +128,7 @@ main (int argc,
if (!test_iconv ())
return 1;
- fp = fopen ("iconv-detect.h", "w");
+ fp = fopen (ICONV_DETECT_BUILD_DIR "iconv-detect.h", "w");
if (fp == NULL)
return 255;