maria-developers team mailing list archive
-
maria-developers team
-
Mailing list archive
-
Message #03545
Re: Patch: Separate builddir from src dir with cmake
Hi, Bo!
On Aug 18, Bo Thorsen wrote:
> OK to push to 5.1?
see questions below
> Should I send this patch to the Oracle as well to minimize the drift
> between the cmake files?
I'd say yes. Why not?
> === modified file 'CMakeLists.txt'
> --- CMakeLists.txt 2010-07-01 13:50:54 +0000
> +++ CMakeLists.txt 2010-07-12 11:03:38 +0000
> @@ -381,12 +381,14 @@
>
> # Add files to the installer
> INSTALL(FILES COPYING EXCEPTIONS-CLIENT DESTINATION .)
> -INSTALL(FILES support-files/my-huge.ini support-files/my-innodb-heavy-4G.ini DESTINATION .)
> +INSTALL(FILES ${CMAKE_BINARY_DIR}/support-files/my-huge.ini support-files/my-innodb-heavy-4G.ini DESTINATION .)
> -INSTALL(FILES support-files/my-large.ini support-files/my-medium.ini DESTINATION .)
> +INSTALL(FILES ${CMAKE_BINARY_DIR}/support-files/my-large.ini support-files/my-medium.ini DESTINATION .)
> -INSTALL(FILES support-files/my-small.ini DESTINATION .)
> +INSTALL(FILES ${CMAKE_BINARY_DIR}/support-files/my-small.ini DESTINATION .)
> INSTALL(FILES Docs/INSTALL-BINARY DESTINATION Docs)
> INSTALL(FILES COPYING DESTINATION Docs)
> -FILE(GLOB headerfiles "${CMAKE_CURRENT_SOURCE_DIR}/include/*.h")
> +FILE(GLOB headerfiles "${CMAKE_SOURCE_DIR}/include/*.h")
1. what does this do ?
2. I'd suggest to add a new variable, instead of reusing headerfiles
> +INSTALL(FILES ${headerfiles} DESTINATION include COMPONENT headers)
> +FILE(GLOB headerfiles "${CMAKE_BINARY_DIR}/include/*.h")
> INSTALL(FILES ${headerfiles} DESTINATION include COMPONENT headers)
> INSTALL(FILES include/mysql/plugin.h DESTINATION include/mysql COMPONENT headers)
> INSTALL(FILES libmysql/libmysql.def DESTINATION include COMPONENT headers)
>
> === modified file 'scripts/CMakeLists.txt'
> --- scripts/CMakeLists.txt 2010-06-28 13:31:47 +0000
> +++ scripts/CMakeLists.txt 2010-07-12 11:46:17 +0000
> @@ -14,13 +14,15 @@
> # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
>
> # Build mysql_fix_privilege_tables.sql
> +SET(SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
you don't seem to use that
> +FILE(TO_NATIVE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/mysql_system_tables.sql" FIX_FILE1)
> +FILE(TO_NATIVE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/mysql_system_tables_fix.sql" FIX_FILE2)
> -ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tables.sql
> +ADD_CUSTOM_COMMAND(OUTPUT mysql_fix_privilege_tables.sql
> - COMMAND copy /b
> - mysql_system_tables.sql + mysql_system_tables_fix.sql
> - mysql_fix_privilege_tables.sql
> + COMMAND copy /b \"${FIX_FILE1}\" + \"${FIX_FILE2}\" mysql_fix_privilege_tables.sql
> DEPENDS
> - ${PROJECT_SOURCE_DIR}/scripts/mysql_system_tables.sql
> - ${PROJECT_SOURCE_DIR}/scripts/mysql_system_tables_fix.sql)
> + ${CMAKE_CURRENT_SOURCE_DIR}/mysql_system_tables.sql
> + ${CMAKE_CURRENT_SOURCE_DIR}/mysql_system_tables_fix.sql)
why is that ?
> === modified file 'sql/CMakeLists.txt'
> --- sql/CMakeLists.txt 2010-06-25 13:09:45 +0000
> +++ sql/CMakeLists.txt 2010-07-12 11:09:05 +0000
...
> -SET_SOURCE_FILES_PROPERTIES(${CMAKE_SOURCE_DIR}/sql/sql_yacc.h
> - ${CMAKE_SOURCE_DIR}/sql/sql_yacc.cc
> - ${CMAKE_SOURCE_DIR}/sql/lex_hash.h
> - ${CMAKE_SOURCE_DIR}/include/mysql_version.h
> - ${CMAKE_SOURCE_DIR}/sql/sql_builtin.cc
> - ${PROJECT_SOURCE_DIR}/include/mysqld_error.h
> - ${PROJECT_SOURCE_DIR}/include/mysqld_ername.h
> - ${PROJECT_SOURCE_DIR}/include/sql_state.h
> +SET_SOURCE_FILES_PROPERTIES(${CMAKE_BINARY_DIR}/include/mysql_version.h
> + ${CMAKE_CURRENT_BINARY_DIR}/sql_builtin.cc
> + ${CMAKE_BINARY_DIR}/include/mysqld_error.h
> + ${CMAKE_BINARY_DIR}/include/mysqld_ername.h
> + ${CMAKE_BINARY_DIR}/include/sql_state.h
you've removed sql_yacc.h, sql_yacc.cc, and lex_hash.h from this
command. Why ? Aren't they generated ?
I see that below you generate them in the source dir. Why ?
> PROPERTIES GENERATED 1)
>
Regards,
Sergei
References