move mumps.cmake to sr_unix. create UTF8 GDE OBJs

WARNING WARNING WARNING
The rules to create the UTF-8 mode GDE object files do what is desired, but I
don't think that I did them correctly.

Additionally, we need some way to query the installed ICU version on the
deployment host and get the value into CMAKE. Normally, we use:
  icu-config --version | cut -d"." -f -2

To get the UTF-8 GDE object files I set gtm_icu_version to 4.8 prior to running
CMAKE. While this works, it's not friendly to anyone.
This commit is contained in:
Amul Shah 2012-06-16 00:40:44 -04:00
parent ee099a029d
commit 211bd169e8
2 changed files with 26 additions and 17 deletions

View File

@ -509,19 +509,26 @@ install(FILES ${scripts}
) )
foreach(in ${gde_routines}) foreach(in ${gde_routines})
foreach(gtm_chset
""
"UTF-8")
string(REPLACE "UTF-8" "/utf8" chset "${gtm_chset}")
string(REPLACE ".m" ".o" out "${in}") string(REPLACE ".m" ".o" out "${in}")
add_custom_command( add_custom_command(
OUTPUT ${out} OUTPUT ${chset}${out}
DEPENDS ${in} ${GTM_SOURCE_DIR}/sr_port/mumps.cmake DEPENDS ${in} ${GTM_SOURCE_DIR}/sr_unix/mumps.cmake
COMMAND ${CMAKE_COMMAND} COMMAND ${CMAKE_COMMAND}
-D gtm_dist=${GTM_BINARY_DIR} -D gtm_dist=${GTM_BINARY_DIR}
-D gtm_chset=${gtm_chset}
-D gtm_icu_version="4.8"
-D mumps=$<TARGET_FILE:mumps> -D mumps=$<TARGET_FILE:mumps>
-D "args=${in}" -D "args=${in}"
-P ${GTM_SOURCE_DIR}/sr_port/mumps.cmake -P ${GTM_SOURCE_DIR}/sr_unix/mumps.cmake
VERBATIM VERBATIM
) )
list(APPEND files_to_place ${out}) list(APPEND files_to_place ${out})
install(FILES "${out}" DESTINATION ${GTM_INSTALL_DIR}) install(FILES "${out}" DESTINATION ${GTM_INSTALL_DIR}${chset})
endforeach()
endforeach() endforeach()
set(GTM_TOP "${GTM_BINARY_DIR}") set(GTM_TOP "${GTM_BINARY_DIR}")
@ -571,14 +578,14 @@ add_custom_command(
DEPENDS ${GTM_SOURCE_DIR}/sr_unix/ttt.txt DEPENDS ${GTM_SOURCE_DIR}/sr_unix/ttt.txt
gen/chk2lev.m gen/chkop.m gen/gendash.m gen/genout.m gen/loadop.m gen/chk2lev.m gen/chkop.m gen/gendash.m gen/genout.m gen/loadop.m
gen/loadvx.m gen/tttgen.m gen/tttscan.m gen/loadvx.m gen/tttgen.m gen/tttscan.m
${GTM_SOURCE_DIR}/sr_port/mumps.cmake ${GTM_SOURCE_DIR}/sr_unix/mumps.cmake
WORKING_DIRECTORY ${GTM_BINARY_DIR}/gen WORKING_DIRECTORY ${GTM_BINARY_DIR}/gen
COMMAND ${CMAKE_COMMAND} COMMAND ${CMAKE_COMMAND}
-D gtm_dist=${GTM_BINARY_DIR} -D gtm_dist=${GTM_BINARY_DIR}
-D mumps=$<TARGET_FILE:mumps> -D mumps=$<TARGET_FILE:mumps>
-D "args=${mumps_ttt_args}" -D "args=${mumps_ttt_args}"
-D output_file=ttt.log -D output_file=ttt.log
-P ${GTM_SOURCE_DIR}/sr_port/mumps.cmake -P ${GTM_SOURCE_DIR}/sr_unix/mumps.cmake
VERBATIM VERBATIM
) )
list(APPEND gen_bootstrap_files gen/ttt.c) list(APPEND gen_bootstrap_files gen/ttt.c)
@ -593,13 +600,13 @@ foreach(msg
set(mumps_msg_args -run msg ${GTM_SOURCE_DIR}/${msg} unix) set(mumps_msg_args -run msg ${GTM_SOURCE_DIR}/${msg} unix)
add_custom_command( add_custom_command(
OUTPUT gen/${name}_ctl.c OUTPUT gen/${name}_ctl.c
DEPENDS gen/msg.m ${GTM_SOURCE_DIR}/${msg} ${GTM_SOURCE_DIR}/sr_port/mumps.cmake DEPENDS gen/msg.m ${GTM_SOURCE_DIR}/${msg} ${GTM_SOURCE_DIR}/sr_unix/mumps.cmake
WORKING_DIRECTORY ${GTM_BINARY_DIR}/gen WORKING_DIRECTORY ${GTM_BINARY_DIR}/gen
COMMAND ${CMAKE_COMMAND} COMMAND ${CMAKE_COMMAND}
-D gtm_dist=${GTM_BINARY_DIR} -D gtm_dist=${GTM_BINARY_DIR}
-D mumps=$<TARGET_FILE:mumps> -D mumps=$<TARGET_FILE:mumps>
-D "args=${mumps_msg_args}" -D "args=${mumps_msg_args}"
-P ${GTM_SOURCE_DIR}/sr_port/mumps.cmake -P ${GTM_SOURCE_DIR}/sr_unix/mumps.cmake
VERBATIM VERBATIM
) )
list(APPEND gen_bootstrap_files gen/${name}_ctl.c) list(APPEND gen_bootstrap_files gen/${name}_ctl.c)

View File

@ -10,6 +10,8 @@
################################################################# #################################################################
set(ENV{gtm_dist} "${gtm_dist}") set(ENV{gtm_dist} "${gtm_dist}")
set(ENV{gtmroutines} ".") set(ENV{gtmroutines} ".")
set(ENV{gtm_chset} "${gtm_chset}")
set(ENV{gtm_icu_version} "${gtm_icu_version}")
if(output_file) if(output_file)
set(output_file OUTPUT_FILE ${output_file}) set(output_file OUTPUT_FILE ${output_file})
endif() endif()