mirror of
https://github.com/chris2511/xca.git
synced 2026-09-14 11:06:19 +05:00
instead of add_subdirectory() them.
in all subdirectories set ${S} and ${D}
as shortcuts for CMAKE_CURRENT_SOURCE_DIR
and CMAKE_CURRENT_BINARY_DIR
21 lines
558 B
CMake
21 lines
558 B
CMake
|
|
if (FILE AND SRC AND DST)
|
|
if (APPLE)
|
|
set(DIR_HINT "HOME/Library/Application Support/data/xca/${FILE}.txt")
|
|
elseif (WIN32)
|
|
set(DIR_HINT "PROFILE\\Application Data\\xca\\${FILE}.txt")
|
|
else()
|
|
set(DIR_HINT "/usr/local/share/xca/${FILE}.txt or HOME/.local/share/xca/${FILE}.txt")
|
|
endif()
|
|
|
|
file(READ "${SRC}/preamble.txt" PREAMBLE)
|
|
file(READ "${SRC}/${FILE}.text" CONT)
|
|
file(WRITE "${DST}/${FILE}.txt"
|
|
${PREAMBLE} "\n# "
|
|
${DIR_HINT} "\n"
|
|
${CONT})
|
|
else()
|
|
message(FATAL_ERROR "Mandatory FILE or SRC variable not defined")
|
|
endif()
|
|
|