From 9330354d177908fcbd17e84b95d28d2e530814d9 Mon Sep 17 00:00:00 2001 From: huangjianxiong1 Date: Wed, 20 Sep 2023 18:28:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dcmake=E7=9A=84=E9=9D=99?= =?UTF-8?q?=E6=80=81=E5=BA=93=E7=BC=96=E8=AF=91=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demo/CMakeLists.txt | 15 +++++++++++++++ demo2/CMakeLists.txt | 16 ++++++++++++++-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/demo/CMakeLists.txt b/demo/CMakeLists.txt index 85f5fdf28..9bc95996e 100644 --- a/demo/CMakeLists.txt +++ b/demo/CMakeLists.txt @@ -109,6 +109,16 @@ source_group("SoUI Resouece" FILES ${CURRENT_SOUIS}) source_group("Resource Files" FILES ${CURRENT_RC}) source_group("Extend Cotrols" FILES ${EXTENDCOTROLS}) + +if(MSVC_VERSION LESS_EQUAL 1500 AND ENABLE_SOUI_COM_LIB) +message("vs is less than vs2008") +if (CMAKE_CL_64) + link_directories("${PROJECT_SOURCE_DIR}/components/render-d2d/sdk7.1_d2d/lib/x64") +else () + link_directories("${PROJECT_SOURCE_DIR}/components/render-d2d/sdk7.1_d2d/lib/x86") +endif () +endif() + if (CMAKE_CL_64) if("${CMAKE_GENERATOR_PLATFORM}" MATCHES "ARM64") link_directories(${PROJECT_SOURCE_DIR}/bin64a) @@ -127,6 +137,11 @@ target_link_libraries(demo soui4 utilities4 smiley) else() target_link_libraries(demo soui4 utilities4 mhook smiley) endif() + +if(ENABLE_SOUI_COM_LIB) + target_link_libraries(demo d2d1.lib dwrite.lib) +endif() + set_target_properties (demo PROPERTIES FOLDER demos ) diff --git a/demo2/CMakeLists.txt b/demo2/CMakeLists.txt index e9a5176a3..ef670213f 100644 --- a/demo2/CMakeLists.txt +++ b/demo2/CMakeLists.txt @@ -17,6 +17,15 @@ source_group("Source Files" FILES ${CURRENT_SRCS}) source_group("SoUI Resouece" FILES ${CURRENT_SOUIS}) source_group("Resource Files" FILES ${CURRENT_RC}) +if(MSVC_VERSION LESS_EQUAL 1500 AND ENABLE_SOUI_COM_LIB) +message("vs is less than vs2008") +if (CMAKE_CL_64) + link_directories("${PROJECT_SOURCE_DIR}/components/render-d2d/sdk7.1_d2d/lib/x64") +else () + link_directories("${PROJECT_SOURCE_DIR}/components/render-d2d/sdk7.1_d2d/lib/x86") +endif () +endif() + if (CMAKE_CL_64) if("${CMAKE_GENERATOR_PLATFORM}" MATCHES "ARM64") link_directories(${PROJECT_SOURCE_DIR}/bin64a) @@ -28,16 +37,19 @@ else () endif () add_executable(demo2 WIN32 ${CURRENT_HEADERS} ${CURRENT_SRCS} ${CURRENT_SOUIS} ${CURRENT_RC}) -#set_target_properties(demo2 PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX}) +set_target_properties(demo2 PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX}) if(MSVC) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO") else() target_link_libraries(demo2 -municode) - endif() add_dependencies(demo2 soui-sys-resource render-gdi imgdecoder-gdip) target_link_libraries(demo2 soui4 utilities4) +if(ENABLE_SOUI_COM_LIB) + target_link_libraries(demo2 d2d1.lib dwrite.lib) +endif() + set_target_properties (demo2 PROPERTIES FOLDER demos )