From 1b7b6328d19c9c93ae495902d8d0d8bac493f8ae Mon Sep 17 00:00:00 2001 From: Ingmar Rieger Date: Wed, 13 May 2026 08:27:02 +0200 Subject: [PATCH 1/2] Suggestion for fixing a build issue with ninja generator Using the ninja generator via CMake, as conan does for Windows builds, link & manifest addition are handled differently - aka. in separate steps - compared to Visual Studio generator. It seems that the VS generator adds the manifest parameter to the link command which passes it down - thus add_link_options - but the ninja generator creates a separate direct call to mt.exe which needs the manifest passed. So with just passing the generated file as a source file, CMake supposedly should handle both generators accordingly. Disclaimer: This change & commit message was manually done but prepared with input from Claude Opus 4.7 as I don't run Windows nor have much experience with the build specifics on Windows. --- apps/CMakeLists.txt | 7 ++++++- apps/bmxparse/CMakeLists.txt | 1 + apps/bmxtranswrap/CMakeLists.txt | 1 + apps/mxf2raw/CMakeLists.txt | 1 + apps/raw2bmx/CMakeLists.txt | 1 + 5 files changed, 10 insertions(+), 1 deletion(-) diff --git a/apps/CMakeLists.txt b/apps/CMakeLists.txt index e1b706dc..65f32754 100644 --- a/apps/CMakeLists.txt +++ b/apps/CMakeLists.txt @@ -8,7 +8,11 @@ if(MSVC) @ONLY ) - add_link_options("/MANIFEST:EMBED" "/MANIFESTINPUT:${CMAKE_CURRENT_BINARY_DIR}/bmx_windows.generated.manifest") + # CMake generates linking and manifest handling differently between Visual Studio & ninja + # build generators. So adding it as a source file instead of an explicit linking option, + # CMake should cover both cases the right way. + set(BMX_WIN_MANIFEST_SRC "${CMAKE_CURRENT_BINARY_DIR}/bmx_windows.generated.manifest") + #add_link_options("/MANIFEST:EMBED" "/MANIFESTINPUT:${CMAKE_CURRENT_BINARY_DIR}/bmx_windows.generated.manifest") # /manifest file is not found when incremental is enabled (default Debug build config), so we disable it. add_link_options("$<$:/INCREMENTAL:NO>") @@ -24,6 +28,7 @@ add_subdirectory(raw2bmx) add_executable(bmxtimecode bmxtimecode.cpp + ${BMX_WIN_MANIFEST_SRC} ) target_include_directories(bmxtimecode PRIVATE diff --git a/apps/bmxparse/CMakeLists.txt b/apps/bmxparse/CMakeLists.txt index 67ce2733..0b172d39 100644 --- a/apps/bmxparse/CMakeLists.txt +++ b/apps/bmxparse/CMakeLists.txt @@ -1,5 +1,6 @@ add_executable(bmxparse bmxparse.cpp + ${BMX_WIN_MANIFEST_SRC} ) target_include_directories(bmxparse PRIVATE diff --git a/apps/bmxtranswrap/CMakeLists.txt b/apps/bmxtranswrap/CMakeLists.txt index 0228a9b0..14ee2893 100644 --- a/apps/bmxtranswrap/CMakeLists.txt +++ b/apps/bmxtranswrap/CMakeLists.txt @@ -1,6 +1,7 @@ add_executable(bmxtranswrap bmxtranswrap.cpp MXFInputTrack.cpp + ${BMX_WIN_MANIFEST_SRC} ) target_include_directories(bmxtranswrap PRIVATE diff --git a/apps/mxf2raw/CMakeLists.txt b/apps/mxf2raw/CMakeLists.txt index 7d4f7c1d..7bd04244 100644 --- a/apps/mxf2raw/CMakeLists.txt +++ b/apps/mxf2raw/CMakeLists.txt @@ -5,6 +5,7 @@ add_executable(mxf2raw AvidInfoOutput.cpp mxf2raw.cpp OutputFileManager.cpp + ${BMX_WIN_MANIFEST_SRC} ) target_include_directories(mxf2raw PRIVATE diff --git a/apps/raw2bmx/CMakeLists.txt b/apps/raw2bmx/CMakeLists.txt index fda149e7..c2f09392 100644 --- a/apps/raw2bmx/CMakeLists.txt +++ b/apps/raw2bmx/CMakeLists.txt @@ -1,6 +1,7 @@ add_executable(raw2bmx raw2bmx.cpp RawInputTrack.cpp + ${BMX_WIN_MANIFEST_SRC} ) target_include_directories(raw2bmx PRIVATE From 8bf326dd360815f393294a62c24c91ba6cb53362 Mon Sep 17 00:00:00 2001 From: haraldjordan Date: Thu, 28 May 2026 14:41:36 +0200 Subject: [PATCH 2/2] Update apps/CMakeLists.txt No need to leave the old line there as comment --- apps/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/CMakeLists.txt b/apps/CMakeLists.txt index 65f32754..e24788a9 100644 --- a/apps/CMakeLists.txt +++ b/apps/CMakeLists.txt @@ -12,7 +12,6 @@ if(MSVC) # build generators. So adding it as a source file instead of an explicit linking option, # CMake should cover both cases the right way. set(BMX_WIN_MANIFEST_SRC "${CMAKE_CURRENT_BINARY_DIR}/bmx_windows.generated.manifest") - #add_link_options("/MANIFEST:EMBED" "/MANIFESTINPUT:${CMAKE_CURRENT_BINARY_DIR}/bmx_windows.generated.manifest") # /manifest file is not found when incremental is enabled (default Debug build config), so we disable it. add_link_options("$<$:/INCREMENTAL:NO>")