Commit eb101253 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

Fix a problem reported by Alik:

when cmake is used for building in a symlinked directory, 
and confguration is later adjusted with "cmake-gui ." After it,
GenServerSource fails with "no rule for <filename>". The reason
for the error is that cmake-gui  resolves "." as realpath and rules
are generated accordingly, while "cmake" used symlinked path

The fix uses ${CMAKE_CURRENT_BINARY_DIR} instead of 
${CMAKE_BINARY_DIR}/sql  for generated files. 
This causes CMake to use relative file names so 
relative file names when generating make rules.
Using relative filenames avoids the problem of 
refering to the same directory using 2 different paths.

Besides, using ${CMAKE_CURRENT_BINARY_DIR} is 
a commonly used style when working with generated 
files.
parent aca943f0
...@@ -24,10 +24,10 @@ ${CMAKE_BINARY_DIR}/sql ...@@ -24,10 +24,10 @@ ${CMAKE_BINARY_DIR}/sql
) )
SET(GEN_SOURCES SET(GEN_SOURCES
${CMAKE_BINARY_DIR}/sql/sql_yacc.h ${CMAKE_CURRENT_BINARY_DIR}/sql_yacc.h
${CMAKE_BINARY_DIR}/sql/sql_yacc.cc ${CMAKE_CURRENT_BINARY_DIR}/sql_yacc.cc
${CMAKE_BINARY_DIR}/sql/sql_builtin.cc ${CMAKE_CURRENT_BINARY_DIR}/sql_builtin.cc
${CMAKE_BINARY_DIR}/sql/lex_hash.h ${CMAKE_CURRENT_BINARY_DIR}/lex_hash.h
) )
SET_SOURCE_FILES_PROPERTIES(${GEN_SOURCES} PROPERTIES GENERATED 1) SET_SOURCE_FILES_PROPERTIES(${GEN_SOURCES} PROPERTIES GENERATED 1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment