You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
bibletime/bibletime/display-templates/CMakeLists.txt

31 lines
1.1 KiB

##### template-init.cpp (generated)
file( READ "names.conf" TEMPLATE_NAMES )
string( REGEX REPLACE "\n" ";" TEMPLATE_NAMES "${TEMPLATE_NAMES}" )
list( SORT TEMPLATE_NAMES )
file( WRITE ${CMAKE_CURRENT_BINARY_DIR}/template-init.cpp
"void CDisplayTemplateMgr::init() {\n"
)
foreach( TEMPLATE_INFO IN LISTS TEMPLATE_NAMES )
string( REGEX REPLACE "^([^ \t]*)[ \t]+(.*)" "\\1" TEMPLATE_FILE "${TEMPLATE_INFO}" )
string( REGEX REPLACE "^([^ \t]*)[ \t]+(.*)" "\\2" TEMPLATE_NAME "${TEMPLATE_INFO}" )
if( NOT "${TEMPLATE_FILE}" STREQUAL "" )
file( READ ${TEMPLATE_FILE} TEMPLATE_CONTENT )
string( REGEX REPLACE "\n+$" "\n" TEMPLATE_CONTENT "${TEMPLATE_CONTENT}\n" )
string( REGEX REPLACE "\"" "\\\\\"" TEMPLATE_CONTENT "${TEMPLATE_CONTENT}" )
string( REGEX REPLACE "\n" "\\\\\n" TEMPLATE_CONTENT "${TEMPLATE_CONTENT}" )
string( REGEX REPLACE "[ \t]+" " " TEMPLATE_CONTENT "${TEMPLATE_CONTENT}" )
file( APPEND ${CMAKE_CURRENT_BINARY_DIR}/template-init.cpp
"\tm_templateMap[ i18n(\"${TEMPLATE_NAME}\") ] = \"${TEMPLATE_CONTENT}\";\n"
)
endif()
endforeach()
file( APPEND ${CMAKE_CURRENT_BINARY_DIR}/template-init.cpp
"}\n"
)