Skip to content

Commit

Permalink
WL#5161 : Cross-platform build with CMake
Browse files Browse the repository at this point in the history
--BZR--
revision-id: [email protected]
property-branch-nick: mysql-next-mr
property-file-info: ld7:file_id44:buildcmake-20091108233336-m9ewbh1c209yaw0h-17:message66:WL#5161 : Documentation on how to build with CMake on Unix/Windows4:path11:BUILD-CMAKEed7:file_id64:sp1f-makefile.am-20020102192940-dza66ux2yxyklupzjz4q3km3hvye5rnj7:message12:Add new file4:path17:BUILD/Makefile.amed7:file_id63:sp1f-autorun.sh-20050518112313-ieijgm4pelky4zldb7pwqwmsxgzyvrhz7:message125:WL#5161 : use choose_configure instead of autotools configure script
property-file-info: (choose configure will call cmake if cmake is available)4:path16:BUILD/autorun.shed7:file_id53:choose_configure.sh-20091108233336-m9ewbh1c209yaw0h-57:message125:WL#5161 : use choose_configure instead of autotools configure script
property-file-info: (choose configure will call cmake if cmake is available)4:path25:BUILD/choose_configure.shed7:file_id67:sp1f-cmakelists.txt-20060831175236-433hkm7nrqfjbwios4ancgytabw354nr7:message194:WL#5161 : Rewrite top-level CMakeLists.txt. 
property-file-info: Remove  Windows specifics
property-file-info: - compiler flags handling moved to configure.cmake
property-file-info: - storage engine/plugin stuff moved into cmake/plugin.cmake
property-file-info: - copy docs
property-file-info: 4:path14:CMakeLists.txted7:file_id64:sp1f-makefile.am-19700101030959-jbbpiygwpgybyqknlavdxxupbrjonu7h7:message15:Added new files4:path11:Makefile.amed7:file_id67:sp1f-cmakelists.txt-20060831175236-tdyayhfqw2zme3vhwbn6l2lno4em3u3t7:message98:WL#5161 : Rewrite CMakeLists.txt to be platform-independent
property-file-info: Handle packagng (add INSTALL commands)4:path21:client/CMakeLists.txted7:file_id45:makefile.am-20091108233336-m9ewbh1c209yaw0h-67:message125:WL#5161 : use choose_configure instead of autotools configure script
property-file-info: (choose configure will call cmake if cmake is available)4:path17:cmake/Makefile.amed7:file_id49:abi_check.cmake-20091108233336-m9ewbh1c209yaw0h-77:message40:Custom targets for abi_check (for cmake)4:path21:cmake/abi_check.cmakeed7:file_id45:bison.cmake-20091108233336-m9ewbh1c209yaw0h-87:message92:- Check bison availability
property-file-info: - Add RUN_BISON macro (used to create sql_yacc.cc and sql_yacc.h)4:path17:cmake/bison.cmakeed7:file_id43:cat.cmake-20091108233336-m9ewbh1c209yaw0h-97:message39:Add helper script to concatenate files.4:path15:cmake/cat.cmakeed7:file_id55:character_sets.cmake-20091108233336-m9ewbh1c209yaw0h-107:message51:Handle configuration parameters WITH_EXTRA_CHARSETS4:path26:cmake/character_sets.cmakeed7:file_id55:check_minimal_versio-20091108233336-m9ewbh1c209yaw0h-117:message60:Helper script to check the minimum required version of cmake4:path33:cmake/check_minimal_version.cmakeed7:file_id47:configure.pl-20091108233336-m9ewbh1c209yaw0h-127:message59:Add perl script to convert ./configure parameters for cmake4:path18:cmake/configure.pled7:file_id55:create_initial_db.cm-20091108233336-m9ewbh1c209yaw0h-147:message112:Add script helper to create initial database. 
property-file-info: (on Windows, we pack initial db with the redistribution
property-file-info: package)
property-file-info: 4:path32:cmake/create_initial_db.cmake.ined7:file_id53:do_abi_check.cmake-20091108233336-m9ewbh1c209yaw0h-157:message17:Perform abi check4:path24:cmake/do_abi_check.cmakeed7:file_id47:dtrace.cmake-20091108233336-m9ewbh1c209yaw0h-167:message103:Handle dtrace in CMake Build.
property-file-info: Check for dtrace availablility,
property-file-info: run dtrace -G on solaris in prelink step
property-file-info: 4:path18:cmake/dtrace.cmakeed7:file_id55:dtrace_prelink.cmake-20091108233336-m9ewbh1c209yaw0h-177:message105:Run dtrace -G on Solaris in pre-link step,
property-file-info: link the object it creates together with library or
property-file-info: executable4:path26:cmake/dtrace_prelink.cmakeed7:file_id55:install_macros.cmake-20091108233336-m9ewbh1c209yaw0h-187:message78:Helper macros for packaging
property-file-info: (install pdb on Windows, install symlinks on Unix)4:path26:cmake/install_macros.cmakeed7:file_id53:make_dist.cmake.in-20091108233336-m9ewbh1c209yaw0h-197:message112:"make dist" - 
property-file-info: - pack autotools ./configure script with the source
property-file-info: (renamed to configure.am)
property-file-info: - pack bison output4:path24:cmake/make_dist.cmake.ined7:file_id55:merge_archives_unix.-20091108233336-m9ewbh1c209yaw0h-207:message40:script to merge static libraries on Unix4:path34:cmake/merge_archives_unix.cmake.ined7:file_id45:misc.cmake-20091108233336-m9ewbh1c209yaw0h-217:message337:Build helper macros
property-file-info: - MERGE_STATIC_LIBS 
property-file-info: We use it when building client library and embedded
property-file-info: (avoid recompilation)
property-file-info: 
property-file-info: - Convert source file paths to absolute names.
property-file-info: We use it in  to locate files of a different project,
property-file-info: when the files need to be recompiled (e.g in embedded
property-file-info: several storage engines are recompiled with 
property-file-info: -DEMBEDDED_LIBRARY)
property-file-info: 
property-file-info: 4:path16:cmake/misc.cmakeed7:file_id54:mysql_version.cmake-20091108233336-m9ewbh1c209yaw0h-227:message60:Extract version info from configure.in
property-file-info: Handle package names.4:path25:cmake/mysql_version.cmakeed7:file_id47:plugin.cmake-20091108233336-m9ewbh1c209yaw0h-237:message113:Rewrote storage/mysql_storage_engine.cmake to handle 
property-file-info: other types of plugins and do it in OS-independent manner.
property-file-info: 4:path18:cmake/plugin.cmakeed7:file_id49:readline.cmake-20091108233336-m9ewbh1c209yaw0h-247:message55:Macros to handle WITH_READLINE/WITH_LIBEDIT parameters
property-file-info: 4:path20:cmake/readline.cmakeed7:file_id44:ssl.cmake-20091108233336-m9ewbh1c209yaw0h-257:message40:Add macros to handle WITH_SSL parameter.4:path15:cmake/ssl.cmakeed7:file_id52:stack_direction.c-20091108233336-m9ewbh1c209yaw0h-267:message32:Helper to check stack direction.4:path23:cmake/stack_direction.ced7:file_id45:zlib.cmake-20091108233336-m9ewbh1c209yaw0h-277:message40:Add macros to handle WITH_ZLIB parameter4:path16:cmake/zlib.cmakeed7:file_id49:cmakelists.txt-20091108233336-m9ewbh1c209yaw0h-347:message25:Build libedit with cmake.4:path37:cmd-line-utils/libedit/CMakeLists.txted7:file_id64:sp1f-makefile.am-20030118162814-qgzt264ki5avaszfmezvvzuwbb6mymto7:message12:Add new file4:path34:cmd-line-utils/libedit/Makefile.amed7:file_id49:cmakelists.txt-20091108233336-m9ewbh1c209yaw0h-357:message26:Build readline with CMake.4:path38:cmd-line-utils/readline/CMakeLists.txted7:file_id64:sp1f-makefile.am-19700101030959-og5ztj2mtew2ehpnqudt5gbyws5wvmfu7:message12:Add new file4:path35:cmd-line-utils/readline/Makefile.amed7:file_id48:config.h.cmake-20091108233336-m9ewbh1c209yaw0h-37:message41:WL#5161 : Add config.h template for cmake4:path14:config.h.cmakeed7:file_id49:configure.cmake-20091108233336-m9ewbh1c209yaw0h-47:message41:WL#5161 : Add platform tests ( for cmake)4:path15:configure.cmakeed7:file_id65:sp1f-configure.in-19700101030959-mgdpoxtnh2ewmvusvfpkreuhwvffkcjw7:message24:Added new subdirectories4:path12:configure.ined7:file_id67:sp1f-cmakelists.txt-20060831175236-d5bv3fgibf4p4ql4ntcr4ypt63z5zfi67:message7:WL#51614:path19:dbug/CMakeLists.txted7:file_id67:sp1f-cmakelists.txt-20060831175236-uva2lw4uramzkyx4a5w66os4jz5cv7g57:message7:WL#51614:path20:extra/CMakeLists.txted7:file_id67:sp1f-cmakelists.txt-20060831175237-xjxcqitzywtqhrevp5syq2kjpjabnvhl7:message7:WL#51614:path26:extra/yassl/CMakeLists.txted7:file_id67:sp1f-cmakelists.txt-20060831175237-ewydqdjmnnisumb2tchnxjj6yzqrzyga7:message7:WL#51614:path35:extra/yassl/taocrypt/CMakeLists.txted7:file_id64:sp1f-makefile.am-19700101030959-42ptynoryou25hajenjryzqyuvicbucw7:message12:Add new file4:path19:include/Makefile.amed7:file_id63:sp1f-keycache.h-20031120200620-epdbaok2tbq7pk52iejznbrk32ulro777:message57:remove configure-win.h and remove HUGE_PTR defined there.4:path18:include/keycache.hed7:file_id64:sp1f-my_global.h-20010915021246-4vawdgfw4vg3tuxq6mejt7lrchcnceha7:message53:use my_config.h for Windows, not config-win.h anymore4:path19:include/my_global.hed7:file_id65:sp1f-my_pthread.h-19700101030959-z4yp3kljwx5fgmhlyvumtwxuw73xgrjn7:message166:- Move thread_safe_increment from config-win.h to other headers
property-file-info: (config-win.h is not used anymore)
property-file-info: - Declare pthread_cancel on Windows (it is used in daemon_example)
property-file-info: 4:path20:include/my_pthread.hed7:file_id61:sp1f-my_sys.h-19700101030959-lyllvna5vzqfcjnmlcrutgqocylhtb547:message136:Add malloc.h on Windows (we use -D_WIN32_LEAN_AND_MEAN now, and 
property-file-info: with this define malloc.h is not included automatically via windows.h)
property-file-info: 4:path16:include/my_sys.hed7:file_id61:sp1f-plugin.h-20051105112032-xacmvx22ghtcgtqhu6v56b4bneqtx7l57:message46:Handle pure-C plugins with Microsoft compiler.4:path22:include/mysql/plugin.hed7:file_id64:sp1f-thr_alarm.h-19700101030959-5xf2x5lk6zzkymh6eg5zkd6n73vwp5u37:message168:remove rf_SetTimer that used to be defined in config-win.h
property-file-info: Replace with UINT_PTR (we do not use config-win.h anymore
property-file-info: and typedef was needed in this single place only)
property-file-info: 
property-file-info: 4:path19:include/thr_alarm.hed7:file_id67:sp1f-cmakelists.txt-20060831175237-3bbprkzqdl3gopcnlt3evmaikau67bcq7:message144:Avoid pointless recompilation of source files 
property-file-info: in client library if possible. Merge static 
property-file-info: libs (dbug, mysys) to create static client 
property-file-info: library.4:path23:libmysql/CMakeLists.txted7:file_id67:sp1f-cmakelists.txt-20060403082523-x3vxka3k56u2wpzwcrlpykznlz2akpxd7:message147:Avoid pointless recompilation of source files 
property-file-info: when building embedded. Instead, merge dbug and 
property-file-info: mysys (and some other static libs) into embedded.
property-file-info: 
property-file-info: 4:path24:libmysqld/CMakeLists.txted7:file_id67:sp1f-cmakelists.txt-20060403082846-qs2z7khuwbdcejrq62ruchgkp4vewfxd7:message28:Embedded compilation on Unix4:path33:libmysqld/examples/CMakeLists.txted7:file_id63:sp1f-lib_sql.cc-20010411110351-gt5febleap73tqvapkesopvqtuht5sf57:message227:Do not define THD::clear_error() in lib_sql.cc
property-file-info: for embedded. Instead, use the same inline 
property-file-info: definition from sql_class.h as in none-embedded 
property-file-info: case (fixes duplicate symbol errors on Windows
property-file-info: and removes pointless #ifdef EMBEDDED)
property-file-info: 
property-file-info: 4:path20:libmysqld/lib_sql.cced7:file_id49:cmakelists.txt-20091108233336-m9ewbh1c209yaw0h-297:message18:Install man files.4:path18:man/CMakeLists.txted7:file_id64:sp1f-makefile.am-19700101030959-aebuhyyaw7p6br3cp7egpta7aihvrxne7:message13:Add new file.4:path15:man/Makefile.amed7:file_id49:cmakelists.txt-20091108233336-m9ewbh1c209yaw0h-307:message24:Install mysql-test files4:path25:mysql-test/CMakeLists.txted7:file_id64:sp1f-makefile.am-20001206082022-36vvdlhec52v4kcxab5ees7yomxvj4dl7:message13:Add new files4:path22:mysql-test/Makefile.amed7:file_id69:sp1f-configfactory.pm-20071212171904-umibosyolpj2kzgk32rt5p6pl6vztmaq7:message47:Allow testing with mtr in out-of-source builds.4:path34:mysql-test/lib/My/ConfigFactory.pmed7:file_id60:sp1f-find.pm-20071212171904-3nin2m6xbsz6zv3pxhb4wi2zfvqw7o2p7:message208:the build configurations are now also available on Unix
property-file-info: Xcode on Mac uses the Release, RelwithDebinfo and Debug 
property-file-info: subdirectories for executables. Earlier, build configurations 
property-file-info: were available only on Windows.
property-file-info: 4:path25:mysql-test/lib/My/Find.pmed7:file_id67:sp1f-safeprocess.pm-20071212171904-5dvgbxdpklkwzt5ti7tudtpid4iugxmy7:message47:Allow testing with mtr in out-of-source builds.4:path32:mysql-test/lib/My/SafeProcess.pmed7:file_id67:sp1f-cmakelists.txt-20071219115802-ib3pbtm2nik64roqjtf46iyhxwtyypdl7:message27:Port CMakeLists.txt to Unix4:path44:mysql-test/lib/My/SafeProcess/CMakeLists.txted7:file_id69:sp1f-safe_kill_win.cc-20071212171905-p26lghnyebz5xacmoguzikby3mb4dmhf7:message63:add stdlib.h (to be able to compile with -DWIN32_LEAN_AND_MEAN)4:path46:mysql-test/lib/My/SafeProcess/safe_kill_win.cced7:file_id72:sp1f-safe_process_win.cc-20071212171905-5fxmtbbzzyquscvb7nvjxobmzfwasomh7:message181:Add stdlib.h (to be able to compile with -DWIN32_LEAN_AND_MEAN)
property-file-info: define JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE if not defined 
property-file-info: (can happen using MinGW compiler that comes with old SDK)
property-file-info: 
property-file-info: 4:path49:mysql-test/lib/My/SafeProcess/safe_process_win.cced7:file_id50:mtr.outofsource-20091108233336-m9ewbh1c209yaw0h-317:message47:Allow testing with mtr in out-of-source builds.4:path28:mysql-test/mtr.out-of-sourceed7:file_id68:sp1f-mysqltestrun.pl-20041230152716-xjnn5ndv4rr4by6ijmj5a4ysubxc7qh37:message99:Allow testing with mtr in out-of-source builds.
property-file-info: Use common find_plugin macro for Windows and unix.
property-file-info: 4:path28:mysql-test/mysql-test-run.pled7:file_id54:fulltext_plugin.test-20081217120757-fsqqz6xvatgamkzx-17:message41:This test can now run on Windows as well.4:path33:mysql-test/t/fulltext_plugin.tested7:file_id67:sp1f-cmakelists.txt-20060831175237-shgpjtu5x7rmyswxjiriviagwnm5kvpd7:message27:Port CMakeLists.txt to Unix4:path20:mysys/CMakeLists.txted7:file_id64:sp1f-my_create.c-19700101030959-tlvq5kmde7ugiyusb6omv4ihazkudamc7:message51:config-win.h is dead => NO_OPEN_3 is never defined.4:path17:mysys/my_create.ced7:file_id68:sp1f-my_getsystime.c-20040302212107-h5blakn74xewolernjfpc23tn623kllm7:message65:config-win.h is dead => define OFFSET_TO_EPOCH where it is used.
property-file-info: 4:path21:mysys/my_getsystime.ced7:file_id67:sp1f-my_winthread.c-19700101030959-rvu37ehbcbsxvwhztjz3v3hjruvag5in7:message50:Add  win32 pthread_cancel - used by daemon_example4:path20:mysys/my_winthread.ced7:file_id65:sp1f-mysys_priv.h-19700101030959-nsrypet4lo2zuzwvmnrc4mwla2cctlor7:message94:config-win.h is dead => include <sys/stat.h> where it is used
property-file-info: fix prototype of my_win_(f)stat
property-file-info: 4:path18:mysys/mysys_priv.hed7:file_id49:cmakelists.txt-20091108233336-m9ewbh1c209yaw0h-367:message33:Compile daemon_example with CMake4:path36:plugin/daemon_example/CMakeLists.txted7:file_id64:sp1f-makefile.am-20061111012154-qsjmuxl7tumesqnmmnvrlpe523w362jw7:message12:Add new file4:path33:plugin/daemon_example/Makefile.amed7:file_id49:cmakelists.txt-20091108233336-m9ewbh1c209yaw0h-377:message36:Compile full-text example with CMake4:path30:plugin/fulltext/CMakeLists.txted7:file_id64:sp1f-makefile.am-20051228120521-dpalabwkf3gshnf5da4ayskzncyrx2mf7:message13:Add new file.4:path27:plugin/fulltext/Makefile.amed7:file_id48:cmakelists.txt-20091023072134-d0eqs83uimdpj3e6-17:message47:Fix semisync to use common  macro for plugins.
property-file-info: 4:path30:plugin/semisync/CMakeLists.txted7:file_id67:sp1f-cmakelists.txt-20060831175237-6kmn7fqqj7jzzviead26v47chae5xab37:message155:Use absolute filenames, when adding regex library 
property-file-info: (we recompile files in embedded, and want to locate 
property-file-info: sources via GET_TARGET_PROPERTY( ... SOURCES ..))
property-file-info: 
property-file-info: 4:path20:regex/CMakeLists.txted7:file_id61:sp1f-regex2.h-19700101030959-67uigg2fesmxlf3z5wshwaomtlthy6sl7:message63:Remove pointless typedef (produces error with MinGW compiler)
property-file-info: 
property-file-info: 4:path14:regex/regex2.hed7:file_id67:sp1f-cmakelists.txt-20070418112138-acihcbj7ovt6jifuq7fzvs4mdjxtqvsz7:message33:Add configure/install for scripts4:path22:scripts/CMakeLists.txted7:file_id49:cmakelists.txt-20091108233336-m9ewbh1c209yaw0h-327:message23:install sql-bench files4:path24:sql-bench/CMakeLists.txted7:file_id64:sp1f-makefile.am-19700101030959-3gc5367dma4sqfsibuahsx3ln7tctxlt7:message12:Add new file4:path21:sql-bench/Makefile.amed7:file_id67:sp1f-cmakelists.txt-20060831175237-esoeu5kpdtwjvehkghwy6fzbleniq2wy7:message27:Port CmakeLists.txt to Unix4:path18:sql/CMakeLists.txted7:file_id64:sp1f-nt_servc.cc-19700101030959-swh3zcmhgdgkqj3b5b46ljjlc6alrc4l7:message41:compile server with -DWIN32_LEAN_AND_MEAN4:path15:sql/nt_servc.cced7:file_id49:cmakelists.txt-20091108233336-m9ewbh1c209yaw0h-387:message16:Install charsets4:path24:sql/share/CMakeLists.txted7:file_id64:sp1f-makefile.am-19700101030959-maua2sjxeswwnetoodq7c3xj5oe7b4w47:message12:Add new file4:path21:sql/share/Makefile.amed7:file_id70:sp1f-sql_builtin.cc.in-20060413204924-2uqxqmqkyuh3wtmodadlo23ag3lchfp67:message33:Handle pure-C plugins on Windows.4:path21:sql/sql_builtin.cc.ined7:file_id64:sp1f-sql_class.h-19700101030959-jnqnbrjyqsvgncsibnumsmg3lyi7pa5s7:message137:Use the same clear_error macro in embedded and not embedded.
property-file-info: Fixes pointless #ifdef and avoids duplicate symbols when linking
property-file-info: on Windows.4:path15:sql/sql_class.hed7:file_id64:sp1f-makefile.am-20050427083011-jlriqujeui2dc4l2de5cnr5inqi5brlh7:message56:storage/mysql_storage_engine.cmake => cmake/plugin.cmake4:path19:storage/Makefile.amed7:file_id67:sp1f-cmakelists.txt-20060324221904-eeglvbzhfjgzaeenavdxsdvjzfjatvre7:message73:Add names for static and dynamic plugin libraries.
property-file-info: Link archive with zlib4:path30:storage/archive/CMakeLists.txted7:file_id67:sp1f-cmakelists.txt-20060420173724-gg6gu4cuiqwxpd6ka6x7buomhimxobqu7:message58:Add names for static and dynamic storage 
property-file-info: engine libraries4:path32:storage/blackhole/CMakeLists.txted7:file_id67:sp1f-cmakelists.txt-20060328160515-6sggqkwlvxuf7dhyxybb6wrwk5mmv2kb7:message57:Add names for static and dynamic storage engine
property-file-info: libraries4:path26:storage/csv/CMakeLists.txted7:file_id67:sp1f-cmakelists.txt-20060323153445-xanvnlbevotxrbaqm6juwff7tups33xi7:message59:Add names for static and dynamic storage engine 
property-file-info: libraries
property-file-info: 4:path30:storage/example/CMakeLists.txted7:file_id67:sp1f-cmakelists.txt-20060819155453-lvbabhbwyj6n6qzjroyxasefis7wczs57:message59:Add names for static and dynamic storage engine 
property-file-info: libraries
property-file-info: 4:path32:storage/federated/CMakeLists.txted7:file_id67:sp1f-cmakelists.txt-20060831175237-jypsui3hkl5zmg3rmmc4zu5637tte33m7:message59:Add names for static and dynamic storage engine 
property-file-info: libraries
property-file-info: 4:path27:storage/heap/CMakeLists.txted7:file_id48:cmakelists.txt-20090215021022-15ov21fvravqaicb-27:message32:Better port for ibmdb2i plugin
property-file-info: 
property-file-info: 4:path30:storage/ibmdb2i/CMakeLists.txted7:file_id48:cmakelists.txt-20090527093836-7v4wb2xxka10h4d0-27:message80:Run system checks.
property-file-info: 
property-file-info: Add names for static and dynamic storage engine 
property-file-info: libraries.
property-file-info: 4:path31:storage/innobase/CMakeLists.txted7:file_id48:page0page.ic-20090527093836-7v4wb2xxka10h4d0-1757:message33:Fix compile error on OpenSolaris.4:path37:storage/innobase/include/page0page.iced7:file_id67:sp1f-cmakelists.txt-20060831175237-isyf2yt2n4jgrnjcfu6r2327heoabcyx7:message27:Port CmakeLists.txt to Unix4:path29:storage/myisam/CMakeLists.txted7:file_id67:sp1f-cmakelists.txt-20060831175237-gqsbop4ddbjqltn5seo4t7sgbrurfvi37:message59:Add names for static and dynamic storage engine 
property-file-info: libraries
property-file-info: 4:path32:storage/myisammrg/CMakeLists.txted7:file_id54:mysql_storage_engine-20090610083740-kj4pwd9fzdgs1ocd-17:message56:storage/mysql_storage_engine.cmake => cmake/plugin.cmake4:path34:storage/mysql_storage_engine.cmakeed7:file_id49:cmakelists.txt-20091108233336-m9ewbh1c209yaw0h-337:message54:Configure and install some files from support-files.
property-file-info:  4:path28:support-files/CMakeLists.txted7:file_id64:sp1f-makefile.am-19700101030959-277rra4r5vvtfge67hzsdpbpm2puxyqy7:message12:Add new file4:path25:support-files/Makefile.amed7:file_id67:sp1f-cmakelists.txt-20060831175237-s2uudcsvsmg2idjj3uv2gk56hocgttv67:message127:In general case, mysqlclient library can be dependent
property-file-info: on C++ runtime(if it includes yassl and is not compiled
property-file-info: with gcc or MSVC)4:path20:tests/CMakeLists.txted7:file_id49:cmakelists.txt-20091108233336-m9ewbh1c209yaw0h-397:message14:Add unit tests4:path29:unittest/mysys/CMakeLists.txted7:file_id64:sp1f-makefile.am-20060404161610-vihzdr4qjuef3o5tlkhxxs3o74qy7bln7:message12:Add new file4:path26:unittest/mysys/Makefile.amed7:file_id49:cmakelists.txt-20091108233336-m9ewbh1c209yaw0h-407:message26:Add library for unit tests4:path29:unittest/mytap/CMakeLists.txted7:file_id64:sp1f-makefile.am-20060404161607-pmcjv74iwo633ms2jr4ibem4466jdltk7:message12:Add new file4:path26:unittest/mytap/Makefile.amed7:file_id58:sp1f-tap.c-20060404161607-zis77xthewrsxcegtxfzy7wixxez6grt7:message47:fix function definitions to match declarations
property-file-info: 4:path20:unittest/mytap/tap.ced7:file_id52:create_def_file.js-20090610083754-xik69w7ypq7btk2m-17:message89:Fix link error with intel compiler (icl 
property-file-info: defines of special label for exception handler)
property-file-info: 4:path22:win/create_def_file.jsee
testament3-sha1: 537b237a2bb4d88329b167db78f8c923823a4f69
  • Loading branch information
vaintroub committed Nov 9, 2009
1 parent d28886e commit ce46ec6
Show file tree
Hide file tree
Showing 111 changed files with 6,265 additions and 1,030 deletions.
Binary file modified .bzrfileids
Binary file not shown.
243 changes: 243 additions & 0 deletions BUILD-CMAKE
Original file line number Diff line number Diff line change
@@ -0,0 +1,243 @@
How to Build MySQL server with CMake

WHAT YOU NEED
---------------------------------------------------------------
CMake version 2.6 or later installed on your system.

HOW TO INSTALL:

Linux distributions:
shell> sudo apt-get install cmake

The above works on do Debian/Ubuntu based distributions.On others, command
line needs to be modified to e.g "yum install" on Fedora or "zypper install"
on OpenSUSE.

OpenSolaris:
shell> pfexec pkgadd install SUNWCMake

Windows and Mac OSX:
Download and install the latest distribution from
http://www.cmake.org/cmake/resources/software.html.On Windows, download
installer exe file and run it. On Mac, download the .dmg image and open it.

Other Unixes:
Precompiled packages for other Unix flavors (HPUX, AIX) are available from
http://www.cmake.org/cmake/resources/software.html

Alternatively, you can build from source, source package is also available on
CMake download page.


Compiler Tools
--------------
You will need a working compiler and make utility on your OS.
On Windows, install Visual Studio (Express editions will work too).
On Mac OSX, install Xcode tools.



BUILD
---------------------------------------------------------------
Ensure that compiler and cmake are in PATH.
The following description assumes that current working directory
is the source directory.


- Generic build on Unix, using "Unix Makefiles" generator

shell>cmake .
shell>make

Note: by default, cmake build is less verbose than automake build. Use
"make VERBOSE=1" if you want to see add command lines for each compiled source.

- Windows, using "Visual Studio 9 2008" generator
shell>cmake . -G "Visual Studio 9 2008"
shell>devenv MySQL.sln /build /relwithdebinfo
(alternatively, open MySQL.sln and build using the IDE)

- Windows, using "NMake Makefiles" generator
shell>cmake . -G "NMake Makefiles"
shell>nmake

- Mac OSX build with Xcode
shell>cmake . -G Xcode
shell>xcodebuild -configuration Relwithdebinfo
(alternatively, open MySQL.xcodeproj and build using the IDE)

Command line build with CMake 2.8
After creating project with cmake -G as above, issue
cmake . --build
this works with any CMake generator.

For Visual Studio and Xcode you might want to add an extra
configuration parameter, to avoid building all configurations.

cmake . --build --config Relwithdebinfo


Building "out-of-source"
---------------------------------------------------------------
Building out-of-source provides additional benefits. For example it allows to
build both Release and Debug configurations using the single source tree.Or
build the same source with different version of the same compiler or with
different compilers. Also you will prevent polluting the source tree with the
objects and binaries produced during the make.

Here is an example on how to do it (generic Unix), assuming the source tree is
in directory named src and the current working directory is source root.

shell>mkdir ../build # build directory is called build
shell>cd ../build
shell>cmake ../src

Note: if a directory was used for in-source build, out-of-source will
not work. To reenable out-of-source build, remove <source-root>/CMakeCache.txt
file.


CONFIGURATION PARAMETERS
---------------------------------------------------------------
The procedure above will build with default configuration.

Let's you want to change the configuration parameters and have archive
storage engine compiled into the server instead of building it as pluggable
module.

1)You can provide parameters on the command line, like

