From b44574d5320e095d73aed0239f934f00a17cb261 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 18 Jun 2012 09:44:55 -0400 Subject: [PATCH] Compile and install GDE routines for UTF-8 TODO: Detect icu version --- CMakeLists.txt | 55 +++++++++++++++++++++++++++------------------ sr_unix/mumps.cmake | 2 ++ 2 files changed, 35 insertions(+), 22 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e1aba68..be7bb7d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -406,19 +406,24 @@ file(GLOB m_files_sr_unix RELATIVE ${GTM_SOURCE_DIR}/sr_unix ${GTM_SOURCE_DIR}/s file(GLOB mpt_files_sr_port RELATIVE ${GTM_SOURCE_DIR}/sr_port ${GTM_SOURCE_DIR}/sr_port/*.mpt) file(GLOB mpt_files_sr_unix RELATIVE ${GTM_SOURCE_DIR}/sr_unix ${GTM_SOURCE_DIR}/sr_unix/*.mpt) +set(gtm_chset_dir_ "") +set(gtm_chset_dir_UTF-8 "/utf8") + foreach(d sr_port sr_unix) foreach(m ${m_files_${d}}) get_filename_component(m_name "${m}" NAME_WE) string(TOUPPER "${m_name}" m_upper) if("${m}" MATCHES "^gde") - set(m_out "${GTM_BINARY_DIR}${gtm_chset_dir_${gtm_chset}}/${m_upper}.m") - add_custom_command( - OUTPUT "${m_out}" - DEPENDS ${GTM_SOURCE_DIR}/${d}/${m} - COMMAND ${CMAKE_COMMAND} -E copy ${GTM_SOURCE_DIR}/${d}/${m} "${m_out}" - ) - list(APPEND files_to_place "${m_out}") - list(APPEND gde_routines "${m_out}") + foreach(gtm_chset "" "UTF-8") + set(m_out "${GTM_BINARY_DIR}${gtm_chset_dir_${gtm_chset}}/${m_upper}.m") + add_custom_command( + OUTPUT "${m_out}" + DEPENDS ${GTM_SOURCE_DIR}/${d}/${m} + COMMAND ${CMAKE_COMMAND} -E copy ${GTM_SOURCE_DIR}/${d}/${m} "${m_out}" + ) + list(APPEND files_to_place "${m_out}") + list(APPEND gtm_chset_routines_${gtm_chset} "${m_out}") + endforeach() else() set(m_out "${GTM_BINARY_DIR}/${m_upper}.m") add_custom_command( @@ -487,20 +492,26 @@ install(FILES ${scripts} PERMISSIONS ${install_permissions_script} ) -foreach(in ${gde_routines}) - string(REPLACE ".m" ".o" out "${in}") - add_custom_command( - OUTPUT ${out} - DEPENDS ${in} ${GTM_SOURCE_DIR}/sr_unix/mumps.cmake - COMMAND ${CMAKE_COMMAND} - -D gtm_dist=${GTM_BINARY_DIR} - -D mumps=$ - -D "args=${in}" - -P ${GTM_SOURCE_DIR}/sr_unix/mumps.cmake - VERBATIM - ) - list(APPEND files_to_place ${out}) - install(FILES "${out}" DESTINATION ${GTM_INSTALL_DIR}) +foreach(gtm_chset "" "UTF-8") + foreach(in ${gtm_chset_routines_${gtm_chset}}) + string(REPLACE ".m" ".o" out "${in}") + get_filename_component(out_dir "${out}" PATH) + add_custom_command( + OUTPUT ${out} + DEPENDS ${in} ${GTM_SOURCE_DIR}/sr_unix/mumps.cmake + COMMAND ${CMAKE_COMMAND} + -D gtm_dist=${GTM_BINARY_DIR} + -D gtm_chset=${gtm_chset} + -D gtm_icu_version=4.8 + -D mumps=$ + -D "args=${in}" + -P ${GTM_SOURCE_DIR}/sr_unix/mumps.cmake + WORKING_DIRECTORY ${out_dir} + VERBATIM + ) + list(APPEND files_to_place ${out}) + install(FILES "${out}" DESTINATION ${GTM_INSTALL_DIR}${gtm_chset_dir_${gtm_chset}}) + endforeach() endforeach() set(GTM_TOP "${GTM_BINARY_DIR}") diff --git a/sr_unix/mumps.cmake b/sr_unix/mumps.cmake index 7b16629..1f5221f 100644 --- a/sr_unix/mumps.cmake +++ b/sr_unix/mumps.cmake @@ -10,6 +10,8 @@ ################################################################# set(ENV{gtm_dist} "${gtm_dist}") set(ENV{gtmroutines} ".") +set(ENV{gtm_chset} "${gtm_chset}") +set(ENV{gtm_icu_version} "${gtm_icu_version}") if(output_file) set(output_file OUTPUT_FILE ${output_file}) endif()