https://git.reactos.org/?p=reactos.git;a=commitdiff;h=907025a01858fc7c6345a…
commit 907025a01858fc7c6345a5b7ae8b97e38d359d7d
Author: Jérôme Gardou <jerome.gardou(a)reactos.org>
AuthorDate: Fri Sep 18 11:08:58 2020 +0200
Commit: Jérôme Gardou <zefklop(a)users.noreply.github.com>
CommitDate: Tue Oct 20 21:44:54 2020 +0200
[CMAKE] Introduce the atl_classes interface library
This takes care of adding the relvant include directory and the _ATL_NO_EXCEPTIONS
define, if needed
---
base/applications/charmap_new/CMakeLists.txt | 3 +--
base/applications/drwtsn32/CMakeLists.txt | 3 +--
base/applications/fltmc/CMakeLists.txt | 4 +---
base/applications/msconfig_new/CMakeLists.txt | 5 ++---
base/applications/mspaint/CMakeLists.txt | 4 +---
base/applications/rapps/CMakeLists.txt | 6 ++----
base/shell/explorer/CMakeLists.txt | 5 +----
base/shell/rshell/CMakeLists.txt | 9 ++-------
dll/shellext/acppage/CMakeLists.txt | 6 +-----
dll/shellext/fontext/CMakeLists.txt | 8 +-------
dll/shellext/mydocs/CMakeLists.txt | 9 ++-------
dll/shellext/netshell/CMakeLists.txt | 7 +------
dll/shellext/ntobjshex/CMakeLists.txt | 10 +---------
dll/shellext/sendmail/CMakeLists.txt | 9 ++-------
dll/shellext/stobject/CMakeLists.txt | 9 +--------
dll/shellext/zipfldr/CMakeLists.txt | 6 +-----
dll/win32/browseui/CMakeLists.txt | 6 +-----
dll/win32/browseui/shellbars/CMakeLists.txt | 6 ++----
dll/win32/browseui/shellfind/CMakeLists.txt | 6 ++----
dll/win32/devmgr/CMakeLists.txt | 3 +--
dll/win32/msgina/CMakeLists.txt | 10 +---------
dll/win32/shell32/CMakeLists.txt | 9 ++-------
dll/win32/shell32/shelldesktop/CMakeLists.txt | 7 +++----
dll/win32/shell32/shellmenu/CMakeLists.txt | 8 +++-----
dll/win32/shell32/shellrecyclebin/CMakeLists.txt | 3 +--
dll/win32/shlwapi/CMakeLists.txt | 11 +++++------
.../rosapps/applications/devutils/shlextdbg/CMakeLists.txt | 6 +-----
modules/rostests/apitests/apphelp/CMakeLists.txt | 9 ++-------
modules/rostests/apitests/atl/CMakeLists.txt | 4 +---
modules/rostests/apitests/browseui/CMakeLists.txt | 4 +---
modules/rostests/apitests/fontext/CMakeLists.txt | 9 ++-------
modules/rostests/apitests/msgina/CMakeLists.txt | 8 +-------
modules/rostests/apitests/shell32/CMakeLists.txt | 9 ++-------
modules/rostests/apitests/zipfldr/CMakeLists.txt | 4 +---
sdk/lib/CMakeLists.txt | 1 +
sdk/lib/atl/CMakeLists.txt | 8 ++++++++
36 files changed, 62 insertions(+), 172 deletions(-)
diff --git a/base/applications/charmap_new/CMakeLists.txt
b/base/applications/charmap_new/CMakeLists.txt
index 0e260478191..06616bf0bca 100644
--- a/base/applications/charmap_new/CMakeLists.txt
+++ b/base/applications/charmap_new/CMakeLists.txt
@@ -6,7 +6,6 @@ if(NOT MSVC)
endif()
include_directories(
- ${REACTOS_SOURCE_DIR}/sdk/lib/atl
includes)
list(APPEND SOURCE
@@ -19,7 +18,7 @@ add_library(charmap MODULE
charmap.rc)
set_module_type(charmap win32gui UNICODE)
-target_link_libraries(charmap uuid wine cpprt)
+target_link_libraries(charmap uuid wine cpprt atl_classes)
set_target_cpp_properties(charmap WITH_EXCEPTIONS WITH_RTTI)
add_importlibs(charmap advapi32 user32 gdi32 comctl32 version msvcrt kernel32 ole32
uxtheme ntdll)
add_pch(charmap precomp.h SOURCE)
diff --git a/base/applications/drwtsn32/CMakeLists.txt
b/base/applications/drwtsn32/CMakeLists.txt
index 55d5f6ce497..953485004a1 100644
--- a/base/applications/drwtsn32/CMakeLists.txt
+++ b/base/applications/drwtsn32/CMakeLists.txt
@@ -2,7 +2,6 @@
PROJECT(drwtsn32)
include_directories(
- ${REACTOS_SOURCE_DIR}/sdk/lib/atl
${REACTOS_SOURCE_DIR}/sdk/lib/udmihelp)
list(APPEND CPP_SOURCE
@@ -16,7 +15,7 @@ list(APPEND CPP_SOURCE
add_executable(drwtsn32 ${CPP_SOURCE} drwtsn32.rc)
add_pch(drwtsn32 precomp.h CPP_SOURCE)
set_module_type(drwtsn32 win32gui UNICODE)
-target_link_libraries(drwtsn32 udmihelp cppstl)
+target_link_libraries(drwtsn32 udmihelp cppstl atl_classes)
set_target_cpp_properties(drwtsn32 WITH_EXCEPTIONS)
add_importlibs(drwtsn32 dbghelp psapi advapi32 shell32 shlwapi msvcrt user32 kernel32
ntdll)
add_cd_file(TARGET drwtsn32 DESTINATION reactos/system32 FOR all)
diff --git a/base/applications/fltmc/CMakeLists.txt
b/base/applications/fltmc/CMakeLists.txt
index 3e0aa70635d..41774c407b0 100644
--- a/base/applications/fltmc/CMakeLists.txt
+++ b/base/applications/fltmc/CMakeLists.txt
@@ -2,10 +2,8 @@
remove_definitions(-D_WIN32_WINNT=0x502 -DWINVER=0x502)
add_definitions(-D_WIN32_WINNT=0x601)
-include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl)
-
add_executable(fltmc fltmc.cpp fltmc.rc)
-target_link_libraries(fltmc cpprt)
+target_link_libraries(fltmc cpprt atl_classes)
set_target_cpp_properties(fltmc WITH_EXCEPTIONS)
set_module_type(fltmc win32cui UNICODE)
add_importlibs(fltmc fltlib msvcrt kernel32 advapi32)
diff --git a/base/applications/msconfig_new/CMakeLists.txt
b/base/applications/msconfig_new/CMakeLists.txt
index 5d8ebbe3bd9..a44f4597383 100644
--- a/base/applications/msconfig_new/CMakeLists.txt
+++ b/base/applications/msconfig_new/CMakeLists.txt
@@ -4,8 +4,7 @@ PROJECT(msconfig_new)
include_directories(
.
comctl32ex
- ${REACTOS_SOURCE_DIR}/sdk/include/c++
- ${REACTOS_SOURCE_DIR}/sdk/lib/atl)
+ ${REACTOS_SOURCE_DIR}/sdk/include/c++)
list(APPEND C_SOURCE
comctl32ex/comctl32supp.c
@@ -33,7 +32,7 @@ add_rc_deps(msconfig.rc ${CMAKE_CURRENT_SOURCE_DIR}/res/msconfig.ico)
add_executable(msconfig_new ${C_SOURCE} ${CPP_SOURCE} msconfig.rc)
add_pch(msconfig_new precomp.h CPP_SOURCE)
set_module_type(msconfig_new win32gui UNICODE)
-target_link_libraries(msconfig_new comsupp cpprt)
+target_link_libraries(msconfig_new comsupp cpprt atl_classes)
set_target_cpp_properties(msconfig_new WITH_EXCEPTIONS)
add_importlibs(msconfig_new user32 gdi32 comctl32 comdlg32 advapi32 version ole32
oleaut32 msxml3 shell32 shlwapi msvcrt kernel32)
add_cd_file(TARGET msconfig_new DESTINATION reactos/system32 FOR all)
diff --git a/base/applications/mspaint/CMakeLists.txt
b/base/applications/mspaint/CMakeLists.txt
index c5ba106ba85..fcf694a08ca 100644
--- a/base/applications/mspaint/CMakeLists.txt
+++ b/base/applications/mspaint/CMakeLists.txt
@@ -2,8 +2,6 @@ project(MSPAINT)
add_definitions(-DINITGUID)
-include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl)
-
list(APPEND SOURCE
dialogs.cpp
dib.cpp
@@ -32,7 +30,7 @@ file(GLOB mspaint_rc_deps icons/*.*)
add_rc_deps(rsrc.rc ${mspaint_rc_deps})
add_executable(mspaint ${SOURCE} rsrc.rc)
set_module_type(mspaint win32gui UNICODE)
-target_link_libraries(mspaint uuid cpprt)
+target_link_libraries(mspaint uuid cpprt atl_classes)
set_target_cpp_properties(mspaint WITH_EXCEPTIONS)
add_importlibs(mspaint hhctrl comdlg32 shell32 user32 gdi32 advapi32 comctl32 msvcrt
kernel32 rpcrt4 shlwapi)
add_pch(mspaint precomp.h SOURCE)
diff --git a/base/applications/rapps/CMakeLists.txt
b/base/applications/rapps/CMakeLists.txt
index 0616ddd4468..cb559b5509d 100644
--- a/base/applications/rapps/CMakeLists.txt
+++ b/base/applications/rapps/CMakeLists.txt
@@ -1,6 +1,5 @@
project(rapps)
-include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl)
include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/cryptlib)
include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/conutils)
include_directories(include)
@@ -37,14 +36,13 @@ list(APPEND SOURCE
)
add_definitions(
- -DUSE_CERT_PINNING
- -D_ATL_NO_EXCEPTIONS)
+ -DUSE_CERT_PINNING)
file(GLOB_RECURSE rapps_rc_deps res/*.*)
add_rc_deps(rapps.rc ${rapps_rc_deps})
add_executable(rapps ${SOURCE} rapps.rc)
set_module_type(rapps win32cui UNICODE)
-target_link_libraries(rapps conutils ${PSEH_LIB} uuid wine cpprt)
+target_link_libraries(rapps conutils ${PSEH_LIB} uuid wine cpprt atl_classes)
add_importlibs(rapps advapi32 comctl32 gdi32 wininet user32 shell32 shlwapi ole32
setupapi gdiplus msvcrt kernel32 ntdll)
add_pch(rapps include/rapps.h SOURCE)
add_dependencies(rapps rappsmsg)
diff --git a/base/shell/explorer/CMakeLists.txt b/base/shell/explorer/CMakeLists.txt
index 33d90444fbf..743c10d33b2 100644
--- a/base/shell/explorer/CMakeLists.txt
+++ b/base/shell/explorer/CMakeLists.txt
@@ -1,8 +1,5 @@
PROJECT(SHELL)
-add_definitions(-D_ATL_NO_EXCEPTIONS)
-include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl)
-
list(APPEND SOURCE
appbar.cpp
desktop.cpp
@@ -30,7 +27,7 @@ list(APPEND SOURCE
file(GLOB explorer_rc_deps res/*.*)
add_rc_deps(explorer.rc ${explorer_rc_deps})
add_executable(explorer ${SOURCE} explorer.rc)
-target_link_libraries(explorer uuid wine cpprt)
+target_link_libraries(explorer uuid wine cpprt atl_classes)
set_module_type(explorer win32gui UNICODE)
add_importlibs(explorer advapi32 gdi32 user32 comctl32 ole32 oleaut32 shell32 browseui
shlwapi shdocvw version uxtheme msvcrt kernel32 ntdll)
add_pch(explorer precomp.h SOURCE)
diff --git a/base/shell/rshell/CMakeLists.txt b/base/shell/rshell/CMakeLists.txt
index c47a121699f..8397a0124f6 100644
--- a/base/shell/rshell/CMakeLists.txt
+++ b/base/shell/rshell/CMakeLists.txt
@@ -1,11 +1,5 @@
PROJECT(SHELL)
-add_definitions(
- -D_ATL_NO_EXCEPTIONS)
-
-include_directories(
- ${REACTOS_SOURCE_DIR}/sdk/lib/atl)
-
spec2def(rshell.dll rshell.spec ADD_IMPORTLIB)
list(APPEND SOURCE
@@ -23,7 +17,8 @@ target_link_libraries(rshell
shelldesktop
uuid
wine
- cpprt)
+ cpprt
+ atl_classes)
add_importlibs(rshell
browseui
diff --git a/dll/shellext/acppage/CMakeLists.txt b/dll/shellext/acppage/CMakeLists.txt
index a8708a53b7f..fe694f869f2 100644
--- a/dll/shellext/acppage/CMakeLists.txt
+++ b/dll/shellext/acppage/CMakeLists.txt
@@ -6,11 +6,7 @@ if(NOT MSVC)
add_compile_flags_language("-std=c++11" "CXX")
endif()
-add_definitions(
- -D_ATL_NO_EXCEPTIONS)
-
include_directories(
- ${REACTOS_SOURCE_DIR}/sdk/lib/atl
${REACTOS_SOURCE_DIR}/dll/appcompat/apphelp
${REACTOS_SOURCE_DIR})
spec2def(acppage.dll acppage.spec ADD_IMPORTLIB)
@@ -31,7 +27,7 @@ add_library(acppage MODULE
${CMAKE_CURRENT_BINARY_DIR}/acppage.def)
set_module_type(acppage win32dll UNICODE)
-target_link_libraries(acppage wine uuid cpprt)
+target_link_libraries(acppage wine uuid cpprt atl_classes)
add_delay_importlibs(acppage apphelp ole32 oleaut32 shlwapi comctl32 sfc_os)
add_importlibs(acppage shell32 user32 advapi32 msvcrt kernel32)
add_pch(acppage precomp.h SOURCE)
diff --git a/dll/shellext/fontext/CMakeLists.txt b/dll/shellext/fontext/CMakeLists.txt
index 5ceac5671fa..b0ddec81245 100644
--- a/dll/shellext/fontext/CMakeLists.txt
+++ b/dll/shellext/fontext/CMakeLists.txt
@@ -1,15 +1,9 @@
-add_definitions(
- -D_ATL_NO_EXCEPTIONS)
-
remove_definitions(-D_WIN32_WINNT=0x502 -DWINVER=0x502)
add_definitions(-D_WIN32_WINNT=0x601 -DWINVER=0x601)
-
spec2def(fontext.dll fontext.spec)
-include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl)
-
list(APPEND SOURCE
CDataObject.cpp
CEnumFonts.cpp
@@ -31,7 +25,7 @@ add_library(fontext MODULE
${CMAKE_CURRENT_BINARY_DIR}/fontext.def)
set_module_type(fontext win32dll UNICODE)
-target_link_libraries(fontext uuid wine cpprt)
+target_link_libraries(fontext uuid wine cpprt atl_classes)
add_delay_importlibs(fontext ole32 oleaut32 shlwapi gdi32)
add_importlibs(fontext shell32 advapi32 user32 msvcrt kernel32 ntdll)
add_pch(fontext precomp.h SOURCE)
diff --git a/dll/shellext/mydocs/CMakeLists.txt b/dll/shellext/mydocs/CMakeLists.txt
index 4abbd640d6d..b74998e6603 100644
--- a/dll/shellext/mydocs/CMakeLists.txt
+++ b/dll/shellext/mydocs/CMakeLists.txt
@@ -1,18 +1,13 @@
spec2def(mydocs.dll mydocs.spec)
add_definitions(
- -D_WINE
- -D_ATL_NO_EXCEPTIONS)
+ -D_WINE)
if(NOT MSVC)
# HACK: this should be enabled globally!
add_compile_flags_language("-std=c++11" "CXX")
endif()
-include_directories(
- ${REACTOS_SOURCE_DIR}/sdk/lib/atl
- ${REACTOS_SOURCE_DIR})
-
file(GLOB_RECURSE mydocs_rc_deps res/*.*)
add_rc_deps(mydocs.rc ${mydocs_rc_deps})
@@ -27,7 +22,7 @@ add_library(mydocs MODULE
${CMAKE_CURRENT_BINARY_DIR}/mydocs.def)
set_module_type(mydocs win32dll UNICODE)
-target_link_libraries(mydocs uuid wine cpprt)
+target_link_libraries(mydocs uuid wine cpprt atl_classes)
add_delay_importlibs(mydocs ole32 oleaut32)
add_importlibs(mydocs advapi32 shell32 user32 comctl32 shlwapi msvcrt kernel32 ntdll)
add_pch(mydocs precomp.hpp SOURCE)
diff --git a/dll/shellext/netshell/CMakeLists.txt b/dll/shellext/netshell/CMakeLists.txt
index 4302187660d..48ce800d927 100644
--- a/dll/shellext/netshell/CMakeLists.txt
+++ b/dll/shellext/netshell/CMakeLists.txt
@@ -10,11 +10,6 @@ endif()
remove_definitions(-D_WIN32_WINNT=0x502)
add_definitions(-D_WIN32_WINNT=0x600)
-add_definitions(
- -D_ATL_NO_EXCEPTIONS)
-
-include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl)
-
add_definitions(-D_NETSHELL_)
spec2def(netshell.dll netshell.spec)
@@ -40,7 +35,7 @@ add_library(netshell MODULE
${CMAKE_CURRENT_BINARY_DIR}/netshell.def)
set_module_type(netshell win32dll UNICODE)
-target_link_libraries(netshell uuid wine cpprt)
+target_link_libraries(netshell uuid wine cpprt atl_classes)
add_delay_importlibs(netshell ole32 oleaut32 shlwapi shell32)
add_importlibs(netshell version iphlpapi gdi32 user32 advapi32 setupapi ws2_32 comctl32
msvcrt kernel32 ntdll)
add_pch(netshell precomp.h "${PCH_SKIP_SOURCE}")
diff --git a/dll/shellext/ntobjshex/CMakeLists.txt
b/dll/shellext/ntobjshex/CMakeLists.txt
index 91132a405c0..3ecdae1a263 100644
--- a/dll/shellext/ntobjshex/CMakeLists.txt
+++ b/dll/shellext/ntobjshex/CMakeLists.txt
@@ -1,19 +1,11 @@
project(SHELL)
-add_definitions(
- -D_ATL_NO_EXCEPTIONS)
-
-
if(NOT MSVC)
# HACK: this should be enabled globally!
add_compile_flags_language("-std=c++11" "CXX")
endif()
-include_directories(
- ${REACTOS_SOURCE_DIR}/sdk/lib/atl
- ${REACTOS_SOURCE_DIR})
-
spec2def(ntobjshex.dll ntobjshex.spec)
file(GLOB_RECURSE ntobjshex_rc_deps resources/*.*)
@@ -32,7 +24,7 @@ add_library(ntobjshex MODULE
${CMAKE_CURRENT_BINARY_DIR}/ntobjshex.def)
set_module_type(ntobjshex win32dll UNICODE)
-target_link_libraries(ntobjshex uuid wine cpprt)
+target_link_libraries(ntobjshex uuid wine cpprt atl_classes)
add_importlibs(ntobjshex
advapi32
diff --git a/dll/shellext/sendmail/CMakeLists.txt b/dll/shellext/sendmail/CMakeLists.txt
index 52d0a3943ca..5adbf3a847f 100644
--- a/dll/shellext/sendmail/CMakeLists.txt
+++ b/dll/shellext/sendmail/CMakeLists.txt
@@ -1,18 +1,13 @@
spec2def(sendmail.dll sendmail.spec)
add_definitions(
- -D_WINE
- -D_ATL_NO_EXCEPTIONS)
+ -D_WINE)
if(NOT MSVC)
# HACK: this should be enabled globally!
add_compile_flags_language("-std=c++11" "CXX")
endif()
-include_directories(
- ${REACTOS_SOURCE_DIR}/sdk/lib/atl
- ${REACTOS_SOURCE_DIR})
-
file(GLOB_RECURSE sendmail_rc_deps res/*.*)
add_rc_deps(sendmail.rc ${sendmail_rc_deps})
@@ -27,7 +22,7 @@ add_library(sendmail MODULE
${CMAKE_CURRENT_BINARY_DIR}/sendmail.def)
set_module_type(sendmail win32dll UNICODE)
-target_link_libraries(sendmail uuid wine cpprt)
+target_link_libraries(sendmail uuid wine cpprt atl_classes)
add_delay_importlibs(sendmail ole32 oleaut32)
add_importlibs(sendmail advapi32 shell32 user32 comctl32 shlwapi msvcrt kernel32 ntdll)
add_pch(sendmail precomp.hpp SOURCE)
diff --git a/dll/shellext/stobject/CMakeLists.txt b/dll/shellext/stobject/CMakeLists.txt
index 15d9206589b..f5c67cc58f6 100644
--- a/dll/shellext/stobject/CMakeLists.txt
+++ b/dll/shellext/stobject/CMakeLists.txt
@@ -6,13 +6,6 @@ if(NOT MSVC)
add_compile_flags_language("-std=c++11" "CXX")
endif()
-include_directories(
- ${REACTOS_SOURCE_DIR}/sdk/lib/atl
- ${REACTOS_SOURCE_DIR})
-
-add_definitions(
- -D_ATL_NO_EXCEPTIONS)
-
spec2def(stobject.dll stobject.spec)
file(GLOB_RECURSE stobject_rc_deps resources/*.*)
@@ -32,7 +25,7 @@ add_library(stobject MODULE
${CMAKE_CURRENT_BINARY_DIR}/stobject.def)
set_module_type(stobject win32dll UNICODE)
-target_link_libraries(stobject uuid wine cpprt)
+target_link_libraries(stobject uuid wine cpprt atl_classes)
add_importlibs(stobject
setupapi
diff --git a/dll/shellext/zipfldr/CMakeLists.txt b/dll/shellext/zipfldr/CMakeLists.txt
index 4459b9d60d6..106a8860f74 100644
--- a/dll/shellext/zipfldr/CMakeLists.txt
+++ b/dll/shellext/zipfldr/CMakeLists.txt
@@ -7,12 +7,8 @@ endif()
remove_definitions(-D_WIN32_WINNT=0x502)
add_definitions(-D_WIN32_WINNT=0x600)
-add_definitions(
- -D_ATL_NO_EXCEPTIONS)
-
include_directories(
${REACTOS_SOURCE_DIR}/sdk/include/reactos/libs/zlib
- ${REACTOS_SOURCE_DIR}/sdk/lib/atl
${REACTOS_SOURCE_DIR}/sdk/lib/3rdparty/zlib/contrib)
spec2def(zipfldr.dll zipfldr.spec ADD_IMPORTLIB)
@@ -46,7 +42,7 @@ add_library(zipfldr MODULE
set_module_type(zipfldr win32dll UNICODE)
-target_link_libraries(zipfldr minizip zlib uuid cpprt)
+target_link_libraries(zipfldr minizip zlib uuid cpprt atl_classes)
set_target_cpp_properties(zipfldr WITH_EXCEPTIONS)
add_importlibs(zipfldr oleaut32 ole32 shlwapi comctl32 shell32 user32 advapi32 msvcrt
kernel32 ntdll)
add_pch(zipfldr precomp.h SOURCE)
diff --git a/dll/win32/browseui/CMakeLists.txt b/dll/win32/browseui/CMakeLists.txt
index 1aa48b83117..8cb68cf9efa 100644
--- a/dll/win32/browseui/CMakeLists.txt
+++ b/dll/win32/browseui/CMakeLists.txt
@@ -3,10 +3,6 @@ PROJECT(SHELL)
add_subdirectory(shellbars)
add_subdirectory(shellfind)
-add_definitions(
- -D_ATL_NO_EXCEPTIONS)
-
-include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl)
spec2def(browseui.dll browseui.spec ADD_IMPORTLIB)
list(APPEND SOURCE
@@ -47,7 +43,7 @@ add_library(browseui MODULE
${CMAKE_CURRENT_BINARY_DIR}/browseui.def)
set_module_type(browseui win32dll UNICODE)
-target_link_libraries(browseui shellbars shellfind uuid wine cpprt)
+target_link_libraries(browseui shellbars shellfind uuid wine cpprt atl_classes)
add_importlibs(browseui uxtheme shlwapi shell32 comctl32 gdi32 ole32 oleaut32 user32
advapi32 mpr msvcrt kernel32 ntdll)
add_pch(browseui precomp.h "${PCH_SKIP_SOURCE}")
add_cd_file(TARGET browseui DESTINATION reactos/system32 FOR all)
diff --git a/dll/win32/browseui/shellbars/CMakeLists.txt
b/dll/win32/browseui/shellbars/CMakeLists.txt
index 221de1777b2..360c785e5c3 100644
--- a/dll/win32/browseui/shellbars/CMakeLists.txt
+++ b/dll/win32/browseui/shellbars/CMakeLists.txt
@@ -2,9 +2,6 @@
PROJECT(SHELL)
add_definitions(-DUNICODE -D_UNICODE)
-add_definitions(-D_ATL_NO_EXCEPTIONS)
-
-include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl)
list(APPEND SOURCE
CBandSite.cpp
@@ -14,7 +11,8 @@ list(APPEND SOURCE
CSHEnumClassesOfCategories.cpp
shellbars.h)
-add_library(shellbars ${SOURCE})
+add_library(shellbars OBJECT ${SOURCE})
+target_link_libraries(shellbars PRIVATE atl_classes)
if(NOT MSVC)
target_compile_options(shellbars PRIVATE "-Wno-unused-but-set-variable")
diff --git a/dll/win32/browseui/shellfind/CMakeLists.txt
b/dll/win32/browseui/shellfind/CMakeLists.txt
index 5900ed9ae11..72f15422fcd 100644
--- a/dll/win32/browseui/shellfind/CMakeLists.txt
+++ b/dll/win32/browseui/shellfind/CMakeLists.txt
@@ -2,16 +2,14 @@
PROJECT(SHELL)
add_definitions(-DUNICODE -D_UNICODE)
-add_definitions(-D_ATL_NO_EXCEPTIONS)
-
-include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl)
list(APPEND SOURCE
CSearchBar.cpp
CFindFolder.cpp
shellfind.h)
-add_library(shellfind ${SOURCE})
+add_library(shellfind OBJECT ${SOURCE})
+target_link_libraries(shellfind PRIVATE atl_classes)
if(NOT MSVC)
target_compile_options(shellfind PRIVATE "-Wno-unused-but-set-variable")
diff --git a/dll/win32/devmgr/CMakeLists.txt b/dll/win32/devmgr/CMakeLists.txt
index f805b3f9ae6..e86615f6e25 100644
--- a/dll/win32/devmgr/CMakeLists.txt
+++ b/dll/win32/devmgr/CMakeLists.txt
@@ -9,7 +9,6 @@ endif()
include_directories(
${REACTOS_SOURCE_DIR}/sdk/include/reactos/dll
- ${REACTOS_SOURCE_DIR}/sdk/lib/atl
includes)
list(APPEND SOURCE
@@ -33,7 +32,7 @@ add_library(devmgr MODULE
${CMAKE_CURRENT_BINARY_DIR}/devmgr.def)
set_module_type(devmgr win32dll UNICODE)
-target_link_libraries(devmgr uuid wine cpprt)
+target_link_libraries(devmgr uuid wine cpprt atl_classes)
set_target_cpp_properties(devmgr WITH_EXCEPTIONS WITH_RTTI)
add_importlibs(devmgr setupapi advapi32 shell32 newdev user32 gdi32 comctl32 version
msvcrt kernel32 ole32 oleaut32 uxtheme ntdll)
add_pch(devmgr precomp.h SOURCE)
diff --git a/dll/win32/msgina/CMakeLists.txt b/dll/win32/msgina/CMakeLists.txt
index 056b602788d..cbea4edcb14 100644
--- a/dll/win32/msgina/CMakeLists.txt
+++ b/dll/win32/msgina/CMakeLists.txt
@@ -1,12 +1,4 @@
-
-add_definitions(
- -D_ATL_NO_EXCEPTIONS)
-
-include_directories(
- ${REACTOS_SOURCE_DIR}/sdk/lib/atl
- ${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine)
-
spec2def(msgina.dll msgina.spec)
list(APPEND SOURCE
@@ -28,7 +20,7 @@ add_library(msgina MODULE
${CMAKE_CURRENT_BINARY_DIR}/msgina.def)
set_module_type(msgina win32dll UNICODE)
-target_link_libraries(msgina wine uuid ${PSEH_LIB} cpprt)
+target_link_libraries(msgina wine uuid ${PSEH_LIB} cpprt atl_classes)
add_delay_importlibs(msgina secur32)
add_importlibs(msgina advapi32 user32 gdi32 powrprof userenv msvcrt kernel32 ntdll)
add_pch(msgina msgina.h "${PCH_SKIP_SOURCE}")
diff --git a/dll/win32/shell32/CMakeLists.txt b/dll/win32/shell32/CMakeLists.txt
index a76c13af22e..88a11e013c8 100644
--- a/dll/win32/shell32/CMakeLists.txt
+++ b/dll/win32/shell32/CMakeLists.txt
@@ -21,12 +21,7 @@ add_definitions(-D_WIN32_WINNT=0x600)
add_definitions(
-D_SHELL32_
- -D_WINE
- -D_ATL_NO_EXCEPTIONS)
-
-include_directories(
- ${REACTOS_SOURCE_DIR}/sdk/lib/atl
- ${REACTOS_SOURCE_DIR})
+ -D_WINE)
list(APPEND SOURCE
CActiveDesktop.cpp
@@ -121,7 +116,7 @@ add_typelib(shell32_shldisp.idl)
set_source_files_properties(shell32.rc PROPERTIES OBJECT_DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/shell32_shldisp.tlb)
set_module_type(shell32 win32dll UNICODE)
-target_link_libraries(shell32 shellmenu shelldesktop wine uuid recyclebin cpprt)
+target_link_libraries(shell32 shellmenu shelldesktop wine uuid recyclebin cpprt
atl_classes)
add_delay_importlibs(shell32 powrprof shdocvw devmgr winspool.drv winmm mpr uxtheme ole32
oleaut32 userenv browseui version fmifs)
add_importlibs(shell32 advapi32 gdi32 user32 comctl32 comdlg32 shlwapi msvcrt kernel32
ntdll)
add_dependencies(shell32 stdole2) # shell32_shldisp.tlb needs stdole2.tlb
diff --git a/dll/win32/shell32/shelldesktop/CMakeLists.txt
b/dll/win32/shell32/shelldesktop/CMakeLists.txt
index 7da3e7b14a4..53fe4c4e460 100644
--- a/dll/win32/shell32/shelldesktop/CMakeLists.txt
+++ b/dll/win32/shell32/shelldesktop/CMakeLists.txt
@@ -2,10 +2,8 @@ project(SHELL)
add_definitions(
-DUNICODE
- -D_UNICODE
- -D_ATL_NO_EXCEPTIONS)
+ -D_UNICODE)
-include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl)
list(APPEND SOURCE
CChangeNotifyServer.cpp
@@ -14,5 +12,6 @@ list(APPEND SOURCE
CDirectoryList.cpp
dde.cpp)
-add_library(shelldesktop ${SOURCE})
+add_library(shelldesktop OBJECT ${SOURCE})
+target_link_libraries(shelldesktop PRIVATE atl_classes)
add_dependencies(shelldesktop xdk psdk)
diff --git a/dll/win32/shell32/shellmenu/CMakeLists.txt
b/dll/win32/shell32/shellmenu/CMakeLists.txt
index 94c04fc8515..01b813afa0f 100644
--- a/dll/win32/shell32/shellmenu/CMakeLists.txt
+++ b/dll/win32/shell32/shellmenu/CMakeLists.txt
@@ -2,10 +2,7 @@ project(SHELL)
add_definitions(
-DUNICODE
- -D_UNICODE
- -D_ATL_NO_EXCEPTIONS)
-
-include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl)
+ -D_UNICODE)
list(APPEND SOURCE
CMenuBand.cpp
@@ -16,5 +13,6 @@ list(APPEND SOURCE
CMergedFolder.cpp
CStartMenu.cpp)
-add_library(shellmenu ${SOURCE})
+add_library(shellmenu OBJECT ${SOURCE})
+target_link_libraries(shellmenu PRIVATE atl_classes)
add_dependencies(shellmenu xdk psdk)
diff --git a/dll/win32/shell32/shellrecyclebin/CMakeLists.txt
b/dll/win32/shell32/shellrecyclebin/CMakeLists.txt
index 5607bdbece2..627d4ae013a 100644
--- a/dll/win32/shell32/shellrecyclebin/CMakeLists.txt
+++ b/dll/win32/shell32/shellrecyclebin/CMakeLists.txt
@@ -2,8 +2,7 @@ project(SHELL)
add_definitions(
-DUNICODE
- -D_UNICODE
- -D_ATL_NO_EXCEPTIONS)
+ -D_UNICODE)
list(APPEND SOURCE
recyclebin.c
diff --git a/dll/win32/shlwapi/CMakeLists.txt b/dll/win32/shlwapi/CMakeLists.txt
index 0e166a33223..076aaa4dcd6 100644
--- a/dll/win32/shlwapi/CMakeLists.txt
+++ b/dll/win32/shlwapi/CMakeLists.txt
@@ -6,12 +6,8 @@ add_definitions(-D_WIN32_WINNT=0x600)
add_definitions(
-D__WINESRC__
- -D_SHLWAPI_
- -D_ATL_NO_EXCEPTIONS)
+ -D_SHLWAPI_)
-include_directories(BEFORE
- ${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine
- ${REACTOS_SOURCE_DIR}/sdk/lib/atl)
spec2def(shlwapi.dll shlwapi.spec ADD_IMPORTLIB)
list(APPEND SOURCE
@@ -41,8 +37,11 @@ add_library(shlwapi MODULE
shlwapi.rc
${CMAKE_CURRENT_BINARY_DIR}/shlwapi.def)
+# our C++ atlbase.h conflicts with the one from wine, so only use wine includes for C
+target_include_directories(shlwapi BEFORE PRIVATE
$<$<COMPILE_LANGUAGE:C>:${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine>)
+
set_module_type(shlwapi win32dll UNICODE)
-target_link_libraries(shlwapi uuid wine)
+target_link_libraries(shlwapi uuid wine cpprt atl_classes)
add_delay_importlibs(shlwapi userenv oleaut32 ole32 comdlg32 mpr mlang urlmon shell32
winmm version)
add_importlibs(shlwapi user32 gdi32 advapi32 wininet msvcrt kernel32 ntdll)
add_pch(shlwapi precomp.h "${PCH_SKIP_SOURCE}")
diff --git a/modules/rosapps/applications/devutils/shlextdbg/CMakeLists.txt
b/modules/rosapps/applications/devutils/shlextdbg/CMakeLists.txt
index 2f6541bb389..41686b7813c 100644
--- a/modules/rosapps/applications/devutils/shlextdbg/CMakeLists.txt
+++ b/modules/rosapps/applications/devutils/shlextdbg/CMakeLists.txt
@@ -1,11 +1,7 @@
-add_definitions(-D_ATL_NO_EXCEPTIONS)
-
-include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl)
-
add_executable(shlextdbg shlextdbg.cpp shlextdbg.rc)
set_module_type(shlextdbg win32cui UNICODE)
-target_link_libraries(shlextdbg uuid cpprt)
+target_link_libraries(shlextdbg uuid cpprt atl_classes)
add_importlibs(shlextdbg ole32 comctl32 shell32 user32 msvcrt kernel32)
add_cd_file(TARGET shlextdbg DESTINATION reactos/system32 FOR all)
diff --git a/modules/rostests/apitests/apphelp/CMakeLists.txt
b/modules/rostests/apitests/apphelp/CMakeLists.txt
index 6bf9ddc0739..11f81ad37a7 100644
--- a/modules/rostests/apitests/apphelp/CMakeLists.txt
+++ b/modules/rostests/apitests/apphelp/CMakeLists.txt
@@ -4,12 +4,7 @@ add_definitions(
-D__ROS_LONG64__
-DWINETEST_USE_DBGSTR_LONGLONG
-DUNICODE
- -D_UNICODE
- -D_ATL_NO_EXCEPTIONS)
-
-
-include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl
- ${CMAKE_CURRENT_BINARY_DIR})
+ -D_UNICODE)
list(APPEND SOURCE
apphelp.c
@@ -29,6 +24,6 @@ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/testdb.sdb
add_rc_deps(testdata.rc ${CMAKE_CURRENT_BINARY_DIR}/testdb.sdb)
add_executable(apphelp_apitest ${SOURCE})
set_module_type(apphelp_apitest win32cui)
-target_link_libraries(apphelp_apitest ${PSEH_LIB} cpprt)
+target_link_libraries(apphelp_apitest ${PSEH_LIB} cpprt atl_classes)
add_importlibs(apphelp_apitest advapi32 userenv version shlwapi msvcrt kernel32 ntdll)
add_rostests_file(TARGET apphelp_apitest)
diff --git a/modules/rostests/apitests/atl/CMakeLists.txt
b/modules/rostests/apitests/atl/CMakeLists.txt
index 11ca2fdd72c..555529b7e38 100644
--- a/modules/rostests/apitests/atl/CMakeLists.txt
+++ b/modules/rostests/apitests/atl/CMakeLists.txt
@@ -1,8 +1,6 @@
add_definitions(-DINITGUID -DWINETEST_USE_DBGSTR_LONGLONG)
-include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl)
-
list(APPEND SOURCE
atltypes.cpp
CAtlFileMapping.cpp
@@ -28,7 +26,7 @@ add_executable(atl_apitest
${PCH_SKIP_SOURCE}
atl_apitest.rc)
-target_link_libraries(atl_apitest wine uuid cpprt)
+target_link_libraries(atl_apitest wine uuid cpprt atl_classes)
set_target_cpp_properties(atl_apitest WITH_EXCEPTIONS)
set_module_type(atl_apitest win32cui)
add_importlibs(atl_apitest rpcrt4 ole32 oleaut32 msimg32 gdi32 advapi32 user32 msvcrt
kernel32 ntdll)
diff --git a/modules/rostests/apitests/browseui/CMakeLists.txt
b/modules/rostests/apitests/browseui/CMakeLists.txt
index 2ae9cc3b895..f1875d3a03f 100644
--- a/modules/rostests/apitests/browseui/CMakeLists.txt
+++ b/modules/rostests/apitests/browseui/CMakeLists.txt
@@ -5,7 +5,6 @@ if(NOT MSVC)
endif()
include_directories(
- ${REACTOS_SOURCE_DIR}/sdk/lib/atl
includes)
list(APPEND SOURCE
@@ -16,8 +15,7 @@ list(APPEND SOURCE
testlist.c)
add_executable(browseui_apitest ${SOURCE})
-target_link_libraries(browseui_apitest uuid wine cpprt)
-
+target_link_libraries(browseui_apitest uuid wine cpprt atl_classes)
set_target_cpp_properties(browseui_apitest WITH_EXCEPTIONS WITH_RTTI)
set_module_type(browseui_apitest win32cui)
add_importlibs(browseui_apitest advapi32 shell32 ole32 shlwapi msvcrt kernel32 ntdll)
diff --git a/modules/rostests/apitests/fontext/CMakeLists.txt
b/modules/rostests/apitests/fontext/CMakeLists.txt
index aca32f42f27..0cb5e6a637a 100644
--- a/modules/rostests/apitests/fontext/CMakeLists.txt
+++ b/modules/rostests/apitests/fontext/CMakeLists.txt
@@ -3,12 +3,7 @@ add_definitions(
-D__ROS_LONG64__
-DWINETEST_USE_DBGSTR_LONGLONG
-DUNICODE
- -D_UNICODE
- -D_ATL_NO_EXCEPTIONS)
-
-
-include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl
- ${CMAKE_CURRENT_BINARY_DIR})
+ -D_UNICODE)
list(APPEND SOURCE
shellext.cpp
@@ -16,6 +11,6 @@ list(APPEND SOURCE
add_executable(fontext_apitest ${SOURCE})
set_module_type(fontext_apitest win32cui)
-target_link_libraries(fontext_apitest uuid ${PSEH_LIB} cpprt)
+target_link_libraries(fontext_apitest uuid ${PSEH_LIB} cpprt atl_classes)
add_importlibs(fontext_apitest oleaut32 ole32 shell32 user32 msvcrt kernel32 ntdll)
add_rostests_file(TARGET fontext_apitest)
diff --git a/modules/rostests/apitests/msgina/CMakeLists.txt
b/modules/rostests/apitests/msgina/CMakeLists.txt
index 9b873773950..a799fa56659 100644
--- a/modules/rostests/apitests/msgina/CMakeLists.txt
+++ b/modules/rostests/apitests/msgina/CMakeLists.txt
@@ -1,15 +1,9 @@
-add_definitions(
- -D_ATL_NO_EXCEPTIONS)
-
-
-include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl)
-
add_executable(msgina_apitest
ShellDimScreen.cpp
testlist.c)
-target_link_libraries(msgina_apitest wine uuid cpprt)
+target_link_libraries(msgina_apitest wine uuid cpprt atl_classes)
set_module_type(msgina_apitest win32cui)
add_importlibs(msgina_apitest msvcrt user32 kernel32)
add_rostests_file(TARGET msgina_apitest)
diff --git a/modules/rostests/apitests/shell32/CMakeLists.txt
b/modules/rostests/apitests/shell32/CMakeLists.txt
index 39c81e5e59e..81b40767113 100644
--- a/modules/rostests/apitests/shell32/CMakeLists.txt
+++ b/modules/rostests/apitests/shell32/CMakeLists.txt
@@ -1,11 +1,6 @@
-add_definitions(
- -D_ATL_NO_EXCEPTIONS)
-
spec2def(shell32_apitest.exe shell32_apitest.spec)
-include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl)
-
list(APPEND SOURCE
AddCommas.cpp
CFSFolder.cpp
@@ -44,7 +39,7 @@ add_executable(shell32_apitest
resource.rc
${CMAKE_CURRENT_BINARY_DIR}/shell32_apitest.def)
-target_link_libraries(shell32_apitest wine uuid ${PSEH_LIB} cpprt)
+target_link_libraries(shell32_apitest wine uuid ${PSEH_LIB} cpprt atl_classes)
set_module_type(shell32_apitest win32cui)
add_importlibs(shell32_apitest user32 gdi32 shell32 ole32 oleaut32 advapi32 shlwapi
msvcrt kernel32 ntdll)
add_pch(shell32_apitest shelltest.h "${PCH_SKIP_SOURCE}")
@@ -52,7 +47,7 @@ add_rostests_file(TARGET shell32_apitest)
# shell-notify.exe
add_executable(shell-notify shell-notify.cpp)
-target_link_libraries(shell-notify cpprt)
+target_link_libraries(shell-notify cpprt atl_classes)
set_module_type(shell-notify win32gui UNICODE)
add_importlibs(shell-notify msvcrt kernel32 user32 shell32 shlwapi ole32)
add_rostests_file(TARGET shell-notify SUBDIR testdata)
diff --git a/modules/rostests/apitests/zipfldr/CMakeLists.txt
b/modules/rostests/apitests/zipfldr/CMakeLists.txt
index 9bda3bd9b2c..89e460867e9 100644
--- a/modules/rostests/apitests/zipfldr/CMakeLists.txt
+++ b/modules/rostests/apitests/zipfldr/CMakeLists.txt
@@ -1,6 +1,4 @@
-include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl)
-
list(APPEND SOURCE
EnumObjects.cpp
EnumParentDir.cpp
@@ -14,7 +12,7 @@ add_executable(zipfldr_apitest
${PCH_SKIP_SOURCE}
zipfldr_apitest.rc)
-target_link_libraries(zipfldr_apitest wine uuid cpprt)
+target_link_libraries(zipfldr_apitest wine uuid cpprt atl_classes)
set_target_cpp_properties(zipfldr_apitest WITH_EXCEPTIONS)
set_module_type(zipfldr_apitest win32cui)
add_importlibs(zipfldr_apitest shlwapi ole32 shell32 user32 msvcrt kernel32 ntdll)
diff --git a/sdk/lib/CMakeLists.txt b/sdk/lib/CMakeLists.txt
index 60b2844566b..0e75364c440 100644
--- a/sdk/lib/CMakeLists.txt
+++ b/sdk/lib/CMakeLists.txt
@@ -1,4 +1,5 @@
+add_subdirectory(atl)
add_subdirectory(cmlib)
add_subdirectory(inflib)
diff --git a/sdk/lib/atl/CMakeLists.txt b/sdk/lib/atl/CMakeLists.txt
new file mode 100644
index 00000000000..6923a49bb8f
--- /dev/null
+++ b/sdk/lib/atl/CMakeLists.txt
@@ -0,0 +1,8 @@
+
+add_library(atl_classes INTERFACE)
+
+target_include_directories(atl_classes INTERFACE
+ $<$<COMPILE_LANGUAGE:CXX>:${CMAKE_CURRENT_SOURCE_DIR}>)
+
+target_compile_definitions(atl_classes INTERFACE
+
"$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<NOT:$<BOOL:$<TARGET_PROPERTY:WITH_CXX_EXCEPTIONS>>>>:_ATL_NO_EXCEPTIONS>")