shell> cmake . -DWITH_ARCHIVE_STORAGE_ENGINE=1

This can be done during the initial configuration or any time later.

Note, that parameters are "sticky", that is they are remebered in the CMake
cache (CMakeCache.txt file in the build directory)

2) Configuration using cmake-gui (Windows, OSX, or Linux with cmake-gui
installed)

From the build directory, issue
shell> cmake-gui .

- Check the WITH_INNOBASE_STORAGE_ENGINE checkbox
- Click on "Configure" button
- Click on "Generate" button
- Close cmake-gui
shell> make

3)Using ccmake (Unix)
ccmake is curses-based GUI application that provides the same functionality
as cmake-gui. It is less user-friendly compared to cmake-gui but works also
on exotic Unixes like HPUX, AIX or Solaris.

Besides storage engines, probably the most important parameter from a
developer's point of view is WITH_DEBUG (this allows to build server with
dbug tracing library and with debug compile flags).

After changing the configuration, recompile using
shell> make


Listing configuration parameters
---------------------------------------------------------------
shell> cmake -L

Gives a brief overview of important configuration parameters (dump to stdout)

shell> cmake -LH

Does the same but also provides a short help text for each parameter.

shell> cmake -LAH

Dumps all config parameters (including advanced) to the stdout.

PACKAGING
---------------------------------------------------------------
-- Binary distribution --
Packaging in form of tar.gz archives (or .zip on Windows) is also supported
To create a tar.gz package,

