[cmake-developers] Creating Windows 7 manifests with mingw builds

Alexander Neundorf neundorf at kde.org
Thu Feb 21 13:07:52 EST 2013


Hi,

I learned that executables for Windows 7 need some manifest embedded, and that 
this works more or less automatically with CMake and MSVC.

I also learned that our (KDE's) Windows team wrote a tool to do the same when 
using mingw. It is a few kB of STL-only C++ code, and this macro:

macro (_KDE4_ADD_MANIFEST _target_NAME)
  get_target_property(_executable ${_target_NAME} LOCATION )

  set(_manifest ${CMAKE_CURRENT_LIST_DIR}/Win32.Manifest.in)
  add_custom_command(TARGET ${_target_NAME}
                     POST_BUILD
                     COMMAND ${KDE4_MT_EXECUTABLE}
                     ARGS -manifest ${_manifest}-updateresource:${_executable}
                     COMMENT "adding vista trustInfo manifest")
endmacro()


This macro is invoked in kde4_add_executable().

Now as you know we'd like to get rid of our custom stuff, and it seems to me 
that this is something which would make sense to have in cmake directly.

Does this sound reasonable ?
Or what solution do you use when creating executables with mingw for Windows 7 
?


Alex



More information about the cmake-developers mailing list