Ticket #31169: cmake-boost-locale.diff

File cmake-boost-locale.diff, 2.3 KB (added by titus@…, 13 years ago)

patch for compiling and linking locale of cmake-boost

  • libs/locale/src/CMakeLists.txt

    diff --git a/libs/locale/src/CMakeLists.txt b/libs/locale/src/CMakeLists.txt
    index e9b5e9b..c5ee05c 100644
    a b if (ICU_FOUND AND ICU_I18N_FOUND) 
    1010  set (BOOST_LOCALE_ICU_LIBRARIES ${ICU_LIBRARIES} ${ICU_I18N_LIBRARIES})
    1111  colormsg (GREEN "+-- ICU (unicode) available for locale, enabling support.")
    1212  set (NO_STATIC_IF_ICU_FOUND "NO_STATIC")
     13  set(LOCALE_ICU_SOURCES
     14      icu/boundary.cpp
     15      icu/codecvt.cpp
     16      icu/collator.cpp
     17      icu/conversion.cpp
     18      icu/date_time.cpp
     19      icu/formatter.cpp
     20      icu/icu_backend.cpp
     21      icu/numeric.cpp
     22      icu/time_zone.cpp
     23  )
    1324else (ICU_FOUND AND ICU_I18N_FOUND)
    1425  colormsg (CYAN "+-- ICU (unicode) not available for locale, disabling support.")
     26  set(LOCALE_ICU_SOURCES)
    1527endif (ICU_FOUND AND ICU_I18N_FOUND)
    16  
     28
     29set(LOCALE_POSIX_SOURCES)
     30set(LOCALE_WIN_SOURCES)
     31set(LOCALE_STD_SOURCES)
     32if(UNIX)
     33  set(LOCALE_POSIX_SOURCES
     34      posix/collate.cpp
     35      posix/converter.cpp
     36      posix/numeric.cpp
     37      posix/codecvt.cpp
     38      posix/posix_backend.cpp
     39  )
     40  set(LOCALE_STD_SOURCES
     41      std/codecvt.cpp
     42      std/collate.cpp
     43      std/converter.cpp
     44      std/numeric.cpp
     45      std/std_backend.cpp
     46  )
     47  add_definitions(-DBOOST_LOCALE_NO_WINAPI_BACKEND=1)
     48  colormsg (GREEN "+-- UNIX system: enabling posix and std locale backends.")
     49elseif(WIN32)
     50  set(LOCALE_WIN_SOURCES
     51      win32/collate.cpp
     52      win32/converter.cpp
     53      win32/lcid.cpp
     54      win32/numeric.cpp
     55      win32/win_backend.cpp
     56  )
     57  add_definitions(-DBOOST_LOCALE_NO_POSIX_BACKEND=1)
     58  add_definitions(-DBOOST_LOCALE_NO_STD_BACKEND=1)
     59  colormsg (GREEN "+-- WIN32 system: enabling winapi locale backend.")
     60else()
     61  message(FATAL_ERROR "Cannot decide which backend to enable!")
     62endif()
    1763
    1864add_definitions (-DBOOST_THREAD_NO_LIB=1)
    1965boost_add_library (
    boost_add_library ( 
    2975  shared/mo_lambda.cpp
    3076  util/codecvt_converter.cpp
    3177  util/default_locale.cpp
     78  util/gregorian.cpp
    3279  util/info.cpp
    3380  util/locale_data.cpp 
     81  ${LOCALE_ICU_SOURCES}
     82  ${LOCALE_POSIX_SOURCES}
     83  ${LOCALE_STD_SOURCES}
     84  ${LOCALE_WIN_SOURCES}
    3485
    3586  LINK_LIBS ${BOOST_LOCALE_ICU_LIBRARIES}
    3687  SHARED_COMPILE_FLAGS -DBOOST_LOCALE_DYN_LINK=1
    3788  ${NO_STATIC_IF_ICU_FOUND}
     89  DEPENDS boost_thread
    3890  )