2012-06-15 15:53:10 -04:00
|
|
|
#################################################################
|
|
|
|
# #
|
2024-07-19 11:43:27 -04:00
|
|
|
# Copyright 2012, 2013 Fidelity Information Services, Inc #
|
2012-06-15 15:53:10 -04:00
|
|
|
# #
|
|
|
|
# This source code contains the intellectual property #
|
|
|
|
# of its copyright holder(s), and is made available #
|
|
|
|
# under a license. If you do not know the terms of #
|
|
|
|
# the license, please stop and do not read further. #
|
|
|
|
# #
|
|
|
|
#################################################################
|
|
|
|
|
2012-06-15 15:35:48 -04:00
|
|
|
# CMake 2.8.4 introduced LINK_DEPENDS target property
|
2012-06-14 13:34:21 -04:00
|
|
|
# CMake 2.8.4 introduced generator expressions in custom commands
|
|
|
|
# CMake 2.8.5 introduced use of C compiler as the assembler
|
|
|
|
cmake_minimum_required(VERSION 2.8.5)
|
2012-06-13 14:11:21 -04:00
|
|
|
project(GTM C ASM)
|
|
|
|
|
2024-07-19 11:43:27 -04:00
|
|
|
# Max optimization level is -O2
|
|
|
|
get_property(languages GLOBAL PROPERTY ENABLED_LANGUAGES)
|
|
|
|
foreach(lang ${languages})
|
|
|
|
get_property(flags CACHE CMAKE_${lang}_FLAGS_RELEASE PROPERTY VALUE)
|
|
|
|
if("${flags}" MATCHES "-O[3-9]")
|
|
|
|
string(REGEX REPLACE "-O[3-9]" "-O2" flags "${flags}")
|
|
|
|
set_property(CACHE CMAKE_${lang}_FLAGS_RELEASE PROPERTY VALUE "${flags}")
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
# Defaults
|
|
|
|
set(version V6.0-003)
|
|
|
|
if("${version}" STREQUAL "")
|
|
|
|
set(version V9.9-0)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# If CMAKE_BUILD_TYPE is not defined make it a Release build
|
|
|
|
if(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
|
|
|
|
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# If it's a debug build make sure GT.M uses all of its debug options
|
|
|
|
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DDEBUG")
|
|
|
|
|
|
|
|
set(install_permissions_script
|
|
|
|
OWNER_READ OWNER_EXECUTE OWNER_WRITE
|
|
|
|
GROUP_READ GROUP_EXECUTE
|
|
|
|
WORLD_READ WORLD_EXECUTE
|
|
|
|
)
|
|
|
|
|
|
|
|
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG DEBUG)
|
|
|
|
|
|
|
|
# Only IA64 and x86_64 architectures use this option
|
|
|
|
set(gen_xfer_desc 0)
|
|
|
|
|
|
|
|
# Platform specific libs
|
|
|
|
set(gtm_osarch_libs "")
|
|
|
|
|
|
|
|
# Define these ahead of establishing platforms
|
|
|
|
set(gt_src_list)
|
|
|
|
set(sources_used "")
|
|
|
|
set(extralibs "")
|
|
|
|
set(is_encryption_supported 1)
|
|
|
|
set(libmumpsrestoreregex "")
|
|
|
|
message("--> OS = ${CMAKE_SYSTEM_NAME} / ARCH = ${CMAKE_SYSTEM_PROCESSOR}")
|
|
|
|
# Establish platform
|
|
|
|
# Except for Solaris, CMAKE_COMPILER_IS_GNUCC is true
|
|
|
|
if("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
|
|
|
|
include(sr_linux/platform.cmake)
|
|
|
|
elseif("${CMAKE_SYSTEM_NAME}" MATCHES "HP-UX")
|
|
|
|
include(sr_hpux/platform.cmake)
|
|
|
|
elseif("${CMAKE_SYSTEM_NAME}" MATCHES "AIX")
|
|
|
|
include(sr_aix/platform.cmake)
|
|
|
|
elseif("${CMAKE_SYSTEM_NAME}" MATCHES "SunOS")
|
|
|
|
include(sr_sun/platform.cmake)
|
2012-06-15 14:56:50 -04:00
|
|
|
else()
|
2024-07-19 11:43:27 -04:00
|
|
|
message(FATAL_ERROR "--> OS = ${CMAKE_SYSTEM_NAME} / ARCH = ${CMAKE_SYSTEM_PROCESSOR}")
|
2012-06-15 14:56:50 -04:00
|
|
|
endif()
|
|
|
|
|
2012-10-04 08:29:00 -04:00
|
|
|
# Choose where to get bootstrap sources.
|
|
|
|
set(GTM_DIST "" CACHE PATH "Existing GT.M Distribution")
|
|
|
|
if(GTM_DIST)
|
|
|
|
# Bootstrap using already-installed mumps.
|
|
|
|
message(STATUS "Using existing gtm_dist=${GTM_DIST} to generate sources.")
|
|
|
|
set(gen_bootstrap 1)
|
|
|
|
set(gen_bootstrap_dist "${GTM_DIST}")
|
|
|
|
set(gen_bootstrap_mumps "${GTM_DIST}/mumps")
|
|
|
|
set(gen_bootstrap_depend "${gen_bootstrap_mumps}")
|
|
|
|
else()
|
|
|
|
# Bootstrap using pre-generated bootstrap sources.
|
|
|
|
# We generate them again only for comparison.
|
|
|
|
set(gen_bootstrap 0)
|
|
|
|
set(gen_bootstrap_dist "${GTM_BINARY_DIR}")
|
|
|
|
set(gen_bootstrap_mumps "$<TARGET_FILE:mumps>")
|
|
|
|
set(gen_bootstrap_depend mumps)
|
|
|
|
endif()
|
|
|
|
|
2012-06-15 14:56:50 -04:00
|
|
|
set(GTM_INSTALL_DIR lib/fis-gtm/${version}_${arch} CACHE STRING "Install directory (under CMAKE_PREFIX_PATH if relative)")
|
|
|
|
if(NOT GTM_INSTALL_DIR)
|
|
|
|
set(GTM_INSTALL_DIR .)
|
|
|
|
endif()
|
|
|
|
|
2012-10-04 14:35:01 -04:00
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
# Source files are organized into subdirectories named by platform.
|
|
|
|
# Store in 'gt_src_list' a list of directory names selected and
|
|
|
|
# ordered based on the target platform. A given source file name may
|
|
|
|
# appear in multiple directories but only the instance found earliest
|
|
|
|
# in the search path will be used. Later instances of the same source
|
|
|
|
# file name will be ignored.
|
2012-06-15 15:53:45 -04:00
|
|
|
list(APPEND gt_src_list
|
2012-06-13 11:22:34 -04:00
|
|
|
sr_unix_gnp
|
2012-06-14 10:53:26 -04:00
|
|
|
sr_unix_cm
|
|
|
|
sr_unix
|
2012-06-13 11:22:34 -04:00
|
|
|
sr_port_cm
|
2012-06-14 10:53:26 -04:00
|
|
|
sr_port
|
2012-06-13 11:22:34 -04:00
|
|
|
)
|
2012-10-04 14:35:01 -04:00
|
|
|
|
|
|
|
# Collect the source file names belonging to each directory. Store
|
|
|
|
# the full path to a directory in 'source_dir_${d}' and the list of
|
|
|
|
# source file names in the directory in 'sources_${d}'.
|
2012-10-04 08:19:45 -04:00
|
|
|
foreach(d ${gt_src_list})
|
|
|
|
set(source_dir_${d} ${GTM_SOURCE_DIR}/${d})
|
|
|
|
file(GLOB sources_${d} RELATIVE ${source_dir_${d}}
|
2024-07-19 11:43:27 -04:00
|
|
|
${d}/*.c ${d}/*.s ${d}/*.si)
|
2012-10-04 08:19:45 -04:00
|
|
|
endforeach()
|
2012-10-04 08:29:00 -04:00
|
|
|
if(gen_bootstrap)
|
|
|
|
# Prefer generated sources over all other locations.
|
|
|
|
set(gt_src_list gen ${gt_src_list})
|
|
|
|
set(source_dir_gen ${GTM_BINARY_DIR}/gen)
|
|
|
|
# Hard-code list since we cannot glob files that do not exist.
|
|
|
|
set(sources_gen cmerrors_ctl.c cmierrors_ctl.c gdeerrors_ctl.c merrors_ctl.c ttt.c)
|
|
|
|
endif()
|
2012-06-13 11:22:34 -04:00
|
|
|
|
2012-10-04 14:35:01 -04:00
|
|
|
# The C preprocessor include search path consists of every source
|
|
|
|
# directory ordered by 'gt_src_list'.
|
2012-06-13 11:22:34 -04:00
|
|
|
set(includes)
|
2012-06-15 15:53:45 -04:00
|
|
|
foreach(d ${gt_src_list})
|
2012-10-04 08:19:45 -04:00
|
|
|
list(APPEND includes ${source_dir_${d}})
|
2012-06-13 11:22:34 -04:00
|
|
|
endforeach()
|
|
|
|
include_directories(${includes})
|
2012-10-04 14:35:01 -04:00
|
|
|
# We generate some uniquely-named headers in the top of the build tree.
|
2012-06-14 15:23:21 -04:00
|
|
|
include_directories(${GTM_BINARY_DIR})
|
2012-06-13 11:22:34 -04:00
|
|
|
|
2012-10-04 14:35:01 -04:00
|
|
|
# Function to select the first instance of a given source file name
|
|
|
|
# found in the ordered 'gt_src_list' search path.
|
2012-06-15 11:24:31 -04:00
|
|
|
function(select_file src_var name)
|
2012-06-13 16:16:59 -04:00
|
|
|
set(found "")
|
2012-06-15 15:53:45 -04:00
|
|
|
foreach(d ${gt_src_list})
|
2012-10-04 08:19:45 -04:00
|
|
|
set(src "${source_dir_${d}}/${name}")
|
2012-06-15 11:24:31 -04:00
|
|
|
if(EXISTS "${src}")
|
|
|
|
set(found "${src}")
|
2012-06-13 16:16:59 -04:00
|
|
|
break()
|
2012-06-13 11:22:34 -04:00
|
|
|
endif()
|
|
|
|
endforeach()
|
2012-06-13 16:16:59 -04:00
|
|
|
if(NOT found)
|
|
|
|
message(FATAL_ERROR "Cannot find \"${name}\" as ${ARGN}")
|
|
|
|
endif()
|
|
|
|
set("${src_var}" "${found}" PARENT_SCOPE)
|
2012-06-15 11:19:11 -04:00
|
|
|
endfunction()
|
2012-06-13 16:16:59 -04:00
|
|
|
|
2012-10-04 14:35:01 -04:00
|
|
|
# Macro to search directories ordered by 'gt_src_list' for a given
|
|
|
|
# list of source file names, assign them to a target, and exclude the
|
|
|
|
# source file names from inclusion in libmumps.
|
2012-06-15 11:19:11 -04:00
|
|
|
macro(set_source_list target)
|
|
|
|
foreach(name ${ARGN})
|
|
|
|
set(src "")
|
2012-06-15 15:53:45 -04:00
|
|
|
foreach(d ${gt_src_list})
|
2012-06-15 11:19:11 -04:00
|
|
|
if(";${sources_${d}};" MATCHES ";(${name}\\.(c|s|si));")
|
2024-07-19 11:43:27 -04:00
|
|
|
set(fname ${CMAKE_MATCH_1})
|
|
|
|
set(src ${d}/${fname})
|
|
|
|
set("source_used_${fname}" 1)
|
|
|
|
list(APPEND sources_used ${source_dir_${d}}/${fname})
|
|
|
|
if(NOT "${libmumpsrestoreregex}" STREQUAL "")
|
|
|
|
if(";${name};" MATCHES ";(${libmumpsrestoreregex});")
|
|
|
|
set("source_used_${fname}" 0)
|
|
|
|
endif()
|
|
|
|
endif()
|
2012-06-15 11:19:11 -04:00
|
|
|
break()
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
if(src)
|
|
|
|
list(APPEND ${target}_SOURCES ${src})
|
|
|
|
else()
|
|
|
|
message(FATAL_ERROR "No source \"${name}\" available!")
|
|
|
|
endif()
|
2012-06-13 16:16:59 -04:00
|
|
|
endforeach()
|
2012-06-15 11:19:11 -04:00
|
|
|
endmacro()
|
2012-06-13 11:22:34 -04:00
|
|
|
|
2012-10-04 14:35:01 -04:00
|
|
|
# Macro like set_source_list but that loads the list of source file
|
|
|
|
# names from a file.
|
2012-06-15 11:19:11 -04:00
|
|
|
macro(load_source_list target listfile)
|
|
|
|
file(STRINGS "${listfile}" names)
|
|
|
|
set_source_list(${target} ${names})
|
|
|
|
endmacro()
|
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
|
2012-10-04 14:35:01 -04:00
|
|
|
# Assign sources to libraries.
|
2012-06-15 11:19:11 -04:00
|
|
|
load_source_list(libcmisockettcp sr_unix_gnp/libcmisockettcp.list)
|
|
|
|
load_source_list(libdbcertify sr_unix/libdbcertify.list)
|
|
|
|
load_source_list(libdse sr_unix/libdse.list)
|
|
|
|
load_source_list(libgnpclient sr_unix_gnp/libgnpclient.list)
|
|
|
|
load_source_list(libgnpserver sr_unix_gnp/libgnpserver.list)
|
|
|
|
load_source_list(libgtcm sr_unix_cm/libgtcm.list)
|
|
|
|
load_source_list(liblke sr_unix/liblke.list)
|
|
|
|
load_source_list(libmupip sr_unix/libmupip.list)
|
|
|
|
load_source_list(libstub sr_unix/libstub.list)
|
2024-07-19 11:43:27 -04:00
|
|
|
if("${CMAKE_SYSTEM_NAME}" STREQUAL "SunOS")
|
|
|
|
load_source_list(libgtmrpc sr_sun/libgtmrpc.list)
|
|
|
|
endif()
|
2012-06-15 11:19:11 -04:00
|
|
|
|
2012-10-04 14:35:01 -04:00
|
|
|
# Assign sources to executables.
|
2012-06-15 11:19:11 -04:00
|
|
|
set_source_list(gtm_threadgbl_deftypes gtm_threadgbl_deftypes)
|
|
|
|
set_source_list(dbcertify dbcertify dbcertify_cmd)
|
|
|
|
set_source_list(dse dse dse_cmd)
|
|
|
|
set_source_list(ftok ftok)
|
|
|
|
set_source_list(geteuid geteuid)
|
|
|
|
set_source_list(gtcm_gnp_server gtcm_gnp_server)
|
|
|
|
set_source_list(gtcm_pkdisp gtcm_pkdisp)
|
|
|
|
set_source_list(gtcm_play gtcm_play omi_srvc_xct)
|
|
|
|
set_source_list(gtcm_server gtcm_main omi_srvc_xct)
|
|
|
|
set_source_list(gtcm_shmclean gtcm_shmclean)
|
|
|
|
set_source_list(gtmsecshr gtmsecshr_wrapper)
|
|
|
|
set_source_list(gtmsecshr_real gtmsecshr)
|
|
|
|
set_source_list(libgtmcrypt gtmcrypt_ref gtmcrypt_pk_ref gtmcrypt_dbk_ref)
|
|
|
|
set_source_list(libgtmshr gtm_main)
|
|
|
|
set_source_list(lke lke lke_cmd)
|
|
|
|
set_source_list(maskpass maskpass)
|
|
|
|
set_source_list(mumps gtm)
|
|
|
|
set_source_list(mupip mupip mupip_cmd)
|
|
|
|
set_source_list(semstat2 semstat2)
|
2024-07-19 11:43:27 -04:00
|
|
|
if("${CMAKE_SYSTEM_NAME}" STREQUAL "SunOS")
|
|
|
|
set_source_list(gtm_svc gtm_svc gtm_rpc_init gtm_dal_svc)
|
|
|
|
endif()
|
2012-06-15 11:19:11 -04:00
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# libmumps gets leftover sources, so compute the remaining list.
|
2012-06-21 09:33:15 -04:00
|
|
|
set(source_used_dtgbldir.c 1) # exclude unused source
|
2012-06-15 11:19:11 -04:00
|
|
|
set(libmumps_SOURCES "")
|
2012-06-15 15:53:45 -04:00
|
|
|
foreach(d ${gt_src_list})
|
2012-06-15 11:19:11 -04:00
|
|
|
foreach(s ${sources_${d}})
|
|
|
|
if(NOT source_used_${s})
|
|
|
|
list(APPEND libmumps_SOURCES ${d}/${s})
|
|
|
|
set(source_used_${s} 1)
|
2012-10-04 08:19:45 -04:00
|
|
|
list(APPEND sources_used ${source_dir_${d}}/${s})
|
2012-06-15 11:19:11 -04:00
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
endforeach()
|
2012-06-21 09:33:15 -04:00
|
|
|
|
2012-10-04 07:13:38 -04:00
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# Generate files depending on gtm
|
|
|
|
|
|
|
|
# Copy generation routines to a working directory.
|
|
|
|
foreach(m chk2lev.m chkop.m gendash.m genout.m loadop.m loadvx.m msg.m tttgen.m tttscan.m)
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT gen/${m}
|
|
|
|
DEPENDS ${GTM_SOURCE_DIR}/sr_port/${m}
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy ${GTM_SOURCE_DIR}/sr_port/${m} ${GTM_BINARY_DIR}/gen/${m}
|
|
|
|
)
|
|
|
|
endforeach()
|
|
|
|
|
2024-07-19 11:43:27 -04:00
|
|
|
foreach(f ttt.txt opcode_def.h vxi.h)
|
|
|
|
select_file(src ${f})
|
|
|
|
list(APPEND tttfiles ${src})
|
|
|
|
endforeach()
|
|
|
|
set(mumps_ttt_args -run tttgen ${tttfiles})
|
2012-10-04 07:13:38 -04:00
|
|
|
add_custom_command(
|
|
|
|
OUTPUT gen/ttt.c
|
2024-07-19 11:43:27 -04:00
|
|
|
DEPENDS ${tttfiles}
|
2012-10-04 07:13:38 -04:00
|
|
|
gen/chk2lev.m gen/chkop.m gen/gendash.m gen/genout.m gen/loadop.m
|
|
|
|
gen/loadvx.m gen/tttgen.m gen/tttscan.m
|
2012-10-04 08:29:00 -04:00
|
|
|
${GTM_SOURCE_DIR}/sr_unix/mumps.cmake ${gen_bootstrap_depend}
|
2012-10-04 07:13:38 -04:00
|
|
|
WORKING_DIRECTORY ${GTM_BINARY_DIR}/gen
|
|
|
|
COMMAND ${CMAKE_COMMAND}
|
2012-10-04 08:29:00 -04:00
|
|
|
-D gtm_dist=${gen_bootstrap_dist}
|
2012-10-04 07:13:38 -04:00
|
|
|
-D gtmroutines=.
|
2012-10-04 08:29:00 -04:00
|
|
|
-D mumps=${gen_bootstrap_mumps}
|
2012-10-04 07:13:38 -04:00
|
|
|
-D "args=${mumps_ttt_args}"
|
|
|
|
-D output_file=ttt.log
|
|
|
|
-P ${GTM_SOURCE_DIR}/sr_unix/mumps.cmake
|
|
|
|
VERBATIM
|
|
|
|
)
|
|
|
|
list(APPEND gen_bootstrap_files gen/ttt.c)
|
|
|
|
|
2012-10-04 07:35:24 -04:00
|
|
|
set(gen_merrors_extra gen/merrors_ansi.h)
|
2012-10-04 07:13:38 -04:00
|
|
|
foreach(msg
|
|
|
|
sr_port/cmerrors.msg
|
|
|
|
sr_port/gdeerrors.msg
|
|
|
|
sr_port/merrors.msg
|
|
|
|
sr_unix_gnp/cmierrors.msg
|
|
|
|
)
|
|
|
|
get_filename_component(name ${msg} NAME_WE)
|
|
|
|
set(mumps_msg_args -run msg ${GTM_SOURCE_DIR}/${msg} unix)
|
2012-10-04 07:35:24 -04:00
|
|
|
set(outputs gen/${name}_ctl.c ${gen_${name}_extra})
|
2012-10-04 07:13:38 -04:00
|
|
|
add_custom_command(
|
2012-10-04 07:35:24 -04:00
|
|
|
OUTPUT ${outputs}
|
2012-10-04 07:13:38 -04:00
|
|
|
DEPENDS gen/msg.m ${GTM_SOURCE_DIR}/${msg}
|
2012-10-04 08:29:00 -04:00
|
|
|
${GTM_SOURCE_DIR}/sr_unix/mumps.cmake ${gen_bootstrap_depend}
|
2012-10-04 07:13:38 -04:00
|
|
|
WORKING_DIRECTORY ${GTM_BINARY_DIR}/gen
|
|
|
|
COMMAND ${CMAKE_COMMAND}
|
2012-10-04 08:29:00 -04:00
|
|
|
-D gtm_dist=${gen_bootstrap_dist}
|
2012-10-04 07:13:38 -04:00
|
|
|
-D gtmroutines=.
|
2012-10-04 08:29:00 -04:00
|
|
|
-D mumps=${gen_bootstrap_mumps}
|
2012-10-04 07:13:38 -04:00
|
|
|
-D "args=${mumps_msg_args}"
|
|
|
|
-P ${GTM_SOURCE_DIR}/sr_unix/mumps.cmake
|
|
|
|
VERBATIM
|
|
|
|
)
|
2012-10-04 07:35:24 -04:00
|
|
|
list(APPEND gen_bootstrap_files ${outputs})
|
2012-10-04 07:13:38 -04:00
|
|
|
endforeach()
|
|
|
|
|
|
|
|
add_custom_target(gen_bootstrap ALL DEPENDS ${gen_bootstrap_files})
|
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
|
2012-06-21 09:33:15 -04:00
|
|
|
if(gen_xfer_desc)
|
|
|
|
list(SORT sources_used)
|
|
|
|
set(CMAKE_CONFIGURABLE_FILE_CONTENT "")
|
|
|
|
foreach(src ${sources_used})
|
|
|
|
set(CMAKE_CONFIGURABLE_FILE_CONTENT "${CMAKE_CONFIGURABLE_FILE_CONTENT}${src}\n")
|
|
|
|
endforeach()
|
|
|
|
configure_file(${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in ${GTM_BINARY_DIR}/sources.list)
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT xfer_desc.i
|
|
|
|
WORKING_DIRECTORY ${GTM_BINARY_DIR}
|
|
|
|
DEPENDS ${GTM_SOURCE_DIR}/sr_unix/gen_xfer_desc.cmake
|
|
|
|
${GTM_BINARY_DIR}/sources.list
|
|
|
|
COMMAND ${CMAKE_COMMAND}
|
|
|
|
-D CMAKE_C_COMPILER=${CMAKE_C_COMPILER}
|
2024-07-19 11:43:27 -04:00
|
|
|
-D "arch=${arch}"
|
2012-06-21 09:33:15 -04:00
|
|
|
-D "includes=${includes}"
|
|
|
|
-P ${GTM_SOURCE_DIR}/sr_unix/gen_xfer_desc.cmake
|
|
|
|
VERBATIM
|
|
|
|
)
|
2012-06-21 11:02:44 -04:00
|
|
|
add_custom_target(gen_xfer_desc DEPENDS xfer_desc.i)
|
2012-10-04 08:29:00 -04:00
|
|
|
if(gen_bootstrap)
|
|
|
|
add_dependencies(gen_xfer_desc gen_bootstrap)
|
|
|
|
endif()
|
2012-06-21 09:33:15 -04:00
|
|
|
endif()
|
2012-06-13 11:22:34 -04:00
|
|
|
|
2012-06-15 11:19:11 -04:00
|
|
|
#-----------------------------------------------------------------------------
|
2012-06-14 08:47:20 -04:00
|
|
|
|
2012-06-15 11:19:11 -04:00
|
|
|
add_executable(gtm_threadgbl_deftypes ${gtm_threadgbl_deftypes_SOURCES})
|
2012-06-21 11:02:44 -04:00
|
|
|
if(gen_xfer_desc)
|
|
|
|
add_dependencies(gtm_threadgbl_deftypes gen_xfer_desc)
|
2012-10-04 08:29:00 -04:00
|
|
|
elseif(gen_bootstrap)
|
|
|
|
add_dependencies(gtm_threadgbl_deftypes gen_bootstrap)
|
2012-06-21 11:02:44 -04:00
|
|
|
endif()
|
2012-06-14 15:23:21 -04:00
|
|
|
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT gtm_threadgbl_deftypes.h
|
|
|
|
DEPENDS gtm_threadgbl_deftypes
|
|
|
|
COMMAND gtm_threadgbl_deftypes > gtm_threadgbl_deftypes.h.tmp
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E rename gtm_threadgbl_deftypes.h.tmp gtm_threadgbl_deftypes.h
|
|
|
|
)
|
|
|
|
add_custom_target(gen_gtm_threadgbl_deftypes DEPENDS gtm_threadgbl_deftypes.h)
|
|
|
|
|
2012-06-15 15:24:09 -04:00
|
|
|
foreach(exp exe shr)
|
|
|
|
set(out gtm${exp}_symbols.export)
|
|
|
|
set(in ${GTM_SOURCE_DIR}/sr_unix/gtm${exp}_symbols.exp)
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT ${out}
|
|
|
|
DEPENDS ${in}
|
|
|
|
COMMAND tcsh -f ${GTM_SOURCE_DIR}/sr_linux/genexport.csh ${in} ${out}
|
|
|
|
)
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
add_custom_target(gen_export DEPENDS gtmexe_symbols.export gtmshr_symbols.export)
|
|
|
|
|
2012-06-13 11:22:34 -04:00
|
|
|
foreach(lib
|
|
|
|
gtcm
|
|
|
|
cmisockettcp
|
|
|
|
gnpclient
|
|
|
|
gnpserver
|
|
|
|
dbcertify
|
|
|
|
dse
|
|
|
|
lke
|
|
|
|
mupip
|
|
|
|
stub
|
2012-06-13 14:11:21 -04:00
|
|
|
mumps
|
2024-07-19 11:43:27 -04:00
|
|
|
${extralibs}
|
2012-06-13 11:22:34 -04:00
|
|
|
)
|
2012-06-15 11:19:11 -04:00
|
|
|
add_library(lib${lib} STATIC ${lib${lib}_SOURCES})
|
2012-06-13 14:11:21 -04:00
|
|
|
set_property(TARGET lib${lib} PROPERTY OUTPUT_NAME ${lib})
|
2012-06-14 15:23:21 -04:00
|
|
|
add_dependencies(lib${lib} gen_gtm_threadgbl_deftypes)
|
2012-06-13 11:22:34 -04:00
|
|
|
endforeach()
|
2012-06-13 11:43:15 -04:00
|
|
|
|
2012-06-13 14:42:03 -04:00
|
|
|
# TODO: find_package or find_library for system libs?
|
2024-07-19 11:43:27 -04:00
|
|
|
include_directories ("/usr/local/include")
|
|
|
|
target_link_libraries(libmumps ${libmumpslibs})
|
2012-06-13 14:42:03 -04:00
|
|
|
|
2024-07-19 11:43:27 -04:00
|
|
|
add_executable(mumps ${mumps_SOURCES})
|
|
|
|
target_link_libraries(mumps libmumps)
|
2012-06-13 14:42:03 -04:00
|
|
|
|
2024-07-19 11:43:27 -04:00
|
|
|
add_executable(dse ${dse_SOURCES})
|
|
|
|
target_link_libraries(dse libdse libmumps libstub)
|
2012-06-13 14:42:03 -04:00
|
|
|
list(APPEND with_export dse)
|
|
|
|
|
2024-07-19 11:43:27 -04:00
|
|
|
add_executable(dbcertify ${dbcertify_SOURCES})
|
|
|
|
target_link_libraries(dbcertify libdbcertify libmupip libmumps libstub)
|
2012-06-15 11:19:11 -04:00
|
|
|
|
2024-07-19 11:43:27 -04:00
|
|
|
add_executable(geteuid ${geteuid_SOURCES})
|
2012-06-13 14:42:03 -04:00
|
|
|
|
2024-07-19 11:43:27 -04:00
|
|
|
add_executable(gtmsecshr ${gtmsecshr_SOURCES})
|
|
|
|
add_dependencies(gtmsecshr gen_gtm_threadgbl_deftypes)
|
2012-06-13 14:42:03 -04:00
|
|
|
|
2024-07-19 11:43:27 -04:00
|
|
|
add_executable(gtmsecshr_real ${gtmsecshr_real_SOURCES})
|
2012-06-13 14:42:03 -04:00
|
|
|
target_link_libraries(gtmsecshr_real libmumps)
|
|
|
|
set_target_properties(gtmsecshr_real PROPERTIES
|
|
|
|
OUTPUT_NAME gtmsecshr
|
|
|
|
RUNTIME_OUTPUT_DIRECTORY ${GTM_BINARY_DIR}/gtmsecshrdir
|
|
|
|
)
|
2024-07-19 11:43:27 -04:00
|
|
|
add_dependencies(gtmsecshr_real gen_gtm_threadgbl_deftypes)
|
2012-06-13 14:42:03 -04:00
|
|
|
|
2024-07-19 11:43:27 -04:00
|
|
|
add_executable(mupip ${mupip_SOURCES})
|
|
|
|
target_link_libraries(mupip libmupip libmumps libstub)
|
2012-06-13 14:42:03 -04:00
|
|
|
list(APPEND with_export mupip)
|
|
|
|
|
2024-07-19 11:43:27 -04:00
|
|
|
add_executable(lke ${lke_SOURCES})
|
|
|
|
target_link_libraries(lke liblke libmumps libgnpclient libmumps libgnpclient libcmisockettcp)
|
|
|
|
list(APPEND with_export lke)
|
2012-06-13 15:43:42 -04:00
|
|
|
|
2024-07-19 11:43:27 -04:00
|
|
|
|
|
|
|
add_executable(gtcm_server ${gtcm_server_SOURCES})
|
|
|
|
target_link_libraries(gtcm_server libgtcm libmumps libstub)
|
2012-07-03 16:48:55 -04:00
|
|
|
list(APPEND with_export gtcm_server)
|
2024-07-19 11:43:27 -04:00
|
|
|
|
|
|
|
add_executable(gtcm_gnp_server ${gtcm_gnp_server_SOURCES})
|
|
|
|
target_link_libraries(gtcm_gnp_server libgnpserver liblke libmumps libcmisockettcp libstub)
|
2012-07-03 16:48:55 -04:00
|
|
|
list(APPEND with_export gtcm_gnp_server)
|
2012-06-13 15:43:42 -04:00
|
|
|
|
2024-07-19 11:43:27 -04:00
|
|
|
add_executable(gtcm_play ${gtcm_play_SOURCES})
|
|
|
|
target_link_libraries(gtcm_play libgtcm libmumps libstub)
|
2012-07-03 16:48:55 -04:00
|
|
|
list(APPEND with_export gtcm_play)
|
2012-06-13 15:43:42 -04:00
|
|
|
|
2024-07-19 11:43:27 -04:00
|
|
|
add_executable(gtcm_pkdisp ${gtcm_pkdisp_SOURCES})
|
|
|
|
target_link_libraries(gtcm_pkdisp libgtcm libmumps libstub)
|
|
|
|
|
|
|
|
add_executable(gtcm_shmclean ${gtcm_shmclean_SOURCES})
|
|
|
|
target_link_libraries(gtcm_shmclean libgtcm libmumps libstub)
|
2012-06-13 15:43:42 -04:00
|
|
|
|
2024-07-19 11:43:27 -04:00
|
|
|
add_executable(semstat2 ${semstat2_SOURCES})
|
|
|
|
|
|
|
|
add_executable(ftok ${ftok_SOURCES})
|
|
|
|
target_link_libraries(ftok libmumps libstub)
|
|
|
|
|
|
|
|
if("${CMAKE_SYSTEM_NAME}" STREQUAL "SunOS")
|
|
|
|
add_executable(gtm_svc ${gtm_svc_SOURCES})
|
|
|
|
target_link_libraries(gtm_svc libmumps libgnpclient libcmisockettcp libgtmrpc)
|
|
|
|
endif()
|
2012-06-15 15:24:09 -04:00
|
|
|
foreach(t ${with_export})
|
2012-06-15 15:35:48 -04:00
|
|
|
set_target_properties(${t} PROPERTIES
|
2024-07-19 11:43:27 -04:00
|
|
|
LINK_FLAGS "${gtm_link}"
|
|
|
|
LINK_DEPENDS "${gtm_dep}"
|
2012-06-15 15:35:48 -04:00
|
|
|
)
|
2012-06-15 15:24:09 -04:00
|
|
|
add_dependencies(${t} gen_export)
|
|
|
|
endforeach()
|
2012-06-13 15:05:16 -04:00
|
|
|
|
2012-06-15 14:45:20 -04:00
|
|
|
add_library(libgtmshr MODULE ${libgtmshr_SOURCES})
|
2012-06-13 15:05:16 -04:00
|
|
|
set_property(TARGET libgtmshr PROPERTY OUTPUT_NAME gtmshr)
|
|
|
|
target_link_libraries(libgtmshr libmumps libgnpclient libcmisockettcp)
|
2012-06-15 15:35:48 -04:00
|
|
|
set_target_properties(libgtmshr PROPERTIES
|
2024-07-19 11:43:27 -04:00
|
|
|
LINK_FLAGS "${libgtmshr_link}"
|
|
|
|
LINK_DEPENDS "${libgtmshr_dep}"
|
2012-06-15 15:35:48 -04:00
|
|
|
)
|
2012-06-15 15:24:09 -04:00
|
|
|
add_dependencies(libgtmshr gen_export)
|
2012-06-15 14:45:20 -04:00
|
|
|
add_dependencies(mumps libgtmshr)
|
2012-06-13 15:05:16 -04:00
|
|
|
|
2024-07-19 11:43:27 -04:00
|
|
|
if(is_encryption_supported)
|
|
|
|
# Iterate over the list of GPG related libraries
|
|
|
|
foreach(gpglib gpg-error gpgme gcrypt)
|
|
|
|
# For each library, we need a new CMake variable, hence GPGLIB_${gpglib}
|
|
|
|
find_library(GPGLIB_${gpglib} NAME ${gpglib} PATHS ${CMAKE_LIBRARY_PATH})
|
|
|
|
# Append the found library to the list
|
|
|
|
set(GPG_LIBRARIES ${GPG_LIBRARIES} ${GPGLIB_${gpglib}})
|
|
|
|
endforeach()
|
2012-06-13 15:26:09 -04:00
|
|
|
|
2024-07-19 11:43:27 -04:00
|
|
|
add_library(libgtmcrypt MODULE ${libgtmcrypt_SOURCES})
|
|
|
|
set_target_properties(libgtmcrypt PROPERTIES
|
|
|
|
OUTPUT_NAME gtmcrypt
|
|
|
|
COMPILE_DEFINITIONS "USE_GCRYPT -DUSE_AES256CFB"
|
|
|
|
LIBRARY_OUTPUT_DIRECTORY ${GTM_BINARY_DIR}/plugin
|
2012-06-14 08:52:54 -04:00
|
|
|
)
|
2024-07-19 11:43:27 -04:00
|
|
|
target_link_libraries(libgtmcrypt ${GPG_LIBRARIES})
|
|
|
|
install(TARGETS libgtmcrypt DESTINATION ${GTM_INSTALL_DIR}/plugin)
|
|
|
|
|
|
|
|
add_executable(maskpass ${maskpass_SOURCES})
|
|
|
|
target_link_libraries(maskpass ${GPG_LIBRARIES})
|
|
|
|
set_target_properties(maskpass PROPERTIES
|
|
|
|
COMPILE_DEFINITIONS USE_GCRYPT
|
|
|
|
RUNTIME_OUTPUT_DIRECTORY ${GTM_BINARY_DIR}/plugin/gtmcrypt
|
2012-06-14 08:52:54 -04:00
|
|
|
)
|
2024-07-19 11:43:27 -04:00
|
|
|
install(TARGETS maskpass DESTINATION ${GTM_INSTALL_DIR}/plugin/gtmcrypt)
|
|
|
|
|
|
|
|
foreach(f
|
|
|
|
add_db_key.sh
|
|
|
|
build.sh
|
|
|
|
encrypt_sign_db_key.sh
|
|
|
|
gen_keypair.sh
|
|
|
|
gen_sym_hash.sh
|
|
|
|
gen_sym_key.sh
|
|
|
|
gtmcrypt.tab
|
|
|
|
gtmcrypt_dbk_ref.c
|
|
|
|
gtmcrypt_dbk_ref.h
|
|
|
|
gtmcrypt_interface.h
|
|
|
|
gtmcrypt_pk_ref.c
|
|
|
|
gtmcrypt_pk_ref.h
|
|
|
|
gtmcrypt_dbk_ref.c
|
|
|
|
gtmcrypt_dbk_ref.h
|
|
|
|
gtmcrypt_ref.c
|
|
|
|
gtmcrypt_ref.h
|
|
|
|
gtmcrypt_sym_ref.h
|
|
|
|
gtmxc_types.h
|
|
|
|
import_and_sign_key.sh
|
|
|
|
install.sh
|
|
|
|
maskpass.c
|
|
|
|
pinentry-gtm.sh
|
|
|
|
pinentry.m
|
|
|
|
pinentry.m
|
|
|
|
show_install_config.sh
|
|
|
|
)
|
|
|
|
set(f_in "${GTM_SOURCE_DIR}/sr_unix/${f}")
|
|
|
|
set(f_out "${GTM_BINARY_DIR}/plugin/gtmcrypt/${f}")
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT "${f_out}"
|
|
|
|
DEPENDS "${f_in}"
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy "${f_in}" "${f_out}"
|
|
|
|
)
|
|
|
|
if("${f}" MATCHES "\\.sh$")
|
|
|
|
set(permissions PERMISSIONS ${install_permissions_script})
|
|
|
|
else()
|
|
|
|
set(permissions "")
|
|
|
|
endif()
|
|
|
|
install(FILES "${f_out}" DESTINATION ${GTM_INSTALL_DIR}/plugin/gtmcrypt ${permissions})
|
|
|
|
list(APPEND files_to_place "${f_out}")
|
|
|
|
endforeach()
|
|
|
|
endif()
|
2012-06-14 08:52:54 -04:00
|
|
|
|
2012-06-13 14:42:03 -04:00
|
|
|
install(TARGETS
|
|
|
|
mumps
|
|
|
|
dse
|
2012-06-13 15:43:42 -04:00
|
|
|
lke
|
2012-06-13 19:48:12 -04:00
|
|
|
geteuid
|
2012-06-13 15:43:42 -04:00
|
|
|
gtcm_server
|
|
|
|
gtcm_gnp_server
|
|
|
|
gtcm_pkdisp
|
|
|
|
gtcm_play
|
|
|
|
gtcm_shmclean
|
|
|
|
semstat2
|
|
|
|
ftok
|
2012-06-13 14:42:03 -04:00
|
|
|
gtmsecshr
|
|
|
|
mupip
|
2012-06-13 15:05:16 -04:00
|
|
|
libgtmshr
|
2012-06-15 14:56:50 -04:00
|
|
|
DESTINATION ${GTM_INSTALL_DIR}
|
2012-06-13 14:42:03 -04:00
|
|
|
)
|
2012-06-15 14:56:50 -04:00
|
|
|
install(TARGETS gtmsecshr_real DESTINATION ${GTM_INSTALL_DIR}/gtmsecshrdir)
|
2012-06-13 14:11:21 -04:00
|
|
|
|
2012-06-13 16:04:53 -04:00
|
|
|
# <r>.m -> <R>.m
|
2012-06-18 09:20:30 -04:00
|
|
|
#file(GLOB m_files_sr_port RELATIVE ${GTM_SOURCE_DIR}/sr_port ${GTM_SOURCE_DIR}/sr_port/*.m)
|
|
|
|
set(m_files_sr_port
|
2012-06-14 10:12:57 -04:00
|
|
|
gde.m
|
2012-06-13 18:25:20 -04:00
|
|
|
gdeadd.m
|
|
|
|
gdechang.m
|
|
|
|
gdedelet.m
|
|
|
|
gdeexit.m
|
|
|
|
gdehelp.m
|
|
|
|
gdeinit.m
|
|
|
|
gdelocks.m
|
|
|
|
gdelog.m
|
|
|
|
gdemap.m
|
|
|
|
gdemsgin.m
|
|
|
|
gdeparse.m
|
|
|
|
gdequit.m
|
|
|
|
gderenam.m
|
|
|
|
gdescan.m
|
|
|
|
gdesetgd.m
|
|
|
|
gdeshow.m
|
|
|
|
gdespawn.m
|
|
|
|
gdetempl.m
|
|
|
|
)
|
2012-06-18 09:20:30 -04:00
|
|
|
file(GLOB m_files_sr_unix RELATIVE ${GTM_SOURCE_DIR}/sr_unix ${GTM_SOURCE_DIR}/sr_unix/*.m)
|
|
|
|
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)
|
|
|
|
|
2012-06-18 09:44:55 -04:00
|
|
|
set(gtm_chset_dir_ "")
|
|
|
|
set(gtm_chset_dir_UTF-8 "/utf8")
|
|
|
|
|
2012-06-18 09:20:30 -04:00
|
|
|
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")
|
2012-06-18 09:44:55 -04:00
|
|
|
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()
|
2012-06-18 09:20:30 -04:00
|
|
|
else()
|
|
|
|
set(m_out "${GTM_BINARY_DIR}/${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}"
|
|
|
|
)
|
|
|
|
install(FILES "${m_out}" DESTINATION ${GTM_INSTALL_DIR})
|
|
|
|
list(APPEND files_to_place "${m_out}")
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
foreach(m ${mpt_files_${d}})
|
|
|
|
string(TOUPPER "_${m}" m_upper)
|
|
|
|
string(REGEX REPLACE "MPT$" "m" m_out "${GTM_BINARY_DIR}/${m_upper}")
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT "${m_out}"
|
|
|
|
DEPENDS ${GTM_SOURCE_DIR}/${d}/${m}
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy ${GTM_SOURCE_DIR}/${d}/${m} "${m_out}"
|
|
|
|
)
|
2012-06-15 16:26:42 -04:00
|
|
|
install(FILES "${m_out}" DESTINATION ${GTM_INSTALL_DIR})
|
2012-06-18 09:20:30 -04:00
|
|
|
list(APPEND files_to_place "${m_out}")
|
|
|
|
endforeach()
|
2012-06-13 18:25:20 -04:00
|
|
|
endforeach()
|
|
|
|
|
2012-06-13 16:23:26 -04:00
|
|
|
set(files)
|
|
|
|
foreach(f
|
2012-06-14 10:12:57 -04:00
|
|
|
gtm_descript.h
|
|
|
|
gtm_limits.h
|
|
|
|
gtm_sizeof.h
|
2012-06-13 16:12:24 -04:00
|
|
|
gtm_stdio.h
|
|
|
|
gtm_stdlib.h
|
|
|
|
gtm_string.h
|
|
|
|
gtm_strings.h
|
2012-06-14 10:12:57 -04:00
|
|
|
gtmxc_types.h
|
2012-06-13 16:12:24 -04:00
|
|
|
main_pragma.h
|
2012-06-13 16:23:26 -04:00
|
|
|
arch.gtc
|
|
|
|
gtcm_run.gtc
|
|
|
|
gtcm_slist.gtc
|
|
|
|
gdedefaults.gtc
|
|
|
|
gtmcshrc.gtc
|
|
|
|
gtmprofile.gtc
|
|
|
|
gtmprofile_preV54000.gtc
|
|
|
|
gtmstart.gtc
|
|
|
|
gtmstop.gtc
|
|
|
|
dse.hlp
|
|
|
|
gde.hlp
|
|
|
|
lke.hlp
|
|
|
|
mumps.hlp
|
|
|
|
mupip.hlp
|
2024-07-19 11:43:27 -04:00
|
|
|
custom_errors_sample.txt
|
2012-06-13 16:12:24 -04:00
|
|
|
)
|
2012-06-15 11:24:31 -04:00
|
|
|
select_file(src ${f})
|
2012-06-13 16:23:26 -04:00
|
|
|
list(APPEND files ${src})
|
2012-06-13 16:12:24 -04:00
|
|
|
endforeach()
|
2012-06-15 14:56:50 -04:00
|
|
|
install(FILES ${files} DESTINATION ${GTM_INSTALL_DIR})
|
2012-06-13 16:12:24 -04:00
|
|
|
|
2012-06-15 17:05:45 -04:00
|
|
|
set(scripts)
|
|
|
|
foreach(f
|
|
|
|
gtm.gtc
|
|
|
|
gtmbase.gtc
|
|
|
|
)
|
|
|
|
select_file(src ${f})
|
|
|
|
list(APPEND scripts ${src})
|
|
|
|
endforeach()
|
|
|
|
install(FILES ${scripts}
|
|
|
|
DESTINATION ${GTM_INSTALL_DIR}
|
|
|
|
PERMISSIONS ${install_permissions_script}
|
|
|
|
)
|
|
|
|
|
2012-06-18 11:24:44 -04:00
|
|
|
find_program(ICUCONFIG NAMES icu-config)
|
|
|
|
if(ICUCONFIG)
|
|
|
|
execute_process(
|
|
|
|
COMMAND ${ICUCONFIG} --version
|
|
|
|
OUTPUT_VARIABLE icu_version
|
|
|
|
RESULT_VARIABLE icu_failed
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
|
|
)
|
|
|
|
if(icu_failed)
|
|
|
|
message(FATAL_ERROR "Command\n ${ICUCONFIG} --version\nfailed (${icu_failed}).")
|
|
|
|
elseif("x${icu_version}" MATCHES "^x([0-9]+\\.[0-9]+)")
|
|
|
|
set(gtm_icu_version "${CMAKE_MATCH_1}")
|
|
|
|
else()
|
|
|
|
message(FATAL_ERROR "Command\n ${ICUCONFIG} --version\nproduced unrecognized output:\n ${icu_version}")
|
|
|
|
endif()
|
|
|
|
else()
|
|
|
|
message(FATAL_ERROR "Unable to find 'icu-config'. Set ICUCONFIG in CMake cache.")
|
|
|
|
endif()
|
|
|
|
|
2012-06-20 16:29:27 -04:00
|
|
|
if (gtm_icu_version GREATER 10)
|
|
|
|
message("libicu version ${gtm_icu_version} > 10")
|
|
|
|
string(REGEX REPLACE "([0-9])([0-9]).*" "\\1.\\2" gtm_icu_version "${gtm_icu_version}")
|
|
|
|
message("Fixing gtm_icu_version to ${gtm_icu_version}.\nThis had better be the default")
|
|
|
|
endif()
|
|
|
|
|
2012-06-18 09:44:55 -04:00
|
|
|
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}
|
2012-06-18 13:36:35 -04:00
|
|
|
DEPENDS ${in} ${GTM_SOURCE_DIR}/sr_unix/mumps.cmake mumps
|
2012-06-18 09:44:55 -04:00
|
|
|
COMMAND ${CMAKE_COMMAND}
|
|
|
|
-D gtm_dist=${GTM_BINARY_DIR}
|
2012-06-19 11:33:54 -04:00
|
|
|
-D gtmroutines=.
|
2012-06-18 09:44:55 -04:00
|
|
|
-D gtm_chset=${gtm_chset}
|
2012-06-18 11:24:44 -04:00
|
|
|
-D gtm_icu_version=${gtm_icu_version}
|
2012-06-18 09:44:55 -04:00
|
|
|
-D mumps=$<TARGET_FILE: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()
|
2012-06-15 16:26:42 -04:00
|
|
|
endforeach()
|
|
|
|
|
2012-06-19 14:00:38 -04:00
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
set(gtm_hlp mumps.hlp)
|
|
|
|
set(gde_hlp gde.hlp)
|
2024-07-19 11:43:27 -04:00
|
|
|
set(mupip_hlp mupip.hlp)
|
|
|
|
set(dse_hlp dse.hlp)
|
|
|
|
set(lke_hlp lke.hlp)
|
|
|
|
foreach(help gtm gde mupip dse lke)
|
2012-06-19 14:00:38 -04:00
|
|
|
set(CMAKE_CONFIGURABLE_FILE_CONTENT
|
2012-06-19 14:39:39 -04:00
|
|
|
"Change -segment DEFAULT -block=2048 -file=\$gtm_dist/${help}help.dat
|
2012-06-19 14:00:38 -04:00
|
|
|
Change -region DEFAULT -record=1020 -key=255
|
|
|
|
exit")
|
|
|
|
configure_file(${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in
|
|
|
|
${GTM_BINARY_DIR}/${help}help.in1)
|
|
|
|
set(CMAKE_CONFIGURABLE_FILE_CONTENT
|
|
|
|
"Do ^GTMHLPLD
|
|
|
|
${GTM_SOURCE_DIR}/sr_port/${${help}_hlp}
|
|
|
|
Halt")
|
|
|
|
configure_file(${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in
|
|
|
|
${GTM_BINARY_DIR}/${help}help.in2)
|
|
|
|
set(env
|
|
|
|
-D gtm_dist=${GTM_BINARY_DIR}
|
|
|
|
-D gtmroutines=.
|
|
|
|
-D gtmgbldir=${GTM_BINARY_DIR}/${help}help
|
|
|
|
)
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT ${help}help.dat ${help}help.gld
|
|
|
|
DEPENDS ${GTM_SOURCE_DIR}/sr_unix/mumps.cmake mumps mupip
|
|
|
|
${GTM_BINARY_DIR}/${help}help.in1
|
|
|
|
${GTM_BINARY_DIR}/${help}help.in2
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E remove ${help}help.dat ${help}help.gld
|
|
|
|
COMMAND ${CMAKE_COMMAND} ${env}
|
|
|
|
-D mumps=$<TARGET_FILE:mumps> -D "args=-run;GDE"
|
|
|
|
-D input_file=${GTM_BINARY_DIR}/${help}help.in1
|
|
|
|
-P ${GTM_SOURCE_DIR}/sr_unix/mumps.cmake
|
|
|
|
COMMAND ${CMAKE_COMMAND} ${env}
|
|
|
|
-D mumps=$<TARGET_FILE:mupip> -D "args=create"
|
|
|
|
-P ${GTM_SOURCE_DIR}/sr_unix/mumps.cmake
|
|
|
|
COMMAND ${CMAKE_COMMAND} ${env}
|
|
|
|
-D mumps=$<TARGET_FILE:mumps> -D "args=-direct"
|
|
|
|
-D input_file=${GTM_BINARY_DIR}/${help}help.in2
|
|
|
|
-P ${GTM_SOURCE_DIR}/sr_unix/mumps.cmake
|
|
|
|
VERBATIM
|
|
|
|
)
|
2012-06-21 12:20:37 -04:00
|
|
|
list(APPEND files_to_place ${help}help.dat)
|
2012-06-19 14:00:38 -04:00
|
|
|
install(FILES ${GTM_BINARY_DIR}/${help}help.dat DESTINATION ${GTM_INSTALL_DIR})
|
|
|
|
endforeach()
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
|
2012-06-14 08:53:26 -04:00
|
|
|
set(GTM_TOP "${GTM_BINARY_DIR}")
|
2012-06-13 16:40:10 -04:00
|
|
|
configure_file(sr_unix/gpgagent.tab.in plugin/gpgagent.tab @ONLY)
|
2012-06-15 14:56:50 -04:00
|
|
|
set(GTM_TOP "${CMAKE_INSTALL_PREFIX}/${GTM_INSTALL_DIR}")
|
2012-06-14 08:53:26 -04:00
|
|
|
configure_file(sr_unix/gpgagent.tab.in CMakeFiles/plugin/gpgagent.tab @ONLY)
|
2012-06-15 14:56:50 -04:00
|
|
|
install(FILES ${GTM_BINARY_DIR}/CMakeFiles/plugin/gpgagent.tab DESTINATION ${GTM_INSTALL_DIR}/plugin)
|
2012-06-13 16:16:59 -04:00
|
|
|
|
2012-06-15 14:56:50 -04:00
|
|
|
install(FILES sr_unix/configure.gtc DESTINATION ${GTM_INSTALL_DIR}
|
2012-06-15 17:05:45 -04:00
|
|
|
PERMISSIONS ${install_permissions_script}
|
2012-06-14 09:17:52 -04:00
|
|
|
RENAME configure
|
|
|
|
)
|
|
|
|
|
2012-06-15 14:56:50 -04:00
|
|
|
install(FILES sr_unix/gtminstall.sh DESTINATION ${GTM_INSTALL_DIR}
|
2012-06-15 17:05:45 -04:00
|
|
|
PERMISSIONS ${install_permissions_script}
|
2012-06-14 10:13:07 -04:00
|
|
|
RENAME gtminstall
|
|
|
|
)
|
|
|
|
|
2012-06-15 14:56:50 -04:00
|
|
|
install(FILES sr_unix/lowerc_cp.sh DESTINATION ${GTM_INSTALL_DIR}
|
2012-06-14 09:59:48 -04:00
|
|
|
RENAME lowerc_cp
|
|
|
|
)
|
|
|
|
|
2012-06-15 14:56:50 -04:00
|
|
|
install(FILES COPYING DESTINATION ${GTM_INSTALL_DIR})
|
2012-06-14 09:59:48 -04:00
|
|
|
|
2012-06-13 16:51:04 -04:00
|
|
|
add_custom_target(place_files ALL DEPENDS ${files_to_place})
|
2024-07-19 11:43:27 -04:00
|
|
|
|