mirror of
https://github.com/reactos/reactos.git
synced 2024-08-18 09:28:36 +00:00
[CMAKE]
Improve minicd and livecd macros. Files and iso images are updated/cleaned without any manual steps. svn path=/branches/cmake-bringup/; revision=49306
This commit is contained in:
parent
ef1e9cefa1
commit
5644ab604d
|
@ -108,12 +108,12 @@ file(MAKE_DIRECTORY "${BOOTCD_DIR}/loader")
|
|||
file(MAKE_DIRECTORY "${BOOTCD_DIR}/reactos")
|
||||
file(MAKE_DIRECTORY "${BOOTCD_DIR}/reactos/system32")
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${REACTOS_BINARY_DIR}/minicd.iso
|
||||
add_custom_target(minicd
|
||||
COMMAND native-cdmake -v -j -m -b ${CMAKE_CURRENT_BINARY_DIR}/boot/freeldr/bootsect/isoboot.bin ${BOOTCD_DIR} REACTOS ${REACTOS_BINARY_DIR}/minicd.iso
|
||||
DEPENDS native-cdmake)
|
||||
add_custom_target(minicd DEPENDS ${REACTOS_BINARY_DIR}/minicd.iso)
|
||||
|
||||
add_minicd(${REACTOS_SOURCE_DIR}/boot/bootdata/bootcd.ini "" freeldr.ini)
|
||||
set_directory_properties(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${REACTOS_BINARY_DIR}/minicd.iso)
|
||||
|
||||
#livecd target
|
||||
set(LIVECD_DIR "${REACTOS_BINARY_DIR}/boot/livecd")
|
||||
|
@ -132,12 +132,11 @@ file(MAKE_DIRECTORY "${LIVECD_DIR}/reactos/fonts")
|
|||
file(MAKE_DIRECTORY "${LIVECD_DIR}/reactos/system32")
|
||||
file(MAKE_DIRECTORY "${LIVECD_DIR}/reactos/system32/config")
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${REACTOS_BINARY_DIR}/livecd.iso
|
||||
add_custom_target(livecd
|
||||
COMMAND native-cdmake -v -j -m -b ${CMAKE_CURRENT_BINARY_DIR}/boot/freeldr/bootsect/isoboot.bin ${LIVECD_DIR} REACTOS ${REACTOS_BINARY_DIR}/livecd.iso
|
||||
DEPENDS native-cdmake)
|
||||
add_custom_target(livecd DEPENDS ${REACTOS_BINARY_DIR}/livecd.iso)
|
||||
add_livecd(${REACTOS_SOURCE_DIR}/boot/bootdata/livecd.ini "" freeldr.ini)
|
||||
set_directory_properties(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${REACTOS_BINARY_DIR}/livecd.iso)
|
||||
|
||||
include(baseaddress.cmake)
|
||||
|
||||
|
|
|
@ -125,23 +125,19 @@ MACRO(add_minicd_target _targetname _dir) # optional parameter: _nameoncd
|
|||
set(_nameoncd ${ARGN})
|
||||
endif()
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${BOOTCD_DIR}/${_dir}/${_nameoncd}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${FILENAME} ${BOOTCD_DIR}/${_dir}/${_nameoncd})
|
||||
add_custom_target(${_targetname}_minicd
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${FILENAME} ${BOOTCD_DIR}/${_dir}/${_nameoncd}
|
||||
DEPENDS ${_targetname})
|
||||
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${BOOTCD_DIR}/${_dir}/${_nameoncd})
|
||||
|
||||
add_custom_target(${_targetname}_minicd DEPENDS ${BOOTCD_DIR}/${_dir}/${_nameoncd})
|
||||
|
||||
add_dependencies(${_targetname}_minicd ${_targetname})
|
||||
add_dependencies(minicd ${_targetname}_minicd)
|
||||
ENDMACRO(add_minicd_target _targetname _dir _nameoncd)
|
||||
ENDMACRO(add_minicd_target)
|
||||
|
||||
MACRO(add_minicd FILENAME _dir _nameoncd)
|
||||
add_custom_command(
|
||||
OUTPUT ${BOOTCD_DIR}/${_dir}/${_nameoncd}
|
||||
DEPENDS ${FILENAME}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${FILENAME} ${BOOTCD_DIR}/${_dir}/${_nameoncd})
|
||||
|
||||
add_custom_target(${_nameoncd}_minicd DEPENDS ${BOOTCD_DIR}/${_dir}/${_nameoncd})
|
||||
add_custom_target(${_nameoncd}_minicd
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${FILENAME} ${BOOTCD_DIR}/${_dir}/${_nameoncd}
|
||||
DEPENDS ${FILENAME})
|
||||
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${BOOTCD_DIR}/${_dir}/${_nameoncd})
|
||||
|
||||
add_dependencies(minicd ${_nameoncd}_minicd)
|
||||
ENDMACRO(add_minicd)
|
||||
|
@ -150,112 +146,108 @@ macro(set_cpp)
|
|||
include_directories(BEFORE ${REACTOS_SOURCE_DIR}/lib/3rdparty/stlport/stlport)
|
||||
set(IS_CPP 1)
|
||||
endmacro()
|
||||
|
||||
MACRO(add_livecd_target _targetname _dir )# optional parameter : _nameoncd
|
||||
|
||||
get_target_property(FILENAME ${_targetname} LOCATION)
|
||||
|
||||
if("${ARGN}" STREQUAL "")
|
||||
get_filename_component(_nameoncd ${FILENAME} NAME)
|
||||
else()
|
||||
set(_nameoncd ${ARGN})
|
||||
endif()
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${LIVECD_DIR}/${_dir}/${_nameoncd}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${FILENAME} ${LIVECD_DIR}/${_dir}/${_nameoncd})
|
||||
|
||||
add_custom_target(${_targetname}_livecd DEPENDS ${LIVECD_DIR}/${_dir}/${_nameoncd})
|
||||
|
||||
add_dependencies(${_targetname}_livecd ${_targetname})
|
||||
add_dependencies(livecd ${_targetname}_livecd)
|
||||
ENDMACRO(add_livecd_target _targetname _dir _nameoncd)
|
||||
|
||||
MACRO(add_livecd FILENAME _dir _nameoncd)
|
||||
add_custom_command(
|
||||
OUTPUT ${LIVECD_DIR}/${_dir}/${_nameoncd}
|
||||
DEPENDS ${FILENAME}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${FILENAME} ${LIVECD_DIR}/${_dir}/${_nameoncd})
|
||||
|
||||
add_custom_target(${_nameoncd}_livecd DEPENDS ${LIVECD_DIR}/${_dir}/${_nameoncd})
|
||||
|
||||
add_dependencies(livecd ${_nameoncd}_livecd)
|
||||
ENDMACRO(add_livecd)
|
||||
|
||||
macro(custom_incdefs)
|
||||
if(NOT DEFINED result_incs) #rpc_defines
|
||||
get_directory_property(rpc_defines COMPILE_DEFINITIONS)
|
||||
get_directory_property(rpc_includes INCLUDE_DIRECTORIES)
|
||||
|
||||
foreach(arg ${rpc_defines})
|
||||
set(result_defs ${result_defs} -D${arg})
|
||||
endforeach(arg ${defines})
|
||||
|
||||
foreach(arg ${rpc_includes})
|
||||
set(result_incs -I${arg} ${result_incs})
|
||||
endforeach(arg ${includes})
|
||||
endif()
|
||||
endmacro(custom_incdefs)
|
||||
|
||||
macro(rpcproxy TARGET)
|
||||
custom_incdefs()
|
||||
list(APPEND SOURCE ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_proxy.dlldata.c)
|
||||
|
||||
foreach(_in_FILE ${ARGN})
|
||||
get_filename_component(FILE ${_in_FILE} NAME_WE)
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_p.h ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_p.c
|
||||
COMMAND native-widl ${result_incs} ${result_defs} -m32 --win32 -h -H ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_p.h -p -P ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_p.c ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}.idl
|
||||
DEPENDS native-widl)
|
||||
set_source_files_properties(
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.h ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_p.c
|
||||
PROPERTIES GENERATED TRUE)
|
||||
list(APPEND SOURCE ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_p.c)
|
||||
list(APPEND IDLS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}.idl)
|
||||
list(APPEND PROXY_DEPENDS ${TARGET}_${FILE}_p)
|
||||
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})
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_proxy.dlldata.c
|
||||
COMMAND native-widl ${result_incs} ${result_defs} -m32 --win32 --dlldata-only --dlldata=${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_proxy.dlldata.c ${IDLS}
|
||||
DEPENDS native-widl)
|
||||
set_source_files_properties(
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_proxy.dlldata.c
|
||||
PROPERTIES GENERATED TRUE)
|
||||
|
||||
add_library(${TARGET}_proxy ${SOURCE})
|
||||
add_dependencies(${TARGET}_proxy psdk ${PROXY_DEPENDS})
|
||||
endmacro(rpcproxy)
|
||||
|
||||
macro (MACRO_IDL_FILES)
|
||||
custom_incdefs()
|
||||
foreach(_in_FILE ${ARGN})
|
||||
get_filename_component(FILE ${_in_FILE} NAME_WE)
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.h ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.c
|
||||
|
||||
MACRO(add_livecd_target _targetname _dir )# optional parameter : _nameoncd
|
||||
|
||||
get_target_property(FILENAME ${_targetname} LOCATION)
|
||||
|
||||
if("${ARGN}" STREQUAL "")
|
||||
get_filename_component(_nameoncd ${FILENAME} NAME)
|
||||
else()
|
||||
set(_nameoncd ${ARGN})
|
||||
endif()
|
||||
|
||||
add_custom_target(${_targetname}_livecd
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${FILENAME} ${LIVECD_DIR}/${_dir}/${_nameoncd}
|
||||
DEPENDS ${_targetname})
|
||||
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${LIVECD_DIR}/${_dir}/${_nameoncd})
|
||||
|
||||
add_dependencies(livecd ${_targetname}_livecd)
|
||||
ENDMACRO(add_livecd_target)
|
||||
|
||||
MACRO(add_livecd FILENAME _dir _nameoncd)
|
||||
add_custom_target(${_nameoncd}_livecd
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${FILENAME} ${LIVECD_DIR}/${_dir}/${_nameoncd}
|
||||
DEPENDS ${FILENAME})
|
||||
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${LIVECD_DIR}/${_dir}/${_nameoncd})
|
||||
|
||||
add_dependencies(livecd ${_nameoncd}_livecd)
|
||||
ENDMACRO(add_livecd)
|
||||
|
||||
macro(custom_incdefs)
|
||||
if(NOT DEFINED result_incs) #rpc_defines
|
||||
get_directory_property(rpc_defines COMPILE_DEFINITIONS)
|
||||
get_directory_property(rpc_includes INCLUDE_DIRECTORIES)
|
||||
|
||||
foreach(arg ${rpc_defines})
|
||||
set(result_defs ${result_defs} -D${arg})
|
||||
endforeach(arg ${defines})
|
||||
|
||||
foreach(arg ${rpc_includes})
|
||||
set(result_incs -I${arg} ${result_incs})
|
||||
endforeach(arg ${includes})
|
||||
endif()
|
||||
endmacro(custom_incdefs)
|
||||
|
||||
macro(rpcproxy TARGET)
|
||||
custom_incdefs()
|
||||
list(APPEND SOURCE ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_proxy.dlldata.c)
|
||||
|
||||
foreach(_in_FILE ${ARGN})
|
||||
get_filename_component(FILE ${_in_FILE} NAME_WE)
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_p.h ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_p.c
|
||||
COMMAND native-widl ${result_incs} ${result_defs} -m32 --win32 -h -H ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_p.h -p -P ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_p.c ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}.idl
|
||||
DEPENDS native-widl)
|
||||
set_source_files_properties(
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.h ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_p.c
|
||||
PROPERTIES GENERATED TRUE)
|
||||
list(APPEND SOURCE ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_p.c)
|
||||
list(APPEND IDLS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}.idl)
|
||||
list(APPEND PROXY_DEPENDS ${TARGET}_${FILE}_p)
|
||||
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})
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_proxy.dlldata.c
|
||||
COMMAND native-widl ${result_incs} ${result_defs} -m32 --win32 --dlldata-only --dlldata=${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_proxy.dlldata.c ${IDLS}
|
||||
DEPENDS native-widl)
|
||||
set_source_files_properties(
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_proxy.dlldata.c
|
||||
PROPERTIES GENERATED TRUE)
|
||||
|
||||
add_library(${TARGET}_proxy ${SOURCE})
|
||||
add_dependencies(${TARGET}_proxy psdk ${PROXY_DEPENDS})
|
||||
endmacro(rpcproxy)
|
||||
|
||||
macro (MACRO_IDL_FILES)
|
||||
custom_incdefs()
|
||||
foreach(_in_FILE ${ARGN})
|
||||
get_filename_component(FILE ${_in_FILE} NAME_WE)
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.h ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.c
|
||||
COMMAND ${IDL_COMPILER} ${result_incs} ${result_defs} ${IDL_FLAGS} ${IDL_HEADER_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.h ${IDL_SERVER_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.c ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}.idl
|
||||
DEPENDS ${_in_file})
|
||||
set_source_files_properties(
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.h ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.c
|
||||
PROPERTIES GENERATED TRUE)
|
||||
add_library(${FILE}_server ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.c)
|
||||
add_dependencies(${FILE}_server psdk)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.h ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.c
|
||||
set_source_files_properties(
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.h ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.c
|
||||
PROPERTIES GENERATED TRUE)
|
||||
add_library(${FILE}_server ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.c)
|
||||
add_dependencies(${FILE}_server psdk)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.h ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.c
|
||||
COMMAND ${IDL_COMPILER} ${result_incs} ${result_defs} ${IDL_FLAGS} ${IDL_HEADER_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.h ${IDL_CLIENT_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.c ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}.idl
|
||||
DEPENDS ${_in_file})
|
||||
set_source_files_properties(
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.h ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.c
|
||||
PROPERTIES GENERATED TRUE)
|
||||
add_library(${FILE}_client ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.c)
|
||||
add_dependencies(${FILE}_client psdk)
|
||||
endforeach(_in_FILE ${ARGN})
|
||||
|
||||
endmacro (MACRO_IDL_FILES)
|
||||
set_source_files_properties(
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.h ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.c
|
||||
PROPERTIES GENERATED TRUE)
|
||||
add_library(${FILE}_client ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.c)
|
||||
add_dependencies(${FILE}_client psdk)
|
||||
endforeach(_in_FILE ${ARGN})
|
||||
|
||||
endmacro (MACRO_IDL_FILES)
|
||||
|
||||
macro(ADD_TYPELIB TARGET)
|
||||
custom_incdefs()
|
||||
|
|
Loading…
Reference in a new issue