summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorTor Didriksen <tor.didriksen@oracle.com>2010-11-23 10:26:26 +0100
committerTor Didriksen <tor.didriksen@oracle.com>2010-11-23 10:26:26 +0100
commita8d7a0005fff65362cf25c232057621c457790f2 (patch)
tree2be00fa970d0d5886fb1626881b2b987316390cc /cmake
parente569efd1e1da2b7e29609c5e6791a7e6d6ebdfb9 (diff)
downloadmariadb-git-a8d7a0005fff65362cf25c232057621c457790f2.tar.gz
Bug #58372 cmake should not write temporary files in the source directory
cmake/do_abi_check.cmake: Put temporary files in ${BINARY_DIR} rather than in source directory. Slight reformatting for readability of commands.
Diffstat (limited to 'cmake')
-rw-r--r--cmake/do_abi_check.cmake30
1 files changed, 17 insertions, 13 deletions
diff --git a/cmake/do_abi_check.cmake b/cmake/do_abi_check.cmake
index 78006bd018c..96943e1a4c4 100644
--- a/cmake/do_abi_check.cmake
+++ b/cmake/do_abi_check.cmake
@@ -53,23 +53,27 @@
SET(abi_check_out ${BINARY_DIR}/abi_check.out)
FOREACH(file ${ABI_HEADERS})
- SET(tmpfile ${file}.pp.tmp)
- EXECUTE_PROCESS(
- COMMAND ${COMPILER}
- -E -nostdinc -dI -DMYSQL_ABI_CHECK -I${SOURCE_DIR}/include
- -I${BINARY_DIR}/include -I${SOURCE_DIR}/include/mysql -I${SOURCE_DIR}/sql
- ${file}
- ERROR_QUIET OUTPUT_FILE ${tmpfile})
- EXECUTE_PROCESS(
- COMMAND sed -e
- "/^# /d" -e "/^[ ]*$/d" -e "/^#pragma GCC set_debug_pwd/d" -e "/^#ident/d"
- RESULT_VARIABLE result OUTPUT_FILE ${abi_check_out} INPUT_FILE ${tmpfile})
+ GET_FILENAME_COMPONENT(header_basename ${file} NAME)
+ SET(tmpfile ${BINARY_DIR}/${header_basename}.pp.tmp)
+
+ EXECUTE_PROCESS(
+ COMMAND ${COMPILER}
+ -E -nostdinc -dI -DMYSQL_ABI_CHECK -I${SOURCE_DIR}/include
+ -I${BINARY_DIR}/include -I${SOURCE_DIR}/include/mysql -I${SOURCE_DIR}/sql
+ ${file}
+ ERROR_QUIET OUTPUT_FILE ${tmpfile})
+ EXECUTE_PROCESS(
+ COMMAND sed -e "/^# /d"
+ -e "/^[ ]*$/d"
+ -e "/^#pragma GCC set_debug_pwd/d"
+ -e "/^#ident/d"
+ RESULT_VARIABLE result OUTPUT_FILE ${abi_check_out} INPUT_FILE ${tmpfile})
IF(NOT ${result} EQUAL 0)
MESSAGE(FATAL_ERROR "sed returned error ${result}")
ENDIF()
FILE(REMOVE ${tmpfile})
- EXECUTE_PROCESS(COMMAND diff -w ${file}.pp ${abi_check_out} RESULT_VARIABLE
- result)
+ EXECUTE_PROCESS(
+ COMMAND diff -w ${file}.pp ${abi_check_out} RESULT_VARIABLE result)
IF(NOT ${result} EQUAL 0)
MESSAGE(FATAL_ERROR
"ABI check found difference between ${file}.pp and ${abi_check_out}")