diff --git a/CMakeLists.txt b/CMakeLists.txt index f63234fd0c9..8773f198523 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,6 +75,7 @@ include_directories(./include/reactos/libs) add_subdirectory(include/psdk) add_subdirectory(include/dxsdk) +add_subdirectory(include/reactos/idl) add_subdirectory(include/reactos/mc) add_subdirectory(base) @@ -110,8 +111,6 @@ ADD_CUSTOM_COMMAND( DEPENDS native-nci ${nci_folders} ) -SET_SOURCE_FILES_PROPERTIES(${nci_output} PROPERTIES GENERATED TRUE) - ADD_CUSTOM_TARGET(ntdll_S ALL DEPENDS ${REACTOS_BINARY_DIR}/lib/ntdllsys/ntdll.S) ADD_CUSTOM_TARGET(win32k_S ALL DEPENDS ${REACTOS_BINARY_DIR}/lib/win32ksys/win32k.S) ADD_CUSTOM_TARGET(ntsys_pspec ALL DEPENDS ${REACTOS_BINARY_DIR}/dll/ntdll/def/ntsys.pspec) diff --git a/include/reactos/idl/CMakeLists.txt b/include/reactos/idl/CMakeLists.txt new file mode 100644 index 00000000000..5d5bc38e2d2 --- /dev/null +++ b/include/reactos/idl/CMakeLists.txt @@ -0,0 +1,51 @@ + +remove_definitions(-DWINVER=0x502) +add_definitions(-DWINVER=0x600) + +include_directories(.) + +get_directory_property(defines COMPILE_DEFINITIONS) +get_directory_property(includes INCLUDE_DIRECTORIES) + +foreach(arg ${defines}) + set(result_defs ${result_defs} -D${arg}) +endforeach(arg ${defines}) + +foreach(arg ${includes}) + set(result_incs -I${arg} ${result_incs}) +endforeach(arg ${includes}) + +MACRO (MACRO_IDL_FILES) + + 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 native-widl ${result_incs} ${result_defs} -m32 --win32 -h -H ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.h -s -S ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.c ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}.idl + DEPENDS native-widl + ) + set_source_files_properties( + ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.h ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.c + PROPERTIES GENERATED TRUE + ) + add_custom_target(${FILE}_server ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.h ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_s.c) + + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.h ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.c + COMMAND native-widl ${result_incs} ${result_defs} -m32 --win32 -h -H ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.h -c -C ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.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}_c.c + PROPERTIES GENERATED TRUE + ) + add_custom_target(${FILE}_client ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.h ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_c.c) + + ENDFOREACH(_in_FILE ${ARGN}) + +ENDMACRO (MACRO_IDL_FILES) + +file(GLOB_RECURSE SOURCE "*.idl") +LIST(REMOVE_ITEM SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/ms-dtyp.idl) +MACRO_IDL_FILES(${SOURCE})