File: Library.cmake

package info (click to toggle)
therion 6.3.4-2
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 15,544 kB
  • sloc: cpp: 195,273; tcl: 19,779; ansic: 8,434; perl: 1,895; makefile: 1,281; python: 255; asm: 219; sh: 104
file content (15 lines) | stat: -rw-r--r-- 586 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# run therion to generate source code for thlibrarydata.cxx
execute_process(
    COMMAND ${THERION} --print-library-src thlibrarydata.thcfg
    OUTPUT_VARIABLE LIBRARY_LOG
    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})

# find start of source file in the therion log
string(FIND "${LIBRARY_LOG}" "/**" CXX_START)
if (${CXX_START} EQUAL -1)
    message(FATAL_ERROR "thlibrarydata.cxx generation failed")
endif()
string(SUBSTRING "${LIBRARY_LOG}" ${CXX_START} -1 LIBRARY_LOG)

# write generated CXX source to the source file
file(WRITE ${CMAKE_SOURCE_DIR}/thlibrarydata.cxx "${LIBRARY_LOG}")