1)If you're using "generic" Unix build with makefiles

shell> make package
this will create a tar.gz file in the top level build directory.

2)On Windows, using "NMake Makefiles" generator

shell> nmake package

3)On Windows, using "Visual Studio" generator

shell> devenv mysql.sln /build relwithdebinfo /project package

Note On Windows, 7Zip or Winzip must be installed and 7z.exe rsp winzip.exe
need to be in the PATH.


Another way to build packages is calling cpack executable directly like
shell> cpack -G TGZ --config CPackConfig.cmake
(-G TGZ is for tar.gz generator, there is also -GZIP)

-- Source distribution --
"make dist" target is provided.

ADDITIONAL MAKE TARGETS: "make install" AND "make test"
----------------------------------------------------------------
install target also provided for Makefile based generators. Installation
directory can be controlled using configure-time parameter
CMAKE_INSTALL_PREFIX (default is /usr/local. It is also possible to install to
non-configured directory, using

shell> make install DESTDIR="/some/absolute/path"

"make test" runs unit tests (uses CTest for it)
"make test-force" runs mysql-test-run.pl tests with --test-force parameter

FOR PROGRAMMERS: WRITING PLATFORM CHECKS
--------------------------------------------------------------
If you modify MySQL source and want to add a new platform check,please read
http://www.vtk.org/Wiki/CMake_HowToDoPlatformChecks first. In MySQL, most of
the platform tests are implemented in config.cmake and the template header file
is config.h.cmake

Bigger chunks of functionality, for example non-trivial macros are implemented
in files <src-root>/cmake subdirectory.

For people with autotools background, it is important to remember CMake does
not provide autoheader functionality. That is, when you add a check

CHECK_FUNCTION_EXISTS(foo HAVE_FOO)
to config.cmake, then you will also need to add
#cmakedefine HAVE_FOO 1
to config.h.cmake

Troubleshooting platform checks
--------------------------------
If you suspect that a platform check returned wrong result, examine
<build-root>/CMakeFiles/CMakeError.log and
<build-root>/CMakeFiles/CMakeOutput.log
These files they contain compiler command line, and exact error messages.

Troubleshooting CMake code
----------------------------------
While there are advanced flags for cmake like -debug-trycompile and --trace,
a simple and efficient way to debug to add
MESSAGE("interesting variable=${some_invariable}")
to the interesting places in CMakeLists.txt


Tips:
- When using Makefile generator it is easy to examine which compiler flags are
used to build. For example, compiler flags for mysqld are in
<build-root>/sql/CMakeFiles/mysqld.dir/flags.make and the linker command line
is in <build-root>/sql/CMakeFiles/mysqld.dir/link.txt

- CMake caches results of platform checks in CMakeCache.txt. It is a nice
feature because tests do not rerun when reconfiguring (e.g when a new test was
added).The downside of caching is that when a platform test was wrong and was
later corrected, the cached result is still used. If you encounter this
situation, which should be a rare occation, you need either to remove the
offending entry from CMakeCache.txt (if test was for HAVE_FOO, remove lines
containing HAVE_FOO from CMakeCache.txt) or just remove the cache file.
1 change: 1 addition & 0 deletions BUILD/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
EXTRA_DIST = FINISH.sh \
SETUP.sh \
autorun.sh \
choose_configure.sh \
build_mccge.sh \
check-cpu \
cleanup \
Expand Down
7 changes: 7 additions & 0 deletions BUILD/autorun.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ do
done
IFS="$save_ifs"

rm -rf configure
aclocal || die "Can't execute aclocal"
autoheader || die "Can't execute autoheader"
# --force means overwrite ltmain.sh script if it already exists
Expand All @@ -29,3 +30,9 @@ $LIBTOOLIZE --automake --force --copy || die "Can't execute libtoolize"
# and --force to overwrite them if they already exist
automake --add-missing --force --copy || die "Can't execute automake"
autoconf || die "Can't execute autoconf"
# Do not use autotools generated configure directly. Instead, use a script
# that will either call CMake or original configure shell script at build
# time (CMake is preferred if installed).
mv configure configure.am
cp BUILD/choose_configure.sh configure
chmod a+x configure
14 changes: 14 additions & 0 deletions BUILD/choose_configure.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh
# Choose whether to use autoconf created configure
# of perl script that calls cmake.

# Ensure cmake and perl are there
cmake -P cmake/check_minimal_version.cmake >/dev/null 2>&1 || HAVE_CMAKE=no
perl --version >/dev/null 2>&1 || HAVE_CMAKE=no
if test "$HAVE_CMAKE" = "no"
then
sh ./configure.am $@
else
perl ./cmake/configure.pl $@
fi

Loading

0 comments on commit ce46ec6

Please sign in to comment.