diff --git a/BEESRC/BTL_PRF/CDE/C/CMakeLists.txt b/BEESRC/BTL_PRF/CDE/C/CMakeLists.txt new file mode 100644 index 0000000..5f0bf4c --- /dev/null +++ b/BEESRC/BTL_PRF/CDE/C/CMakeLists.txt @@ -0,0 +1,15 @@ +add_library(BTL_PRF OBJECT + btl_prf_ffnc_ctx.c + btl_prf_ffnc_obj.c + prf_seq_stp_ffnc_ctx.c + prf_seq_stp_ffnc_obj.c + btl_proof_seq_ctx.c + btl_proof_seq_obj.c + btl_proof_str_ctx.c + btl_proof_str_obj.c + btl_proof_file_dump.c + btl_proof.c + btl_proofCtx.c +) +target_compile_definitions(BTL_PRF PUBLIC bmotif) +target_compile_options(BTL_PRF PUBLIC ${ALLOW_COMMON_FLAG}) diff --git a/BEESRC/CMakeLists.txt b/BEESRC/CMakeLists.txt new file mode 100644 index 0000000..05dce57 --- /dev/null +++ b/BEESRC/CMakeLists.txt @@ -0,0 +1,118 @@ +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) + +# Disambiguate files by creating separate include directories +set(B_CORE_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/include.B-Core) +set(BMOTIF_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/include.motif) +set(BPLATFORM_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/include.bplatform) + +add_subdirectory(BTL_PRF/CDE/C) + +# Copy files during configuration step +configure_file(itfmch.c.B-Core ${B_CORE_INCLUDE_DIR}/itfmch.c COPYONLY) +configure_file(natmch.c.B-Core ${B_CORE_INCLUDE_DIR}/natmch.c COPYONLY) +configure_file(filmch.c.B-Core ${B_CORE_INCLUDE_DIR}/filmch.c COPYONLY) +configure_file(themch.c.B-Core ${B_CORE_INCLUDE_DIR}/themch.c COPYONLY) +configure_file(prfmch.c.B-Core ${B_CORE_INCLUDE_DIR}/prfmch.c COPYONLY) +configure_file(tolmch.c.B-Core ${B_CORE_INCLUDE_DIR}/tolmch.c COPYONLY) +configure_file(symmch.c.B-Core ${B_CORE_INCLUDE_DIR}/symmch.c COPYONLY) +configure_file(strmch.c.B-Core ${B_CORE_INCLUDE_DIR}/strmch.c COPYONLY) +configure_file(lexmch.c.B-Core ${B_CORE_INCLUDE_DIR}/lexmch.c COPYONLY) +configure_file(frmmch.c.B-Core ${B_CORE_INCLUDE_DIR}/frmmch.c COPYONLY) +configure_file(errmch.c.B-Core ${B_CORE_INCLUDE_DIR}/errmch.c COPYONLY) +configure_file(macmch.c.B-Core ${B_CORE_INCLUDE_DIR}/macmch.c COPYONLY) +configure_file(rulmch.c.B-Core ${B_CORE_INCLUDE_DIR}/rulmch.c COPYONLY) +configure_file(resmch.c.B-Core ${B_CORE_INCLUDE_DIR}/resmch.c COPYONLY) +configure_file(hypmch.c.B-Core ${B_CORE_INCLUDE_DIR}/hypmch.c COPYONLY) +configure_file(tacmch.c.B-Core ${B_CORE_INCLUDE_DIR}/tacmch.c COPYONLY) +configure_file(nodmch.c.B-Core ${B_CORE_INCLUDE_DIR}/nodmch.c COPYONLY) +configure_file(golmch.c.B-Core ${B_CORE_INCLUDE_DIR}/golmch.c COPYONLY) +configure_file(seqmch.c.B-Core ${B_CORE_INCLUDE_DIR}/seqmch.c COPYONLY) + +add_executable(b + b.c +) + +target_include_directories(b PRIVATE ${B_CORE_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) + +# Copy files for BTool build +configure_file(itfmch.c.motif ${BMOTIF_INCLUDE_DIR}/itfmch.c COPYONLY) +configure_file(natmch.c.motif ${BMOTIF_INCLUDE_DIR}/natmch.c COPYONLY) +configure_file(filmch.c.motif ${BMOTIF_INCLUDE_DIR}/filmch.c COPYONLY) +configure_file(themch.c.motif ${BMOTIF_INCLUDE_DIR}/themch.c COPYONLY) +configure_file(prfmch.c.motif ${BMOTIF_INCLUDE_DIR}/prfmch.c COPYONLY) +configure_file(tolmch.c.motif ${BMOTIF_INCLUDE_DIR}/tolmch.c COPYONLY) +configure_file(symmch.c.motif ${BMOTIF_INCLUDE_DIR}/symmch.c COPYONLY) +configure_file(strmch.c.motif ${BMOTIF_INCLUDE_DIR}/strmch.c COPYONLY) +configure_file(lexmch.c.motif ${BMOTIF_INCLUDE_DIR}/lexmch.c COPYONLY) +configure_file(frmmch.c.motif ${BMOTIF_INCLUDE_DIR}/frmmch.c COPYONLY) +configure_file(errmch.c.motif ${BMOTIF_INCLUDE_DIR}/errmch.c COPYONLY) +configure_file(macmch.c.motif ${BMOTIF_INCLUDE_DIR}/macmch.c COPYONLY) +configure_file(rulmch.c.motif ${BMOTIF_INCLUDE_DIR}/rulmch.c COPYONLY) +configure_file(resmch.c.motif ${BMOTIF_INCLUDE_DIR}/resmch.c COPYONLY) +configure_file(hypmch.c.motif ${BMOTIF_INCLUDE_DIR}/hypmch.c COPYONLY) +configure_file(tacmch.c.motif ${BMOTIF_INCLUDE_DIR}/tacmch.c COPYONLY) +configure_file(nodmch.c.motif ${BMOTIF_INCLUDE_DIR}/nodmch.c COPYONLY) +configure_file(golmch.c.motif ${BMOTIF_INCLUDE_DIR}/golmch.c COPYONLY) +configure_file(seqmch.c.motif ${BMOTIF_INCLUDE_DIR}/seqmch.c COPYONLY) + +find_package(X11 REQUIRED) +find_package(Motif REQUIRED) +if (NOT X11_Xt_FOUND) + message(FATAL_ERROR "X Toolkit is required") +endif() + +add_executable(BTool + bmotif.c +) + +target_compile_definitions(BTool PUBLIC BTOOL_FLAG BTOOLM_FLAG) +target_include_directories(BTool PUBLIC ${BMOTIF_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${MOTIF_INCLUDE_DIR}) +target_link_libraries(BTool PUBLIC BToolkitlm_globals ${MOTIF_LIBRARIES} ${X11_LIBRARIES} ${X11_Xt_LIB} ${CUSERID_LIB}) + +# Copy symbol file +configure_file(SYMBOL ${BPLATFORM_BINARY_DIR}/SYMBOL COPYONLY) + +# Copy files for bplatform build (note the suffix is actually 'release') +configure_file(itfmch.c.release ${BPLATFORM_INCLUDE_DIR}/itfmch.c COPYONLY) +configure_file(natmch.c.release ${BPLATFORM_INCLUDE_DIR}/natmch.c COPYONLY) +configure_file(filmch.c.release ${BPLATFORM_INCLUDE_DIR}/filmch.c COPYONLY) +configure_file(themch.c.release ${BPLATFORM_INCLUDE_DIR}/themch.c COPYONLY) +configure_file(prfmch.c.release ${BPLATFORM_INCLUDE_DIR}/prfmch.c COPYONLY) +configure_file(tolmch.c.release ${BPLATFORM_INCLUDE_DIR}/tolmch.c COPYONLY) +configure_file(symmch.c.release ${BPLATFORM_INCLUDE_DIR}/symmch.c COPYONLY) +configure_file(strmch.c.release ${BPLATFORM_INCLUDE_DIR}/strmch.c COPYONLY) +configure_file(lexmch.c.release ${BPLATFORM_INCLUDE_DIR}/lexmch.c COPYONLY) +configure_file(frmmch.c.release ${BPLATFORM_INCLUDE_DIR}/frmmch.c COPYONLY) +configure_file(errmch.c.release ${BPLATFORM_INCLUDE_DIR}/errmch.c COPYONLY) +configure_file(macmch.c.release ${BPLATFORM_INCLUDE_DIR}/macmch.c COPYONLY) +configure_file(rulmch.c.release ${BPLATFORM_INCLUDE_DIR}/rulmch.c COPYONLY) +configure_file(resmch.c.release ${BPLATFORM_INCLUDE_DIR}/resmch.c COPYONLY) +configure_file(hypmch.c.release ${BPLATFORM_INCLUDE_DIR}/hypmch.c COPYONLY) +configure_file(tacmch.c.release ${BPLATFORM_INCLUDE_DIR}/tacmch.c COPYONLY) +configure_file(nodmch.c.release ${BPLATFORM_INCLUDE_DIR}/nodmch.c COPYONLY) +configure_file(golmch.c.release ${BPLATFORM_INCLUDE_DIR}/golmch.c COPYONLY) +configure_file(seqmch.c.release ${BPLATFORM_INCLUDE_DIR}/seqmch.c COPYONLY) + +add_executable(bplatform + bplatform.c +) +target_include_directories(bplatform PUBLIC ${BPLATFORM_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) +target_compile_definitions(bplatform PUBLIC bplatform) +set_target_properties(bplatform PROPERTIES + RUNTIME_OUTPUT_DIRECTORY ${BPLATFORM_BINARY_DIR} +) + +add_library(BM OBJECT + appmch.motif.c + motif.c + bmotif_sub.c + bmotif.c +) +target_compile_definitions(BM PUBLIC + bmotif + BTOOLKIT_FLAG + BTOOL_FLAG + BTOOLM_FLAG +) +target_include_directories(BM PUBLIC ${BMOTIF_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${MOTIF_INCLUDE_DIR}) +target_compile_options(BM PUBLIC ${ALLOW_COMMON_FLAG}) diff --git a/C/CMakeLists.txt b/C/CMakeLists.txt new file mode 100644 index 0000000..34f3434 --- /dev/null +++ b/C/CMakeLists.txt @@ -0,0 +1,81 @@ +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${BLIB_BINARY_DIR}) + +add_executable(BProcessInfo + BProcessInfo.c +) + +add_executable(BToolkit + BToolkit.c +) + +add_executable(BUnlock + BUnlock.c +) + +add_executable(BSession + BSession.c +) + +add_executable(CheckRenameLib + CheckRenameLib.c +) + +add_executable(CreHtml + CreHtml.c +) + +add_executable(CreHtmlc + CreHtmlc.c +) + +add_executable(Greplace + Greplace.c +) + +add_executable(LatexProofFilter + LatexProofFilter.c +) + +add_executable(CheckAnnot + Proof.c +) + +add_executable(WaitX + WaitX.c +) + +add_executable(Unix2Dos + Unix2Dos.c +) + +add_executable(Dos2Unix + Dos2Unix.c +) + +add_library(BToolkitlm_globals OBJECT + BToolkitlm_globals.c +) +target_compile_definitions(BToolkitlm_globals PUBLIC + BTOOL_FLAG + BTOOLM_FLAG +) + +if (BUILD_CUSERID) + add_library(cuserid OBJECT + cuserid.c + ) +endif() + +find_package(Motif REQUIRED) + +add_library(ClientSocket OBJECT + ClientSocket.c +) +target_compile_definitions(ClientSocket PUBLIC + bmotif + BTOOLKIT_FLAG + BTOOL_FLAG + BTOOLM_FLAG +) +target_include_directories(ClientSocket PUBLIC ${MOTIF_INCLUDE_DIR}) +target_compile_options(ClientSocket PUBLIC ${ALLOW_COMMON_FLAG}) diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..eddf312 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,73 @@ +cmake_minimum_required(VERSION 3.11) + +project(BToolkit + VERSION 6.0.4 + DESCRIPTION "The BToolkit, a toolkit supporting software development with the B-method." + LANGUAGES C +) + +# FIXME scripts set this unconditionally, may warrant some investigation +set(WITH_BSERVER ON CACHE BOOL "Build with BSERVER support" FORCE) + +# Test compiler flags +include(CheckCCompilerFlag) + +# TODO better flag dispatch? +# - Function/loop for repeated check and set? +# - Scripts set optimization levels differently for different files, is that +# needed with modern compilers (and especially with -pedantic)? + +CHECK_C_COMPILER_FLAG(-pedantic USE_PEDANTIC) +if(USE_PEDANTIC) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic") +endif() + +CHECK_C_COMPILER_FLAG(-pipe USE_PIPE) +if(USE_PIPE) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pipe") +endif() + +CHECK_C_COMPILER_FLAG(-fcommon USE_FCOMMON) +if(USE_FCOMMON) + set(ALLOW_COMMON_FLAG -fcommon) +endif() + +add_compile_definitions(RELEASE_VERSION) + +if(WITH_BSERVER) + add_compile_definitions(BSERVER_VERSION) +endif() + +# FIXME the scripts define a number of architectures, likely a lot of those +# would be hard to find and may not have a CMake port. Platform detection +# section attempts to deal with that one OS at a time, rather than porting all +# settings over to CMake + +if (CMAKE_SYSTEM_NAME STREQUAL "Linux") + set(BUILD_CUSERID OFF) + add_compile_definitions(linux _BSD_SOURCE POSIX_SOURCE LINUX_VERSION LINUX_SUB_VERSION) +else() + set(BUILD_CUSERID ON) + add_compile_definitions(UNKNOWN_VERSION UNKNOWN_SUB_VERSION) +endif() + +# Resolve what should be on link line for cuserid() +set(CUSERID_TARGET cuserid) +if (BUILD_CUSERID) + set(CUSERID_LIB ${CUSERID_TARGET}) +else() + set(CUSERID_LIB ${CUSERID_SYS_LIB}) +endif() + +# Binary directories +set(BPLATFORM_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/BPLAT) +set(BLIB_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/BLIB) + +add_subdirectory(C) +add_subdirectory(BEESRC) +add_subdirectory(SRC) +add_subdirectory(LEX) +add_subdirectory(MOTIF) +add_subdirectory(SCRIPTS) +add_subdirectory(LIB) + diff --git a/LEX/CMakeLists.txt b/LEX/CMakeLists.txt new file mode 100644 index 0000000..145f543 --- /dev/null +++ b/LEX/CMakeLists.txt @@ -0,0 +1,44 @@ +find_package(FLEX REQUIRED) +# TODO scripts try to increase input buffer sizes, but currently those +# variables are not found in the output + +# There is a number of identically built utilities +set(FLEX_UTILS + AFilter + DFilter + Deannot + Doc_Latexer + EFilter + IFilter + Latex_Index + NLFilter + Post_Latexer_0 + Pre_GML_0 + Pre_GML_1 + Pre_GML_2 + Pre_GML_3 + Pre_GML_4 + Pre_GML_5 + SFilter + TransCFilter + Html1 + Html2 + Html3 + Html4 + Html5 +) + +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${BLIB_BINARY_DIR}) + +# Repeat the same build steps +foreach(U IN LISTS FLEX_UTILS) + FLEX_TARGET(${U}C ${U}.lex ${CMAKE_CURRENT_BINARY_DIR}/${U}.c + COMPILE_FLAGS -n + ) + + add_executable(${U} + ${FLEX_${U}C_OUTPUTS} + ) + target_link_libraries(${U} PUBLIC ${FLEX_LIBRARIES}) +endforeach() + diff --git a/LIB/CMakeLists.txt b/LIB/CMakeLists.txt new file mode 100644 index 0000000..470075a --- /dev/null +++ b/LIB/CMakeLists.txt @@ -0,0 +1,125 @@ +# Copy standard library +# +# TODO this is likely better to be split into separate dirctories where every +# directory is copied verbatim instead of this custom process +# +# TODO script has more special cases (are those needed)?: +# - Optional "BOOSTER" set of files +# - What happens if BSERVER is not enabled? + +set(ANL_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ANL) +set(C_DIR ${CMAKE_CURRENT_SOURCE_DIR}/CDE/C) +set(CFG_DIR ${CMAKE_CURRENT_SOURCE_DIR}/CFG) +set(TYP_DIR ${CMAKE_CURRENT_SOURCE_DIR}/TYP) + +set(STD_LIB_NAMES + Bit_TYPE + Bit_TYPE_Ops + BitsNContext + Bool_TYPE + Bool_TYPE_Ops + Char_TYPE + Char_TYPE_Ops + Int_TYPE + Int_TYPE_Ops + Rename_Bit_String + Rename_File_io + Rename_Narr + Rename_Nfnc + Rename_Nseq + Rename_Nvar + Rename_SocketClient + Rename_SocketServer + Rename_SharedSocketServer + Rename_Timer + Rename_Varr + Rename_Vffnc + Rename_Vfnc + Rename_Vseq + Rename_Vvar + Rename_ffnc_ctx + Rename_ffnc_obj + Rename_file_dump + Rename_fnc_ctx + Rename_fnc_obj + Rename_fstr_ctx + Rename_fstr_obj + Rename_seq_ctx + Rename_seq_obj + Rename_set + Rename_set_ctx + Rename_set_obj + Rename_str_ctx + Rename_str_obj + Rename_token_io + Scalar_TYPE + Scalar_TYPE_Ops + String_TYPE + String_TYPE_Ops + basic_io + file_dump + system +) + +set(BSERVER_LIB_NAMES + IntegrityCheck +) + +if (WITH_BSERVER) + list(APPEND STD_LIB_NAMES ${BSERVER_LIB_NAMES}) +endif() + +# Copy standard library to binary directory +add_custom_target(copy-std-lib ALL) + +# TODO scipt also copies HTML help files, not sure that is necessary until install stage + +set(LIB_BINARY_DIR ${CMAKE_BINARY_DIR}/BLIB/LIB) +set(LIB_ANL_DIR ${LIB_BINARY_DIR}/ANL) +set(LIB_C_DIR ${LIB_BINARY_DIR}/CDE/C) +set(LIB_CFG_DIR ${LIB_BINARY_DIR}/CFG) +set(LIB_TYP_DIR ${LIB_BINARY_DIR}/TYP) + +foreach(S IN LISTS STD_LIB_NAMES) + add_custom_target(copy-std-lib-${S} DEPENDS + ${LIB_ANL_DIR}/${S}.mch.anl + ${LIB_C_DIR}/${S}.c + ${LIB_C_DIR}/${S}.g + ${LIB_C_DIR}/${S}.h + ${LIB_CFG_DIR}/${S}.mch + ${LIB_TYP_DIR}/${S}.mri.typ + ) + add_custom_command(OUTPUT ${LIB_ANL_DIR}/${S}.mch.anl + COMMAND ${CMAKE_COMMAND} -E copy ${ANL_DIR}/${S}.mch.anl ${LIB_ANL_DIR}/${S}.mch.anl + DEPENDS ${ANL_DIR}/${S}.mch.anl + ) + add_custom_command(OUTPUT ${LIB_C_DIR}/${S}.c + COMMAND ${CMAKE_COMMAND} -E copy ${C_DIR}/${S}.c ${LIB_C_DIR}/${S}.c + DEPENDS ${C_DIR}/${S}.c + ) + add_custom_command(OUTPUT ${LIB_C_DIR}/${S}.g + COMMAND ${CMAKE_COMMAND} -E copy ${C_DIR}/${S}.g ${LIB_C_DIR}/${S}.g + DEPENDS ${C_DIR}/${S}.g + ) + add_custom_command(OUTPUT ${LIB_C_DIR}/${S}.h + COMMAND ${CMAKE_COMMAND} -E copy ${C_DIR}/${S}.h ${LIB_C_DIR}/${S}.h + DEPENDS ${C_DIR}/${S}.h + ) + # .ldf files are only copied if they exist (see comment above about directories) + add_custom_command(TARGET copy-std-lib-${S} POST_BUILD + COMMAND ${CMAKE_COMMAND} + "-DSOURCE=${C_DIR}/${S}.ldf" + "-DDESTINATION=${LIB_C_DIR}" + -P ${CMAKE_SOURCE_DIR}/cmake/copy-if-exists.cmake + ) + add_custom_command(OUTPUT ${LIB_CFG_DIR}/${S}.mch + COMMAND ${CMAKE_COMMAND} -E copy ${CFG_DIR}/${S}.mch ${LIB_CFG_DIR}/${S}.mch + DEPENDS ${CFG_DIR}/${S}.mch + ) + add_custom_command(OUTPUT ${LIB_TYP_DIR}/${S}.mri.typ + COMMAND ${CMAKE_COMMAND} -E copy ${TYP_DIR}/${S}.mri.typ ${LIB_TYP_DIR}/${S}.mri.typ + DEPENDS ${TYP_DIR}/${S}.mri.typ + ) + add_dependencies(copy-std-lib copy-std-lib-${S}) +endforeach() + diff --git a/MOTIF/CFG_DEP_BASE/CDE/C/CMakeLists.txt b/MOTIF/CFG_DEP_BASE/CDE/C/CMakeLists.txt new file mode 100644 index 0000000..ad83bb1 --- /dev/null +++ b/MOTIF/CFG_DEP_BASE/CDE/C/CMakeLists.txt @@ -0,0 +1,24 @@ +add_library(CFG_DEP_BASE OBJECT + Abs2Conc_ffnc_obj.c + Bit_TYPE.c + Bool_TYPE.c + CfgDepBase.c + CfgDepBaseCtx.c + CfgDepBase_Vffnc.c + CfgDepBase_file_dump.c + CfgDepBase_seq_obj.c + CfgDepBase_set_obj.c + CfgDepBase_str_obj.c + CfgDepCtx.c + Construct_ffnc_obj.c + GENState_ffnc_obj.c + MRIState_ffnc_obj.c + Seqstr_ffnc_obj.c + String_ffnc_obj.c + Scalar_TYPE.c + String_TYPE.c + basic_io.c + file_dump.c +) +target_compile_definitions(CFG_DEP_BASE PUBLIC bmotif) + diff --git a/MOTIF/CMakeLists.txt b/MOTIF/CMakeLists.txt new file mode 100644 index 0000000..f441dc3 --- /dev/null +++ b/MOTIF/CMakeLists.txt @@ -0,0 +1,37 @@ +add_subdirectory(CFG_DEP_BASE/CDE/C) + +find_package(X11 REQUIRED) +find_package(Motif REQUIRED) +if (NOT X11_Xt_FOUND) + message(FATAL_ERROR "X Toolkit is required") +endif() + +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${BLIB_BINARY_DIR}) + +add_executable(BMotif + B_Motif.c + BMotif_globals.c + BMotif_browser.c + BMotif_fifo.c + BMotif_init.c + BMotif_io.c + BMotif_utils.c + BMotif_widgets.c + BMotif_displaystate.c +) + +target_compile_definitions(BMotif PUBLIC + bmotif + BTOOLKIT_FLAG + BTOOL_FLAG + BTOOLM_FLAG +) + +target_compile_options(BMotif PUBLIC ${ALLOW_COMMON_FLAG}) +target_include_directories(BMotif PUBLIC ${MOTIF_INCLUDE_DIR}) +target_link_libraries(BMotif PUBLIC BM ClientSocket BToolkitlm_globals CFG_DEP_BASE BTL_PRF ${MOTIF_LIBRARIES} ${X11_LIBRARIES} ${X11_Xt_LIB} ${CUSERID_LIB}) + +# Copy resource files +configure_file(BMotif.resources ${CMAKE_BINARY_DIR}/XBMotif COPYONLY) +configure_file(BMotif.resources.mono ${CMAKE_BINARY_DIR}/XBMotif.mono COPYONLY) + diff --git a/SCRIPTS/CMakeLists.txt b/SCRIPTS/CMakeLists.txt new file mode 100644 index 0000000..d8ca5cc --- /dev/null +++ b/SCRIPTS/CMakeLists.txt @@ -0,0 +1,40 @@ +set(SCRIPT_NAMES + BLatex + BRead + BTDECCO + Bkit.sty + Bbrowser + Beditor + Bnetscape + Bprintdvi + CheckFileDiff + CheckFileExists + ClearBerr + CreSLIBC + CreateCom + DispFile + ExportFile + FindFile + KillEditor + LIB_Addunderscore + LIB_Check + LIB_NoRename + LIB_Rename + LatexFile + LinkCFile + ExeFile + TransCFile +) +list(TRANSFORM SCRIPT_NAMES PREPEND ${BLIB_BINARY_DIR}/ OUTPUT_VARIABLE SCRIPT_DESTINATIONS) + +add_custom_target(copy-scripts ALL DEPENDS ${SCRIPT_DESTINATIONS}) + +foreach(S IN LISTS SCRIPT_NAMES) + set(IN_PATH ${CMAKE_CURRENT_SOURCE_DIR}/${S}) + set(OUT_PATH ${BLIB_BINARY_DIR}/${S}) + add_custom_command(OUTPUT ${OUT_PATH} + COMMAND ${CMAKE_COMMAND} -E copy ${IN_PATH} ${OUT_PATH} + DEPENDS ${IN_PATH} + ) +endforeach() + diff --git a/SRC/CMakeLists.txt b/SRC/CMakeLists.txt new file mode 100644 index 0000000..cd78702 --- /dev/null +++ b/SRC/CMakeLists.txt @@ -0,0 +1,3 @@ +# Copy symbol file +configure_file(AMNSYMBOL ${BPLATFORM_BINARY_DIR}/AMNSYMBOL COPYONLY) + diff --git a/cmake/copy-if-exists.cmake b/cmake/copy-if-exists.cmake new file mode 100644 index 0000000..afb6332 --- /dev/null +++ b/cmake/copy-if-exists.cmake @@ -0,0 +1,3 @@ +if(EXISTS "${SOURCE}") + file(COPY "${SOURCE}" DESTINATION "${DESTINATION}") +endif()