From 4b67338a7f211161019cb41457648f9e62a3d3ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Wed, 28 Sep 2016 23:20:20 +0000 Subject: [PATCH] [REACTOS]: Do not gather all the generated message resource files in the same directory (sdk/include/reactos/), so that to avoid potential file collisions, but instead place them into their respective per-target directories. CORE-12062 #resolve [RAPPS_NEW]: Fix rapps_new message header & resource files inclusion. [ROSTESTS]: Adjust the CMakeLists files in accordance. svn path=/trunk/; revision=72846 --- reactos/CMakeLists.txt | 1 + reactos/base/applications/rapps_new/rapps.h | 2 +- reactos/base/applications/rapps_new/rapps.rc | 2 +- reactos/dll/win32/iologmsg/CMakeLists.txt | 1 - reactos/dll/win32/netevent/CMakeLists.txt | 3 +-- .../win32/netevent/{netevt.rc => netevent.rc} | 0 reactos/sdk/cmake/CMakeMacros.cmake | 26 +++++++++---------- reactos/sdk/cmake/gcc.cmake | 2 +- reactos/sdk/cmake/msvc.cmake | 2 +- rostests/rosautotest/CMakeLists.txt | 2 +- .../win32/advapi32/eventlog/CMakeLists.txt | 18 +++++-------- 11 files changed, 27 insertions(+), 32 deletions(-) rename reactos/dll/win32/netevent/{netevt.rc => netevent.rc} (100%) diff --git a/reactos/CMakeLists.txt b/reactos/CMakeLists.txt index 00d32a747dd..78c9ae02988 100644 --- a/reactos/CMakeLists.txt +++ b/reactos/CMakeLists.txt @@ -235,6 +235,7 @@ else() ${REACTOS_BINARY_DIR}/sdk/include/dxsdk ${REACTOS_BINARY_DIR}/sdk/include/ddk ${REACTOS_BINARY_DIR}/sdk/include/reactos + ${REACTOS_BINARY_DIR}/sdk/include/reactos/mc sdk/include/crt sdk/include/ddk sdk/include/ndk diff --git a/reactos/base/applications/rapps_new/rapps.h b/reactos/base/applications/rapps_new/rapps.h index 539f3c3bfd6..628378a49df 100644 --- a/reactos/base/applications/rapps_new/rapps.h +++ b/reactos/base/applications/rapps_new/rapps.h @@ -24,7 +24,7 @@ #include #include -#include +#include #include "resource.h" diff --git a/reactos/base/applications/rapps_new/rapps.rc b/reactos/base/applications/rapps_new/rapps.rc index 0ebbd61e75d..33e363467ae 100644 --- a/reactos/base/applications/rapps_new/rapps.rc +++ b/reactos/base/applications/rapps_new/rapps.rc @@ -52,7 +52,7 @@ HOTKEYS ACCELERATORS #include -#include +#include /* UTF-8 */ #pragma code_page(65001) diff --git a/reactos/dll/win32/iologmsg/CMakeLists.txt b/reactos/dll/win32/iologmsg/CMakeLists.txt index 473eebe5f1e..1a9b2de7919 100644 --- a/reactos/dll/win32/iologmsg/CMakeLists.txt +++ b/reactos/dll/win32/iologmsg/CMakeLists.txt @@ -1,5 +1,4 @@ -include_directories(${REACTOS_BINARY_DIR}/sdk/include/reactos) add_library(iologmsg SHARED iologmsg.rc) set_module_type(iologmsg module UNICODE) add_dependencies(iologmsg ntiologc) diff --git a/reactos/dll/win32/netevent/CMakeLists.txt b/reactos/dll/win32/netevent/CMakeLists.txt index e982d6e8a5d..20a6b8bc023 100644 --- a/reactos/dll/win32/netevent/CMakeLists.txt +++ b/reactos/dll/win32/netevent/CMakeLists.txt @@ -1,6 +1,5 @@ -include_directories(${REACTOS_BINARY_DIR}/sdk/include/reactos) -add_library(netevent SHARED netevt.rc) +add_library(netevent SHARED netevent.rc) set_module_type(netevent module UNICODE) add_dependencies(netevent neteventmsg) add_cd_file(TARGET netevent DESTINATION reactos/system32 FOR all) diff --git a/reactos/dll/win32/netevent/netevt.rc b/reactos/dll/win32/netevent/netevent.rc similarity index 100% rename from reactos/dll/win32/netevent/netevt.rc rename to reactos/dll/win32/netevent/netevent.rc diff --git a/reactos/sdk/cmake/CMakeMacros.cmake b/reactos/sdk/cmake/CMakeMacros.cmake index 876a713dccc..3ef19d77f95 100644 --- a/reactos/sdk/cmake/CMakeMacros.cmake +++ b/reactos/sdk/cmake/CMakeMacros.cmake @@ -113,23 +113,23 @@ function(add_message_headers _type) else() set(_flag "-A") endif() - foreach(_in_FILE ${ARGN}) - get_filename_component(FILE ${_in_FILE} NAME_WE) - set(_converted_item ${REACTOS_BINARY_DIR}/sdk/include/reactos/mc/${FILE}.mc) - set(_source_item ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}.mc) + foreach(_file ${ARGN}) + get_filename_component(_file_name ${_file} NAME_WE) + set(_converted_file ${CMAKE_CURRENT_BINARY_DIR}/${_file}) ## ${_file_name}.mc + set(_source_file ${CMAKE_CURRENT_SOURCE_DIR}/${_file}) ## ${_file_name}.mc add_custom_command( - OUTPUT "${_converted_item}" - COMMAND native-utf16le "${_source_item}" "${_converted_item}" "nobom" - DEPENDS native-utf16le "${_source_item}") - macro_mc(${_flag} ${FILE}) + OUTPUT "${_converted_file}" + COMMAND native-utf16le "${_source_file}" "${_converted_file}" nobom + DEPENDS native-utf16le "${_source_file}") + macro_mc(${_flag} ${_converted_file}) add_custom_command( - OUTPUT ${REACTOS_BINARY_DIR}/sdk/include/reactos/${FILE}.rc ${REACTOS_BINARY_DIR}/sdk/include/reactos/${FILE}.h - COMMAND ${COMMAND_MC} ${MC_FLAGS} - DEPENDS "${_converted_item}") + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_file_name}.h ${CMAKE_CURRENT_BINARY_DIR}/${_file_name}.rc + COMMAND ${COMMAND_MC} + DEPENDS "${_converted_file}") set_source_files_properties( - ${REACTOS_BINARY_DIR}/sdk/include/reactos/${FILE}.h ${REACTOS_BINARY_DIR}/sdk/include/reactos/${FILE}.rc + ${CMAKE_CURRENT_BINARY_DIR}/${_file_name}.h ${CMAKE_CURRENT_BINARY_DIR}/${_file_name}.rc PROPERTIES GENERATED TRUE) - add_custom_target(${FILE} ALL DEPENDS ${REACTOS_BINARY_DIR}/sdk/include/reactos/${FILE}.h ${REACTOS_BINARY_DIR}/sdk/include/reactos/${FILE}.rc) + add_custom_target(${_file_name} ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_file_name}.h ${CMAKE_CURRENT_BINARY_DIR}/${_file_name}.rc) endforeach() endfunction() diff --git a/reactos/sdk/cmake/gcc.cmake b/reactos/sdk/cmake/gcc.cmake index 164b9b6c59b..a430317900c 100644 --- a/reactos/sdk/cmake/gcc.cmake +++ b/reactos/sdk/cmake/gcc.cmake @@ -379,7 +379,7 @@ function(spec2def _dllname _spec_file) endfunction() macro(macro_mc FLAG FILE) - set(COMMAND_MC ${CMAKE_MC_COMPILER} -u ${FLAG} -b ${REACTOS_BINARY_DIR}/sdk/include/reactos/mc/${FILE}.mc -r ${REACTOS_BINARY_DIR}/sdk/include/reactos -h ${REACTOS_BINARY_DIR}/sdk/include/reactos) + set(COMMAND_MC ${CMAKE_MC_COMPILER} -u ${FLAG} -b -h ${CMAKE_CURRENT_BINARY_DIR}/ -r ${CMAKE_CURRENT_BINARY_DIR}/ ${FILE}) endmacro() # PSEH lib, needed with mingw diff --git a/reactos/sdk/cmake/msvc.cmake b/reactos/sdk/cmake/msvc.cmake index 80183e9dc1e..d912da4012f 100644 --- a/reactos/sdk/cmake/msvc.cmake +++ b/reactos/sdk/cmake/msvc.cmake @@ -374,7 +374,7 @@ function(spec2def _dllname _spec_file) endfunction() macro(macro_mc FLAG FILE) - set(COMMAND_MC ${CMAKE_MC_COMPILER} ${FLAG} -b ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}.mc -r ${REACTOS_BINARY_DIR}/sdk/include/reactos -h ${REACTOS_BINARY_DIR}/sdk/include/reactos) + set(COMMAND_MC ${CMAKE_MC_COMPILER} -u ${FLAG} -b -h ${CMAKE_CURRENT_BINARY_DIR}/ -r ${CMAKE_CURRENT_BINARY_DIR}/ ${FILE}) endmacro() # PSEH workaround diff --git a/rostests/rosautotest/CMakeLists.txt b/rostests/rosautotest/CMakeLists.txt index 05cf7ec8d2d..dc1403010cb 100644 --- a/rostests/rosautotest/CMakeLists.txt +++ b/rostests/rosautotest/CMakeLists.txt @@ -22,7 +22,7 @@ list(APPEND SOURCE tools.cpp precomp.h) -add_executable(rosautotest ${SOURCE} ${REACTOS_BINARY_DIR}/sdk/include/reactos/rosautotestmsg.rc) +add_executable(rosautotest ${SOURCE} ${CMAKE_CURRENT_BINARY_DIR}/rosautotestmsg.rc) set_module_type(rosautotest win32cui UNICODE) add_importlibs(rosautotest advapi32 shell32 user32 wininet msvcrt kernel32 ntdll) add_pch(rosautotest precomp.h SOURCE) diff --git a/rostests/win32/advapi32/eventlog/CMakeLists.txt b/rostests/win32/advapi32/eventlog/CMakeLists.txt index 13288348873..34e0dd884cb 100644 --- a/rostests/win32/advapi32/eventlog/CMakeLists.txt +++ b/rostests/win32/advapi32/eventlog/CMakeLists.txt @@ -3,19 +3,15 @@ ## rc /fo $(IntDir)MyEventProvider.res MyEventProvider.rc ## link /dll /noentry /SUBSYSTEM:CONSOLE",5.0" /out:$(SolutionDir)$(Configuration)\MyEventProvider.dll $(IntDir)MyEventProvider.res -## add_message_headers(UNICODE MyEventProvider.mc) - -add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/MyEventProvider.rc ${CMAKE_CURRENT_BINARY_DIR}/MyEventProvider.h - COMMAND ${CMAKE_MC_COMPILER} -U ${CMAKE_CURRENT_SOURCE_DIR}/MyEventProvider.mc -r ${CMAKE_CURRENT_BINARY_DIR}/ - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/MyEventProvider.mc) - -add_library(MyEventProvider SHARED ${CMAKE_CURRENT_BINARY_DIR}/MyEventProvider.rc) -set_module_type(MyEventProvider module UNICODE) -add_cd_file(TARGET MyEventProvider DESTINATION reactos/bin FOR all) +add_message_headers(UNICODE MyEventProvider.mc) +add_library(MyEventProvider_dll SHARED ${CMAKE_CURRENT_BINARY_DIR}/MyEventProvider.rc) +add_dependencies(MyEventProvider_dll MyEventProvider) +set_module_type(MyEventProvider_dll module UNICODE) +set_target_properties(MyEventProvider_dll PROPERTIES OUTPUT_NAME "MyEventProvider") +add_cd_file(TARGET MyEventProvider_dll DESTINATION reactos/bin FOR all) add_executable(evtlogtest EvtLogTest.c) -add_dependencies(evtlogtest MyEventProvider) set_module_type(evtlogtest win32cui UNICODE) +add_dependencies(evtlogtest MyEventProvider MyEventProvider_dll) add_importlibs(evtlogtest advapi32 msvcrt kernel32) add_cd_file(TARGET evtlogtest DESTINATION reactos/bin FOR all)