Bug #89398 Cannot use -DWITH_ICU=system if -DWITH_LIBEVENT=system is given
Submitted: 25 Jan 2018 10:19 Modified: 1 Mar 2018 15:46
Reporter: Laurynas Biveinis (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:8.0.4 OS:Any
Assigned to: CPU Architecture:Any
Tags: cmake, icu, libevent

[25 Jan 2018 10:19] Laurynas Biveinis
Description:
If -DWITH_LIBEVENT=bundled (the default) then -DWITH_ICU=system works.
If -DWITH_LIBEVENT=system then -DWITH_ICU=system makes CMake fail with

CMake Error at extra/re2/CMakeLists.txt:74 (ADD_COMPILE_FLAGS):
  Unknown CMake command "ADD_COMPILE_FLAGS".

-- Configuring incomplete, errors occurred!

How to repeat:
Compare the outcome of the two CMake invocation (this is macOS, thus -DWITH_ICU=system is given by an installation path prefix):

$ cmake ../mysql-8.0.4/ -DWITH_ICU=/usr/local/opt/icu4c -DWITH_LIBEVENT=system  -DWITH_BOOST=...
$ cmake ../mysql-8.0.4/ -DWITH_ICU=/usr/local/opt/icu4c -DWITH_BOOST=...

Suggested fix:
extra/re2/CMakeLists.txt seems to be missing INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/compile_flags.cmake)
[7 Feb 2018 9:19] MySQL Verification Team
Hello Laurynas,

Thank you for the report.

Thanks,
Umesh
[7 Feb 2018 9:20] MySQL Verification Team
Build details

Attachment: 89398.build (application/octet-stream, text), 38.20 KiB.

[1 Mar 2018 15:46] Paul DuBois
Posted by developer:
 
Fixed in 8.0.5.

Using the -DWITH_LIBEVENT=system and -DWITH_ICU=system CMake options
together caused configuration to fail.