@@ -148,17 +148,9 @@ set( with-tests "yes" CACHE BOOL "Compile with unit tests." )
148148#------------------------------------------------------------------------------
149149set ( with-examples "yes" CACHE BOOL "Compile with examples." )
150150
151- # Implement -Dwith-icu and define WITH_ICU and output ${icu} .
151+ # Implement -Dwith-normalization-demo and declare with-normalization-demo .
152152#------------------------------------------------------------------------------
153- set ( with-icu "no" CACHE BOOL "Compile with International Components for Unicode." )
154-
155- if (with-icu)
156- add_definitions ( -DWITH_ICU )
157- endif ()
158-
159- if (with-icu)
160- set ( icu "-DWITH_ICU" )
161- endif ()
153+ set ( with-normalization-demo "no" CACHE BOOL "Compile the Unicode normalization demo (examples/normalization_demo.cpp)." )
162154
163155# Implement -Denable-avx2.
164156#------------------------------------------------------------------------------
@@ -340,48 +332,36 @@ set( Boost_LIBRARY_DIR $<IF:$<BOOL:${enable-ndebug}>,"${Boost_LIBRARY_DIR_RELEAS
340332set ( boost_CPPFLAGS "-I${Boost_INCLUDE_DIR} " )
341333set ( boost_LDFLAGS "-L${Boost_LIBRARY_DIR} " )
342334
343- # Find icu-i18n
344- #------------------------------------------------------------------------------
345- if (with-icu)
346- find_package ( Icu-I18N 55.2 REQUIRED )
347- endif ()
348-
349335# Find secp256k1
350336#------------------------------------------------------------------------------
351337find_package ( Secp256K1 0.5.1.0 REQUIRED )
352338
353339# Define project common includes for build.
354340#------------------------------------------------------------------------------
355341if (BUILD_SHARED_LIBS )
356- set ( icu_i18n_FOR_BUILD_INCLUDE_DIRS ${icu_i18n_INCLUDE_DIRS} CACHE STRING "Placeholder" )
357342 set ( secp256k1_FOR_BUILD_INCLUDE_DIRS ${secp256k1_INCLUDE_DIRS} CACHE STRING "Placeholder" )
358343else ()
359- set ( icu_i18n_FOR_BUILD_INCLUDE_DIRS ${icu_i18n_STATIC_INCLUDE_DIRS} CACHE STRING "Placeholder" )
360344 set ( secp256k1_FOR_BUILD_INCLUDE_DIRS ${secp256k1_STATIC_INCLUDE_DIRS} CACHE STRING "Placeholder" )
361345endif ()
362346
363347# Define project common includes directories
364348#------------------------------------------------------------------------------
365349include_directories ( SYSTEM
366350 ${Boost_INCLUDE_DIR}
367- ${icu_i18n_FOR_BUILD_INCLUDE_DIRS}
368351 ${secp256k1_FOR_BUILD_INCLUDE_DIRS} )
369352
370353# Define project common library directories for build.
371354#------------------------------------------------------------------------------
372355if (BUILD_SHARED_LIBS )
373- set ( icu_i18n_FOR_BUILD_LIBRARY_DIRS ${icu_i18n_LIBRARY_DIRS} CACHE STRING "Placeholder" )
374356 set ( secp256k1_FOR_BUILD_LIBRARY_DIRS ${secp256k1_LIBRARY_DIRS} CACHE STRING "Placeholder" )
375357else ()
376- set ( icu_i18n_FOR_BUILD_LIBRARY_DIRS ${icu_i18n_STATIC_LIBRARY_DIRS} CACHE STRING "Placeholder" )
377358 set ( secp256k1_FOR_BUILD_LIBRARY_DIRS ${secp256k1_STATIC_LIBRARY_DIRS} CACHE STRING "Placeholder" )
378359endif ()
379360
380361# Define project common library directories
381362#------------------------------------------------------------------------------
382363link_directories (
383364 ${Boost_LIBRARY_DIRS}
384- ${icu_i18n_FOR_BUILD_LIBRARY_DIRS}
385365 ${secp256k1_FOR_BUILD_LIBRARY_DIRS} )
386366
387367# Define project common linker flags.
@@ -408,10 +388,8 @@ endif()
408388# Define common library usage for build.
409389#------------------------------------------------------------------------------
410390if (BUILD_SHARED_LIBS )
411- set ( icu_i18n_FOR_BUILD_LIBRARIES ${icu_i18n_LIBRARIES} CACHE STRING "Placeholder" )
412391 set ( secp256k1_FOR_BUILD_LIBRARIES ${secp256k1_LIBRARIES} CACHE STRING "Placeholder" )
413392else ()
414- set ( icu_i18n_FOR_BUILD_LIBRARIES ${icu_i18n_STATIC_LIBRARIES} CACHE STRING "Placeholder" )
415393 set ( secp256k1_FOR_BUILD_LIBRARIES ${secp256k1_STATIC_LIBRARIES} CACHE STRING "Placeholder" )
416394endif ()
417395
@@ -423,12 +401,8 @@ link_libraries(
423401 ${Boost_PROGRAM_OPTIONS_LIBRARY}
424402 ${Boost_THREAD_LIBRARY}
425403 ${Boost_URL_LIBRARY}
426- ${icu_i18n_FOR_BUILD_LIBRARIES}
427404 ${secp256k1_FOR_BUILD_LIBRARIES} )
428405
429- add_definitions (
430- ${icu} )
431-
432406# Define ${CANONICAL_LIB_NAME} project.
433407#------------------------------------------------------------------------------
434408add_library ( ${CANONICAL_LIB_NAME}
@@ -512,6 +486,7 @@ add_library( ${CANONICAL_LIB_NAME}
512486 "../../src/unicode/code_points.cpp"
513487 "../../src/unicode/conversion.cpp"
514488 "../../src/unicode/normalization.cpp"
489+ "../../src/unicode/unicode_tables.cpp"
515490 "../../src/unicode/utf8_everywhere/console_streambuf.cpp"
516491 "../../src/unicode/utf8_everywhere/environment.cpp"
517492 "../../src/unicode/utf8_everywhere/ifstream.cpp"
@@ -587,10 +562,8 @@ add_library( ${CANONICAL_LIB_NAME}
587562# ${CANONICAL_LIB_NAME} project specific include directory normalization for build.
588563#------------------------------------------------------------------------------
589564if (BUILD_SHARED_LIBS )
590- set ( icu_i18n_FOR_BUILD_INCLUDE_DIRS ${icu_i18n_INCLUDE_DIRS} CACHE STRING "Placeholder" )
591565 set ( secp256k1_FOR_BUILD_INCLUDE_DIRS ${secp256k1_INCLUDE_DIRS} CACHE STRING "Placeholder" )
592566else ()
593- set ( icu_i18n_FOR_BUILD_INCLUDE_DIRS ${icu_i18n_STATIC_INCLUDE_DIRS} CACHE STRING "Placeholder" )
594567 set ( secp256k1_FOR_BUILD_INCLUDE_DIRS ${secp256k1_STATIC_INCLUDE_DIRS} CACHE STRING "Placeholder" )
595568endif ()
596569
@@ -599,7 +572,6 @@ endif()
599572target_include_directories ( ${CANONICAL_LIB_NAME} PRIVATE
600573 "../../include"
601574 ${Boost_INCLUDE_DIR}
602- ${icu_i18n_FOR_BUILD_INCLUDE_DIRS}
603575 ${secp256k1_FOR_BUILD_INCLUDE_DIRS} )
604576
605577target_include_directories ( ${CANONICAL_LIB_NAME} PUBLIC
@@ -608,10 +580,8 @@ target_include_directories( ${CANONICAL_LIB_NAME} PUBLIC
608580# ${CANONICAL_LIB_NAME} project specific libraries noramalization for build.
609581#------------------------------------------------------------------------------
610582if (BUILD_SHARED_LIBS )
611- set ( icu_i18n_FOR_BUILD_LIBRARIES ${icu_i18n_LIBRARIES} CACHE STRING "Placeholder" )
612583 set ( secp256k1_FOR_BUILD_LIBRARIES ${secp256k1_LIBRARIES} CACHE STRING "Placeholder" )
613584else ()
614- set ( icu_i18n_FOR_BUILD_LIBRARIES ${icu_i18n_STATIC_LIBRARIES} CACHE STRING "Placeholder" )
615585 set ( secp256k1_FOR_BUILD_LIBRARIES ${secp256k1_STATIC_LIBRARIES} CACHE STRING "Placeholder" )
616586endif ()
617587
@@ -623,7 +593,6 @@ target_link_libraries( ${CANONICAL_LIB_NAME}
623593 ${Boost_PROGRAM_OPTIONS_LIBRARY}
624594 ${Boost_THREAD_LIBRARY}
625595 ${Boost_URL_LIBRARY}
626- ${icu_i18n_FOR_BUILD_LIBRARIES}
627596 ${secp256k1_FOR_BUILD_LIBRARIES} )
628597
629598# Define libbitcoin-system-examples project.
@@ -644,6 +613,28 @@ if (with-examples)
644613
645614endif ()
646615
616+ # Define libbitcoin-system-normalization-demo project.
617+ #------------------------------------------------------------------------------
618+ if (with-normalization-demo)
619+ add_executable ( libbitcoin-system-normalization-demo
620+ "../../examples/normalization_demo.cpp" )
621+
622+ # libbitcoin-system-normalization-demo project specific include directories.
623+ #------------------------------------------------------------------------------
624+ target_include_directories ( libbitcoin-system-normalization-demo PRIVATE
625+ "../../include" )
626+
627+ # libbitcoin-system-normalization-demo project specific libraries/linker flags.
628+ #------------------------------------------------------------------------------
629+ target_link_libraries ( libbitcoin-system-normalization-demo
630+ ${CANONICAL_LIB_NAME} )
631+
632+ if (BUILD_EXTERNAL_DEPS)
633+ add_dependencies ( libbitcoin-system-normalization-demo boost_build secp256k1_build )
634+ endif ()
635+
636+ endif ()
637+
647638# Define libbitcoin-system-test project.
648639#------------------------------------------------------------------------------
649640if (with-tests)
@@ -936,4 +927,3 @@ install( TARGETS ${CANONICAL_LIB_NAME}
936927#------------------------------------------------------------------------------
937928install ( DIRECTORY "../../include/bitcoin"
938929 DESTINATION include )
939-
0 commit comments