Warning, /education/step/step/data/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 find_package(Python3 COMPONENTS Interpreter)
0002 
0003 set(EXTRACTXML_EXECUTABLE ${CMAKE_CURRENT_SOURCE_DIR}/extractxml)
0004 
0005 if (TARGET Python3::Interpreter)
0006 
0007 
0008     macro(STEP_PROCESS_XML_TRANSLATION _lang _po_file _extractxml_args)
0009     set(_xmlfiles_tr)
0010     set(_args ${ARGN})
0011     set(_addToAll)
0012     set(_installDest)
0013 
0014     list(GET _args 0 _tmp)
0015     if("${_tmp}" STREQUAL "ALL")
0016         set(_addToAll ALL)
0017         list(REMOVE_AT _args 0)
0018     endif()
0019 
0020     list(GET _args 0 _tmp)
0021     if("${_tmp}" STREQUAL "INSTALL_DESTINATION")
0022         list(GET _args 1 _installDest )
0023         list(REMOVE_AT _args 0 1)
0024     endif()
0025 
0026     if(EXISTS ${_po_file})
0027         get_filename_component(_po_file_we ${_po_file} NAME_WE)
0028         set(_mo_file ${CMAKE_CURRENT_BINARY_DIR}/${_lang}/${_po_file_we}.mo)
0029         add_custom_command(OUTPUT ${_mo_file}
0030         COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_mo_file} ${_po_file}
0031         WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
0032         DEPENDS ${_po_file}
0033         )
0034 
0035         foreach(_xmlfile ${_args})
0036         get_filename_component(_xmlfile_basename ${_xmlfile} NAME)
0037         set(_xmlfile_tr ${CMAKE_CURRENT_BINARY_DIR}/${_lang}/${_xmlfile_basename})
0038         set(_extractxml_args_copy ${_extractxml_args})
0039         separate_arguments(_extractxml_args_copy)
0040         file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${_lang})
0041         add_custom_command(OUTPUT ${_xmlfile_tr}
0042             COMMAND ${Python3_EXECUTABLE} ${EXTRACTXML_EXECUTABLE} --translate --mo-file=${_mo_file} --output-dir=${CMAKE_CURRENT_BINARY_DIR}/${_lang} ${_extractxml_args_copy} ${_xmlfile}
0043             WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
0044             DEPENDS ${_xmlfile} ${_mo_file}
0045         )
0046         if(_installDest)
0047             install(FILES ${_xmlfile_tr} DESTINATION ${_installDest}/${_lang})
0048         endif()
0049         list(APPEND _xmlfiles_tr ${_xmlfile_tr})
0050         endforeach()
0051 
0052         get_filename_component(DirId ${CMAKE_CURRENT_SOURCE_DIR} NAME)
0053         string(REPLACE "@" "_" stripped_lang ${_lang})
0054         add_custom_target(${DirId}_${_po_file_we}_${stripped_lang}_xmlfiles_tr ${_addToAll} DEPENDS ${_xmlfiles_tr})
0055     endif()
0056     endmacro()
0057 
0058 else()
0059     message("Python executable NOT found - Step data translations will not be build")
0060     macro(STEP_PROCESS_XML_TRANSLATION)
0061     endmacro()
0062 endif()
0063 
0064 add_subdirectory(objectinfo)
0065 add_subdirectory(examples)
0066 add_subdirectory(tutorials)
0067