[PRINTING] Add x64 print environment keys and folders
[reactos.git] / sdk / cmake / CMakeMacros.cmake
index 257fece..99a12b2 100644 (file)
@@ -74,6 +74,7 @@ macro(set_cpp)
             include_directories(${REACTOS_SOURCE_DIR}/sdk/include/c++/stlport)
         else()
             replace_compile_flags("-nostdinc" " ")
+            add_definitions(-DPAL_STDCPP_COMPAT)
         endif()
     endif()
 
@@ -83,7 +84,7 @@ endmacro()
 function(add_dependency_node _node)
     if(GENERATE_DEPENDENCY_GRAPH)
         get_target_property(_type ${_node} TYPE)
-        if(_type MATCHES SHARED_LIBRARY OR ${_node} MATCHES ntoskrnl)
+        if(_type MATCHES SHARED_LIBRARY|MODULE_LIBRARY OR ${_node} MATCHES ntoskrnl)
             file(APPEND ${REACTOS_BINARY_DIR}/dependencies.graphml "    <node id=\"${_node}\"/>\n")
         endif()
      endif()
@@ -92,7 +93,7 @@ endfunction()
 function(add_dependency_edge _source _target)
     if(GENERATE_DEPENDENCY_GRAPH)
         get_target_property(_type ${_source} TYPE)
-        if(_type MATCHES SHARED_LIBRARY)
+        if(_type MATCHES SHARED_LIBRARY|MODULE_LIBRARY)
             file(APPEND ${REACTOS_BINARY_DIR}/dependencies.graphml "    <edge source=\"${_source}\" target=\"${_target}\"/>\n")
         endif()
     endif()
@@ -294,6 +295,14 @@ macro(dir_to_num dir var)
         set(${var} 61)
     elseif(${dir} STREQUAL reactos/Resources/Themes/Modern)
         set(${var} 62)
+    elseif(${dir} STREQUAL reactos/3rdParty)
+        set(${var} 63)
+    elseif(${dir} STREQUAL reactos/Resources/Themes/Lunar)
+        set(${var} 64) 
+    elseif(${dir} STREQUAL reactos/Resources/Themes/Mizu)
+        set(${var} 65)
+    elseif(${dir} STREQUAL reactos/system32/spool/prtprocs/x64)
+        set(${var} 66)
     else()
         message(FATAL_ERROR "Wrong destination: ${dir}")
     endif()
@@ -520,6 +529,11 @@ if(NOT MSVC_IDE)
     function(add_library name)
         _add_library(${name} ${ARGN})
         add_clean_target(${name})
+        # cmake adds a module_EXPORTS define when compiling a module or a shared library. We don't use that.
+        get_target_property(_type ${name} TYPE)
+        if (_type MATCHES SHARED_LIBRARY|MODULE_LIBRARY)
+            set_target_properties(${name} PROPERTIES DEFINE_SYMBOL "")
+        endif()
     endfunction()
 
     function(add_executable name)
@@ -545,6 +559,11 @@ elseif(USE_FOLDER_STRUCTURE)
             string(SUBSTRING ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR_LENGTH} -1 CMAKE_CURRENT_SOURCE_DIR_RELATIVE)
             set_property(TARGET "${name}" PROPERTY FOLDER "${CMAKE_CURRENT_SOURCE_DIR_RELATIVE}")
         endif()
+        # cmake adds a module_EXPORTS define when compiling a module or a shared library. We don't use that.
+        get_target_property(_type ${name} TYPE)
+        if (_type MATCHES SHARED_LIBRARY|MODULE_LIBRARY)
+            set_target_properties(${name} PROPERTIES DEFINE_SYMBOL "")
+        endif()
     endfunction()
 
     function(add_executable name)
@@ -552,6 +571,15 @@ elseif(USE_FOLDER_STRUCTURE)
         string(SUBSTRING ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR_LENGTH} -1 CMAKE_CURRENT_SOURCE_DIR_RELATIVE)
         set_property(TARGET "${name}" PROPERTY FOLDER "${CMAKE_CURRENT_SOURCE_DIR_RELATIVE}")
     endfunction()
+else()
+    function(add_library name)
+        _add_library(${name} ${ARGN})
+        # cmake adds a module_EXPORTS define when compiling a module or a shared library. We don't use that.
+        get_target_property(_type ${name} TYPE)
+        if (_type MATCHES SHARED_LIBRARY|MODULE_LIBRARY)
+            set_target_properties(${name} PROPERTIES DEFINE_SYMBOL "")
+        endif()
+    endfunction()
 endif()
 
 if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
@@ -811,7 +839,7 @@ function(create_registry_hives)
     # BootCD setup system hive
     add_custom_command(
         OUTPUT ${CMAKE_BINARY_DIR}/boot/bootdata/SETUPREG.HIV
-        COMMAND native-mkhive -h:SETUPREG -u -d:${CMAKE_BINARY_DIR}/boot/bootdata ${CMAKE_BINARY_DIR}/boot/bootdata/hivesys_utf16.inf
+        COMMAND native-mkhive -h:SETUPREG -u -d:${CMAKE_BINARY_DIR}/boot/bootdata ${CMAKE_BINARY_DIR}/boot/bootdata/hivesys_utf16.inf ${CMAKE_SOURCE_DIR}/boot/bootdata/setupreg.inf
         DEPENDS native-mkhive ${CMAKE_BINARY_DIR}/boot/bootdata/hivesys_utf16.inf)
 
     add_custom_target(bootcd_hives
@@ -827,8 +855,14 @@ function(create_registry_hives)
     # LiveCD hives
     list(APPEND _livecd_inf_files
         ${_registry_inf}
-        ${CMAKE_SOURCE_DIR}/boot/bootdata/livecd.inf
-        ${CMAKE_SOURCE_DIR}/boot/bootdata/hiveinst.inf)
+        ${CMAKE_SOURCE_DIR}/boot/bootdata/livecd.inf)
+    if(SARCH STREQUAL "xbox")
+        list(APPEND _livecd_inf_files
+            ${CMAKE_SOURCE_DIR}/boot/bootdata/hiveinst_xbox.inf)
+    else()
+        list(APPEND _livecd_inf_files
+            ${CMAKE_SOURCE_DIR}/boot/bootdata/hiveinst.inf)
+    endif()
 
     add_custom_command(
         OUTPUT ${CMAKE_BINARY_DIR}/boot/bootdata/system