Author: tkreuzer
Date: Fri Dec 31 16:49:49 2010
New Revision: 50243
URL:
http://svn.reactos.org/svn/reactos?rev=50243&view=rev
Log:
[CMAKE]
Add generation of a depencency graph for shared libraries.
The output is a graphml file. Can be enabled with GENERATE_DEPENDENCY_GRAPH switch.
Modified:
branches/cmake-bringup/CMakeLists.txt
branches/cmake-bringup/CMakeMacros.cmake
branches/cmake-bringup/config.cmake
branches/cmake-bringup/gcc.cmake
Modified: branches/cmake-bringup/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/CMakeLists.txt?re…
==============================================================================
--- branches/cmake-bringup/CMakeLists.txt [iso-8859-1] (original)
+++ branches/cmake-bringup/CMakeLists.txt [iso-8859-1] Fri Dec 31 16:49:49 2010
@@ -79,6 +79,7 @@
#Some cleanup
file(REMOVE
+ ${REACTOS_BINARY_DIR}/dependencies.graphml
${REACTOS_BINARY_DIR}/boot/ros_livecd.txt
${REACTOS_BINARY_DIR}/boot/ros_livecd_target.txt
${REACTOS_BINARY_DIR}/boot/ros_minicd.txt
@@ -145,6 +146,8 @@
include_directories(include/crt/mingw32)
endif()
+ add_dependency_header()
+
add_subdirectory(include/psdk)
add_subdirectory(include/dxsdk)
add_subdirectory(include/reactos/idl)
@@ -227,4 +230,6 @@
#bootcd and livecd
include(ros_cd.cmake)
+ add_dependency_footer()
+
endif()
Modified: branches/cmake-bringup/CMakeMacros.cmake
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/CMakeMacros.cmake…
==============================================================================
--- branches/cmake-bringup/CMakeMacros.cmake [iso-8859-1] (original)
+++ branches/cmake-bringup/CMakeMacros.cmake [iso-8859-1] Fri Dec 31 16:49:49 2010
@@ -36,7 +36,7 @@
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()
@@ -73,7 +73,7 @@
else()
set(_nameoncd ${ARGN})
endif()
-
+
file(APPEND ${REACTOS_BINARY_DIR}/boot/ros_minicd_target.txt
"${_targetname}\t${_dir}\t${_nameoncd}\n")
endmacro()
@@ -96,7 +96,7 @@
else()
set(_nameoncd ${ARGN})
endif()
-
+
file(APPEND ${REACTOS_BINARY_DIR}/boot/ros_livecd_target.txt
"${_targetname}\t${_dir}\t${_nameoncd}\n")
endmacro()
@@ -149,7 +149,7 @@
file(APPEND ${REACTOS_BINARY_DIR}/boot/ros_cab.txt
"${FILENAME}\t${_num}\n")
cab_to_dir(${_num} _dir)
add_livecd(${FILENAME} ${_dir})
-endmacro()
+endmacro()
macro(custom_incdefs)
if(NOT DEFINED result_incs) #rpc_defines
@@ -181,6 +181,13 @@
PROPERTIES GENERATED TRUE)
list(APPEND SOURCE ${CMAKE_CURRENT_BINARY_DIR}/${FILE}_p.c)
list(APPEND IDLS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}.idl)
+<<<<<<< .mine
+ 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)
+=======
+>>>>>>> .r50241
endforeach()
add_custom_command(
@@ -190,6 +197,12 @@
set_source_files_properties(
${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_proxy.dlldata.c
PROPERTIES GENERATED TRUE)
+<<<<<<< .mine
+
+ add_library(${TARGET}_proxy ${SOURCE})
+ add_dependencies(${TARGET}_proxy psdk ${PROXY_DEPENDS})
+=======
+>>>>>>> .r50241
endmacro()
macro(idl_files)
@@ -205,7 +218,7 @@
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
@@ -241,3 +254,30 @@
DEPENDS ${IDL_FILE})
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${FILE}_i.c PROPERTIES
GENERATED TRUE)
endmacro()
+
+macro(add_dependency_node _node)
+ if(GENERATE_DEPENDENCY_GRAPH)
+ get_target_property(_type ${_node} TYPE)
+ if(_type MATCHES SHARED_LIBRARY)
+ file(APPEND ${REACTOS_BINARY_DIR}/dependencies.graphml " <node
id=\"${_node}\"/>\n")
+ endif()
+ endif()
+endmacro()
+
+macro(add_dependency_edge _source _target)
+ if(GENERATE_DEPENDENCY_GRAPH)
+ get_target_property(_type ${_source} TYPE)
+ if(_type MATCHES SHARED_LIBRARY)
+ file(APPEND ${REACTOS_BINARY_DIR}/dependencies.graphml " <edge
source=\"${_source}\" target=\"${_target}\"/>\n")
+ endif()
+ endif()
+endmacro()
+
+macro(add_dependency_header)
+ file(APPEND ${REACTOS_BINARY_DIR}/dependencies.graphml "<?xml
version=\"1.0\" encoding=\"UTF-8\"?>\n<graphml>\n <graph
id=\"ReactOS dependencies\" edgedefault=\"directed\">\n")
+ add_dependency_node(ntdll)
+endmacro()
+
+macro(add_dependency_footer)
+ file(APPEND ${REACTOS_BINARY_DIR}/dependencies.graphml "
</graph>\n</graphml>\n")
+endmacro()
Modified: branches/cmake-bringup/config.cmake
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/config.cmake?rev=…
==============================================================================
--- branches/cmake-bringup/config.cmake [iso-8859-1] (original)
+++ branches/cmake-bringup/config.cmake [iso-8859-1] Fri Dec 31 16:49:49 2010
@@ -47,3 +47,5 @@
set(BUILD_MP TRUE CACHE BOOL
"Whether to compile the multi processor versions for ntoskrnl and hal.")
+set(GENERATE_DEPENDENCY_GRAPH FALSE CACHE BOOL
+"Whether to create a graphml dependency of dlls.")
Modified: branches/cmake-bringup/gcc.cmake
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/gcc.cmake?rev=502…
==============================================================================
--- branches/cmake-bringup/gcc.cmake [iso-8859-1] (original)
+++ branches/cmake-bringup/gcc.cmake [iso-8859-1] Fri Dec 31 16:49:49 2010
@@ -218,9 +218,11 @@
set(IDL_DLLDATA_ARG --dlldata-only --dlldata=)
macro(add_importlibs MODULE)
+ add_dependency_node(${MODULE})
foreach(LIB ${ARGN})
target_link_libraries(${MODULE} ${CMAKE_BINARY_DIR}/importlibs/lib${LIB}.a)
add_dependencies(${MODULE} lib${LIB})
+ add_dependency_edge(${MODULE} ${LIB})
endforeach()
endmacro()