Am Dienstag, 18. Juni 2019, 23:42:19 CEST schrieb Richard Kimberly Heck:
> commit 446769203f157ef5ff964e6d7355f840c8c91cac
> Author: Richard Kimberly Heck <rikih...@lyx.org>
> Date:   Tue Jun 18 17:50:19 2019 -0400
> 
>     Use data from src/lyxwinres.rc to generate lyx.coff for the Windows
>     build.
>     
>     Ideally, this would be done by cmake itself (as it is now done by
>     autotools). But I do not know how to do that.
> -

Something like following ... alas I cannot test. For sure, I don't know the 
value of "${CPP}"

        Kornel

file(GLOB _icofiles RELATIVE "${TOP_SRC_DIR}/development/Win32/packaging/icons" 
"${TOP_SRC_DIR}/development/Win32/packaging/icons/lyx_*32x32.ico")
set(_dep_icofiles)
foreach(_f ${_icofiles})
  add_custom_command(
    OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${_f}"
    COMMAND ${CMAKE_COMMAND} -E copy_if_different 
"${TOP_SRC_DIR}/development/Win32/packaging/icons/${_f}" 
"${CMAKE_CURRENT_BINARY_DIR}/${_f}"
    DEPFILE "${TOP_SRC_DIR}/development/Win32/packaging/icons/${_f}")
  list(APPEND _dep_icofiles 
"${TOP_SRC_DIR}/development/Win32/packaging/icons/${_f}")
endforeach()

add_cusom_command(
  OUTPUT lyxwinres.o
  COMMAND windres "-I${CMAKE_CURRENT_BINARY_DIR}" --preprocessor "${CPP} 
-xc-header -DRC_INVOKED" lyxwinres.rc -o lyxwinres.o
  DEPENDS ${_dep_icofiles})

add_executable(lyxeditor lyxeditor.c)
add_executable(lyxwin lyxwin.c lyxwinres.o)
lyx_target_link_libraries(lyxeditor -mwindows)
lyx_target_link_libraries(lyxwin -mwindows)

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to