mirror of
https://github.com/reactos/reactos.git
synced 2024-08-20 02:13:29 +00:00
[CMAKE]
- Improve formatting, mainly the uppercase macro names. No functionality change. svn path=/branches/cmake-bringup/; revision=50124
This commit is contained in:
parent
682ad4754b
commit
6d973bdc1c
|
@ -1,8 +1,7 @@
|
|||
|
||||
|
||||
if (NOT MSVC)
|
||||
MACRO(CreateBootSectorTarget _target_name _asm_file _object_file)
|
||||
|
||||
macro(CreateBootSectorTarget _target_name _asm_file _object_file)
|
||||
get_filename_component(OBJECT_PATH ${_object_file} PATH)
|
||||
get_filename_component(OBJECT_NAME ${_object_file} NAME)
|
||||
file(MAKE_DIRECTORY ${OBJECT_PATH})
|
||||
|
@ -11,11 +10,11 @@ MACRO(CreateBootSectorTarget _target_name _asm_file _object_file)
|
|||
|
||||
foreach(arg ${defines})
|
||||
set(result_defs ${result_defs} -D${arg})
|
||||
endforeach(arg ${defines})
|
||||
endforeach()
|
||||
|
||||
foreach(arg ${includes})
|
||||
set(result_incs -I${arg} ${result_incs})
|
||||
endforeach(arg ${includes})
|
||||
endforeach()
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${_object_file}
|
||||
|
@ -24,47 +23,50 @@ MACRO(CreateBootSectorTarget _target_name _asm_file _object_file)
|
|||
set_source_files_properties(${_object_file} PROPERTIES GENERATED TRUE)
|
||||
add_custom_target(${_target_name} ALL DEPENDS ${_object_file})
|
||||
add_minicd(${_object_file} loader ${OBJECT_NAME})
|
||||
ENDMACRO(CreateBootSectorTarget _target_name _asm_file _object_file)
|
||||
endmacro()
|
||||
|
||||
else()
|
||||
MACRO(CreateBootSectorTarget _target_name _asm_file _object_file)
|
||||
ENDMACRO()
|
||||
|
||||
macro(CreateBootSectorTarget _target_name _asm_file _object_file)
|
||||
endmacro()
|
||||
|
||||
endif()
|
||||
|
||||
MACRO(MACRO_IDL_COMPILE_OBJECT OBJECT SOURCE)
|
||||
GET_PROPERTY(FLAGS SOURCE ${SOURCE} PROPERTY COMPILE_FLAGS)
|
||||
GET_PROPERTY(DEFINES SOURCE ${SOURCE} PROPERTY COMPILE_DEFINITIONS)
|
||||
GET_PROPERTY(INCLUDE_DIRECTORIES DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
|
||||
FOREACH(DIR ${INCLUDE_DIRECTORIES})
|
||||
SET(FLAGS "${FLAGS} -I${DIR}")
|
||||
ENDFOREACH()
|
||||
macro(idl_compile_object OBJECT SOURCE)
|
||||
get_property(FLAGS SOURCE ${SOURCE} PROPERTY COMPILE_FLAGS)
|
||||
get_property(DEFINES SOURCE ${SOURCE} PROPERTY COMPILE_DEFINITIONS)
|
||||
get_property(INCLUDE_DIRECTORIES DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
|
||||
|
||||
SET(IDL_COMMAND ${CMAKE_IDL_COMPILE_OBJECT})
|
||||
STRING(REPLACE "<CMAKE_IDL_COMPILER>" "${CMAKE_IDL_COMPILER}" IDL_COMMAND "${IDL_COMMAND}")
|
||||
STRING(REPLACE <FLAGS> "${FLAGS}" IDL_COMMAND "${IDL_COMMAND}")
|
||||
STRING(REPLACE "<DEFINES>" "${DEFINES}" IDL_COMMAND "${IDL_COMMAND}")
|
||||
STRING(REPLACE "<OBJECT>" "${OBJECT}" IDL_COMMAND "${IDL_COMMAND}")
|
||||
STRING(REPLACE "<SOURCE>" "${SOURCE}" IDL_COMMAND "${IDL_COMMAND}")
|
||||
SEPARATE_ARGUMENTS(IDL_COMMAND)
|
||||
foreach(DIR ${INCLUDE_DIRECTORIES})
|
||||
set(FLAGS "${FLAGS} -I${DIR}")
|
||||
endforeach()
|
||||
|
||||
ADD_CUSTOM_COMMAND(
|
||||
set(IDL_COMMAND ${CMAKE_IDL_COMPILE_OBJECT})
|
||||
string(REPLACE "<CMAKE_IDL_COMPILER>" "${CMAKE_IDL_COMPILER}" IDL_COMMAND "${IDL_COMMAND}")
|
||||
string(REPLACE <FLAGS> "${FLAGS}" IDL_COMMAND "${IDL_COMMAND}")
|
||||
string(REPLACE "<DEFINES>" "${DEFINES}" IDL_COMMAND "${IDL_COMMAND}")
|
||||
string(REPLACE "<OBJECT>" "${OBJECT}" IDL_COMMAND "${IDL_COMMAND}")
|
||||
string(REPLACE "<SOURCE>" "${SOURCE}" IDL_COMMAND "${IDL_COMMAND}")
|
||||
separate_arguments(IDL_COMMAND)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${OBJECT}
|
||||
COMMAND ${IDL_COMMAND}
|
||||
DEPENDS ${SOURCE}
|
||||
VERBATIM
|
||||
)
|
||||
ENDMACRO()
|
||||
VERBATIM)
|
||||
endmacro()
|
||||
|
||||
MACRO(ADD_INTERFACE_DEFINITIONS TARGET)
|
||||
FOREACH(SOURCE ${ARGN})
|
||||
GET_FILENAME_COMPONENT(FILE ${SOURCE} NAME_WE)
|
||||
SET(OBJECT ${CMAKE_CURRENT_BINARY_DIR}/${FILE}.h)
|
||||
MACRO_IDL_COMPILE_OBJECT(${OBJECT} ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE})
|
||||
LIST(APPEND OBJECTS ${OBJECT})
|
||||
ENDFOREACH()
|
||||
ADD_CUSTOM_TARGET(${TARGET} ALL DEPENDS ${OBJECTS})
|
||||
ENDMACRO()
|
||||
macro(add_interface_definitions TARGET)
|
||||
foreach(SOURCE ${ARGN})
|
||||
get_filename_component(FILE ${SOURCE} NAME_WE)
|
||||
set(OBJECT ${CMAKE_CURRENT_BINARY_DIR}/${FILE}.h)
|
||||
idl_compile_object(${OBJECT} ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE})
|
||||
list(APPEND OBJECTS ${OBJECT})
|
||||
endforeach()
|
||||
add_custom_target(${TARGET} ALL DEPENDS ${OBJECTS})
|
||||
endmacro()
|
||||
|
||||
MACRO(add_minicd_target _targetname _dir) # optional parameter: _nameoncd
|
||||
macro(add_minicd_target _targetname _dir) # optional parameter: _nameoncd
|
||||
if("${ARGN}" STREQUAL "")
|
||||
get_target_property(FILENAME ${_targetname} LOCATION)
|
||||
get_filename_component(_nameoncd ${FILENAME} NAME)
|
||||
|
@ -73,11 +75,11 @@ MACRO(add_minicd_target _targetname _dir) # optional parameter: _nameoncd
|
|||
endif()
|
||||
|
||||
file(APPEND ${REACTOS_BINARY_DIR}/boot/ros_minicd_target.txt "${_targetname}\t${_dir}\t${_nameoncd}\n")
|
||||
ENDMACRO(add_minicd_target)
|
||||
endmacro()
|
||||
|
||||
MACRO(add_minicd FILENAME _dir _nameoncd)
|
||||
macro(add_minicd FILENAME _dir _nameoncd)
|
||||
file(APPEND ${REACTOS_BINARY_DIR}/boot/ros_minicd.txt "${FILENAME}\t${_dir}\t${_nameoncd}\n")
|
||||
ENDMACRO(add_minicd)
|
||||
endmacro()
|
||||
|
||||
macro(set_cpp)
|
||||
include_directories(BEFORE ${REACTOS_SOURCE_DIR}/include/c++/stlport)
|
||||
|
@ -87,7 +89,7 @@ macro(set_cpp)
|
|||
-DNATIVE_C_INCLUDE=${REACTOS_SOURCE_DIR}/include/crt)
|
||||
endmacro()
|
||||
|
||||
MACRO(add_livecd_target _targetname _dir )# optional parameter : _nameoncd
|
||||
macro(add_livecd_target _targetname _dir )# optional parameter : _nameoncd
|
||||
if("${ARGN}" STREQUAL "")
|
||||
get_target_property(FILENAME ${_targetname} LOCATION)
|
||||
get_filename_component(_nameoncd ${FILENAME} NAME)
|
||||
|
@ -96,16 +98,16 @@ MACRO(add_livecd_target _targetname _dir )# optional parameter : _nameoncd
|
|||
endif()
|
||||
|
||||
file(APPEND ${REACTOS_BINARY_DIR}/boot/ros_livecd_target.txt "${_targetname}\t${_dir}\t${_nameoncd}\n")
|
||||
ENDMACRO(add_livecd_target)
|
||||
endmacro()
|
||||
|
||||
MACRO(add_livecd FILENAME _dir)# optional parameter : _nameoncd
|
||||
macro(add_livecd FILENAME _dir)# optional parameter : _nameoncd
|
||||
if("${ARGN}" STREQUAL "")
|
||||
get_filename_component(_nameoncd ${FILENAME} NAME)
|
||||
else()
|
||||
set(_nameoncd ${ARGN})
|
||||
endif()
|
||||
file(APPEND ${REACTOS_BINARY_DIR}/boot/ros_livecd.txt "${FILENAME}\t${_dir}\t${_nameoncd}\n")
|
||||
ENDMACRO(add_livecd)
|
||||
endmacro()
|
||||
|
||||
macro(cab_to_dir _dir_num _var_name)
|
||||
# 1 = system32
|
||||
|
@ -137,17 +139,17 @@ macro(cab_to_dir _dir_num _var_name)
|
|||
endif()
|
||||
endmacro()
|
||||
|
||||
MACRO(add_cab_target _targetname _num )
|
||||
macro(add_cab_target _targetname _num )
|
||||
file(APPEND ${REACTOS_BINARY_DIR}/boot/ros_cab_target.txt "${_targetname}\t${_num}\n")
|
||||
cab_to_dir(${_num} _dir)
|
||||
add_livecd_target(${_targetname} ${_dir})
|
||||
ENDMACRO(add_cab_target)
|
||||
endmacro()
|
||||
|
||||
MACRO(add_cab FILENAME _num)
|
||||
macro(add_cab FILENAME _num)
|
||||
file(APPEND ${REACTOS_BINARY_DIR}/boot/ros_cab.txt "${FILENAME}\t${_num}\n")
|
||||
cab_to_dir(${_num} _dir)
|
||||
add_livecd(${FILENAME} ${_dir})
|
||||
ENDMACRO(add_cab)
|
||||
endmacro()
|
||||
|
||||
macro(custom_incdefs)
|
||||
if(NOT DEFINED result_incs) #rpc_defines
|
||||
|
@ -156,13 +158,13 @@ macro(custom_incdefs)
|
|||
|
||||
foreach(arg ${rpc_defines})
|
||||
set(result_defs ${result_defs} -D${arg})
|
||||
endforeach(arg ${defines})
|
||||
endforeach()
|
||||
|
||||
foreach(arg ${rpc_includes})
|
||||
set(result_incs -I${arg} ${result_incs})
|
||||
endforeach(arg ${includes})
|
||||
endforeach()
|
||||
endif()
|
||||
endmacro(custom_incdefs)
|
||||
endmacro()
|
||||
|
||||
macro(rpcproxy TARGET)
|
||||
custom_incdefs()
|
||||
|
@ -183,7 +185,7 @@ macro(rpcproxy TARGET)
|
|||
add_custom_target(${TARGET}_${FILE}_p
|
||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_p.c)
|
||||
#add_dependencies(${TARGET}_proxy ${TARGET}_${FILE}_p)
|
||||
endforeach(_in_FILE ${ARGN})
|
||||
endforeach()
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_proxy.dlldata.c
|
||||
|
@ -195,9 +197,9 @@ macro(rpcproxy TARGET)
|
|||
|
||||
add_library(${TARGET}_proxy ${SOURCE})
|
||||
add_dependencies(${TARGET}_proxy psdk ${PROXY_DEPENDS})
|
||||
endmacro(rpcproxy)
|
||||
endmacro()
|
||||
|
||||
macro (MACRO_IDL_FILES)
|
||||
macro(idl_files)
|
||||
custom_incdefs()
|
||||
foreach(_in_FILE ${ARGN})
|
||||
get_filename_component(FILE ${_in_FILE} NAME_WE)
|
||||
|
@ -220,16 +222,16 @@ macro (MACRO_IDL_FILES)
|
|||
PROPERTIES GENERATED TRUE)
|
||||
add_library(${FILE}_client ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.c)
|
||||
add_dependencies(${FILE}_client psdk)
|
||||
endforeach(_in_FILE ${ARGN})
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
endmacro (MACRO_IDL_FILES)
|
||||
|
||||
macro(ADD_TYPELIB TARGET)
|
||||
macro(add_typelib TARGET)
|
||||
custom_incdefs()
|
||||
foreach(SOURCE ${ARGN})
|
||||
get_filename_component(FILE ${SOURCE} NAME_WE)
|
||||
set(OBJECT ${CMAKE_CURRENT_BINARY_DIR}/${FILE}.tlb)
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${FILE}.tlb
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${FILE}.tlb
|
||||
COMMAND ${IDL_COMPILER} ${result_incs} ${IDL_FLAGS} ${IDL_TYPELIB_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${FILE}.tlb ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE}
|
||||
DEPENDS ${SOURCE})
|
||||
list(APPEND OBJECTS ${OBJECT})
|
||||
|
@ -240,7 +242,8 @@ endmacro()
|
|||
macro(add_idl_interface IDL_FILE)
|
||||
custom_incdefs()
|
||||
get_filename_component(FILE ${IDL_FILE} NAME_WE)
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_i.c
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_i.c
|
||||
COMMAND ${IDL_COMPILER} ${result_incs} ${result_defs} -m32 --win32 -u -U ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_i.c ${CMAKE_CURRENT_SOURCE_DIR}/${IDL_FILE}
|
||||
DEPENDS ${IDL_FILE})
|
||||
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${FILE}_i.c PROPERTIES GENERATED TRUE)
|
||||
|
|
|
@ -6,7 +6,7 @@ add_definitions(-D_WIN32_WINNT=0x600)
|
|||
|
||||
include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
|
||||
|
||||
ADD_INTERFACE_DEFINITIONS(atl_atliface_header atliface.idl)
|
||||
add_interface_definitions(atl_atliface_header atliface.idl)
|
||||
|
||||
set_rc_compiler()
|
||||
spec2def(atl.dll atl.spec)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
ADD_TYPELIB(jsglobal jsglobal.idl)
|
||||
add_typelib(jsglobal jsglobal.idl)
|
||||
add_dependencies(jsglobal stdole2)
|
||||
|
||||
remove_definitions(-D_WIN32_WINNT=0x502)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
ADD_TYPELIB(mshtml_tlb mshtml_tlb.idl)
|
||||
add_typelib(mshtml_tlb mshtml_tlb.idl)
|
||||
add_dependencies(mshtml_tlb stdole2)
|
||||
|
||||
add_definitions(-D__WINESRC__)
|
||||
|
|
|
@ -9,7 +9,7 @@ add_definitions(
|
|||
|
||||
include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
|
||||
|
||||
ADD_INTERFACE_DEFINITIONS(mshtml_nsiface_header nsiface.idl)
|
||||
add_interface_definitions(mshtml_nsiface_header nsiface.idl)
|
||||
|
||||
set_rc_compiler()
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
ADD_TYPELIB(msxml3_v1 msxml3_v1.idl)
|
||||
|
||||
add_typelib(msxml3_v1 msxml3_v1.idl)
|
||||
add_dependencies(msxml3_v1 stdole2)
|
||||
|
||||
remove_definitions(-D_WIN32_WINNT=0x502)
|
||||
|
|
|
@ -54,7 +54,8 @@ include_directories(
|
|||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${REACTOS_SOURCE_DIR}/include/reactos/wine)
|
||||
|
||||
ADD_INTERFACE_DEFINITIONS(ole32idl dcom.idl irot.idl)
|
||||
add_interface_definitions(ole32idl dcom.idl irot.idl)
|
||||
|
||||
rpcproxy(ole32
|
||||
dcom.idl
|
||||
ole32_unknwn.idl
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
ADD_TYPELIB(pstorec_tlb pstorec_tlb.idl)
|
||||
add_typelib(pstorec_tlb pstorec_tlb.idl)
|
||||
add_dependencies(pstorec_tlb stdole2)
|
||||
|
||||
add_definitions(-D__WINESRC__)
|
||||
|
@ -15,12 +15,7 @@ list(APPEND SOURCE
|
|||
add_library(pstorec SHARED ${SOURCE})
|
||||
|
||||
set_module_type(pstorec win32dll)
|
||||
|
||||
target_link_libraries(pstorec
|
||||
uuid
|
||||
wine)
|
||||
|
||||
target_link_libraries(pstorec uuid wine)
|
||||
add_importlibs(pstorec msvcrt kernel32 ntdll)
|
||||
|
||||
add_dependencies(pstorec pstorec_tlb pstorec_def)
|
||||
add_cab_target(pstorec 1)
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
|
||||
ADD_TYPELIB(shdocvw_v1 shdocvw_v1.idl)
|
||||
add_typelib(shdocvw_v1 shdocvw_v1.idl)
|
||||
add_dependencies(shdocvw_v1 stdole2)
|
||||
|
||||
add_definitions(-D_SHDOCVW_)
|
||||
|
||||
include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
|
||||
|
||||
spec2def(shdocvw.dll shdocvw.spec)
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
|
||||
add_definitions(-D__WINESRC__)
|
||||
|
||||
include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
|
||||
|
||||
ADD_TYPELIB(std_ole_v2 std_ole_v2.idl)
|
||||
add_typelib(std_ole_v2 std_ole_v2.idl)
|
||||
|
||||
spec2def(stdole2.tlb stdole2.tlb.spec)
|
||||
|
||||
|
@ -12,8 +11,5 @@ add_library(stdole2.tlb SHARED rsrc.rc
|
|||
|
||||
set_entrypoint(stdole2.tlb 0)
|
||||
set_target_properties(stdole2.tlb PROPERTIES SUFFIX "")
|
||||
|
||||
|
||||
|
||||
add_dependencies(stdole2.tlb std_ole_v2)
|
||||
add_cab_target(stdole2.tlb 1)
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
|
||||
add_definitions(-D__WINESRC__)
|
||||
|
||||
include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
|
||||
|
||||
ADD_TYPELIB(std_ole_v1 std_ole_v1.idl)
|
||||
add_typelib(std_ole_v1 std_ole_v1.idl)
|
||||
|
||||
spec2def(stdole32.tlb stdole32.tlb.spec)
|
||||
|
||||
add_library(stdole32.tlb SHARED rsrc.rc
|
||||
add_library(stdole32.tlb SHARED
|
||||
rsrc.rc
|
||||
${CMAKE_CURRENT_BINARY_DIR}/stdole32.def)
|
||||
|
||||
set_entrypoint(stdole32.tlb 0)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
LIST(APPEND SOURCE
|
||||
list(APPEND SOURCE
|
||||
amstream.idl
|
||||
amvideo.idl
|
||||
austream.idl
|
||||
|
@ -24,4 +24,4 @@ LIST(APPEND SOURCE
|
|||
#vmrender.idl
|
||||
)
|
||||
|
||||
ADD_INTERFACE_DEFINITIONS(dxsdk ${SOURCE})
|
||||
add_interface_definitions(dxsdk ${SOURCE})
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
LIST(APPEND SOURCE
|
||||
list(APPEND SOURCE
|
||||
# access.idl
|
||||
activaut.idl
|
||||
activdbg.idl
|
||||
|
@ -103,10 +103,9 @@ LIST(APPEND SOURCE
|
|||
if(NOT MSVC)
|
||||
LIST(APPEND SOURCE
|
||||
wincodec.idl
|
||||
wuapi.idl
|
||||
)
|
||||
wuapi.idl)
|
||||
endif()
|
||||
|
||||
ADD_INTERFACE_DEFINITIONS(psdk ${SOURCE})
|
||||
add_interface_definitions(psdk ${SOURCE})
|
||||
|
||||
ADD_TYPELIB(stdole2 stdole2.idl)
|
||||
add_typelib(stdole2 stdole2.idl)
|
||||
|
|
|
@ -7,7 +7,9 @@ list(APPEND SOURCE
|
|||
svcctl.idl
|
||||
wlansvc.idl)
|
||||
|
||||
MACRO_IDL_FILES(${SOURCE})
|
||||
idl_files(${SOURCE})
|
||||
|
||||
remove_definitions(-D_WIN32_WINNT=0x502)
|
||||
add_definitions(-D_WIN32_WINNT=0x600)
|
||||
MACRO_IDL_FILES(pnp.idl)
|
||||
|
||||
idl_files(pnp.idl)
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
|
||||
ADD_INTERFACE_DEFINITIONS(wineheaders itss.idl wined3d.idl)
|
||||
add_interface_definitions(wineheaders itss.idl wined3d.idl)
|
||||
|
||||
list(APPEND SOURCE
|
||||
epm.idl
|
||||
irot.idl)
|
||||
|
||||
MACRO_IDL_FILES(${SOURCE})
|
||||
ADD_INTERFACE_DEFINITIONS(winesdk ${SOURCE})
|
||||
idl_files(${SOURCE})
|
||||
add_interface_definitions(winesdk ${SOURCE})
|
||||
|
|
Loading…
Reference in a new issue