前提・実現したいこと
こんにちは。
Visual C++ 2008, MSYS2+MinGW, cmake version 3.8.0-rc4を使って、「リソーエディタ(RisohEditor)」というプログラムを作っています。いわゆるWin32開発用のリソースエディタというものです。
リソーエディタ
https://github.com/katahiromz/RisohEditor
そこで問題ですが、src/CMakeLists.txtに問題があって、
src/CMakeLists.txt
https://github.com/katahiromz/RisohEditor/blob/master/src/CMakeLists.txt
ソリューション「RisohEditor」のプロジェクト「RisohEditor」をビルドしたときに、自動的にカスタムターゲット「messagetables」を実行するようにしたいのですが、どうすればいいですか。
ターゲット「messagetables」は、このソリューションが含んでいる「mcdx」というプログラムが必要ですので、「messagetables」を実行する前に、プロジェクト「mcdx」をビルドする必要があります。
発生している問題・エラーメッセージ
1>------ すべてのリビルド開始: プロジェクト: ZERO_CHECK, 構成: Debug Win32 ------ 1>プロジェクト 'ZERO_CHECK'、構成 'Debug|Win32' の中間出力ファイルを削除しています。 1>Checking Build System 1>CMake does not need to re-run because C:/Users/katahiromz/Documents/DEV/RisohEditorProject/RisohEditor/CMakeFiles/generate.stamp is up-to-date. 1>CMake does not need to re-run because C:/Users/katahiromz/Documents/DEV/RisohEditorProject/RisohEditor/src/CMakeFiles/generate.stamp is up-to-date. 1>CMake does not need to re-run because C:/Users/katahiromz/Documents/DEV/RisohEditorProject/RisohEditor/tests/CMakeFiles/generate.stamp is up-to-date. 1>CMake does not need to re-run because C:/Users/katahiromz/Documents/DEV/RisohEditorProject/RisohEditor/mcdx/CMakeFiles/generate.stamp is up-to-date. 1>ビルドログは "file://c:\Users\katahiromz\Documents\DEV\RisohEditorProject\RisohEditor\ZERO_CHECK.dir\Debug\BuildLog.htm" に保存されました。 1>ZERO_CHECK - エラー 0、警告 0 2>------ すべてのリビルド開始: プロジェクト: RisohEditor, 構成: Debug Win32 ------ 2>プロジェクト 'RisohEditor'、構成 'Debug|Win32' の中間出力ファイルを削除しています。 2>Building Custom Rule C:/Users/katahiromz/Documents/DEV/RisohEditorProject/RisohEditor/src/CMakeLists.txt 2>CMake does not need to re-run because C:/Users/katahiromz/Documents/DEV/RisohEditorProject/RisohEditor/src/CMakeFiles/generate.stamp is up-to-date. 2>コンパイルしています... 2>Samples.cpp 2>RisohEditor.cpp 2>PackedDIB.cpp 2>コードを生成中... 2>リソースをコンパイルしています... 2>Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.1 2>Copyright (C) Microsoft Corporation. All rights reserved. 2>マニフェストをリソースにコンパイルしています... 2>Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.1 2>Copyright (C) Microsoft Corporation. All rights reserved. 2>リンクしています... 2>LINK : fatal error LNK1104: ファイル 'messagetables.res' を開くことができません。 2>ビルドログは "file://c:\Users\katahiromz\Documents\DEV\RisohEditorProject\RisohEditor\src\RisohEditor.dir\Debug\BuildLog.htm" に保存されました。 2>RisohEditor - エラー 1、警告 0 ========== すべてリビルド: 1 正常終了、1 失敗、0 スキップ ==========
見ての通り、「ファイル 'messagetables.res' を開くことができません。」というエラーメッセージが表示されます。
該当のソースコード
cmake
1# enable Win32 resource 2ENABLE_LANGUAGE(RC) 3 4# include directories 5include_directories(../include) 6 7# RisohEditor.exe 8add_executable(RisohEditor WIN32 9 PackedDIB.cpp 10 RisohEditor.cpp 11 Samples.cpp 12 RisohEditor_res.rc) 13target_link_libraries(RisohEditor comctl32 msimg32 winmm gdiplus vfw32) 14 15# messagetables.res 16add_custom_target(messagetables 17 mcdx RisohEditor_res.rc messagetables.res 18 DEPENDS mcdx 19 BYPRODUCTS messagetables.res 20 COMMENT [[ mcdx RisohEditor_res.rc messagetables.res ]] 21 VERBATIM) 22add_dependencies(RisohEditor messagetables) 23set_target_properties(RisohEditor PROPERTIES LINK_FLAGS messagetables.res) 24 25target_compile_definitions(RisohEditor PRIVATE -DUNICODE -D_UNICODE) 26 27# do statically link 28set_target_properties(RisohEditor PROPERTIES LINK_SEARCH_START_STATIC 1) 29set_target_properties(RisohEditor PROPERTIES LINK_SEARCH_END_STATIC 1)
試したこと
CMakeをトップディレクトリから実行して、生成されるソリューションをVisual C++ 2008で開いて、RisohEditorプロジェクトをビルド。src/CMakeLists.txtを何度編集しても成功せず。
補足情報
ファイル「messagetables.res」は、トップディレクトリの「build」の中に生成しなければいけません。
よろしくお願いします。
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/02/11 13:14
2018/02/11 13:18
2018/02/11 13:36