From 0490d4501ab2d8813215e37c4d45f63498f9ef07 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Wed, 13 Jan 2021 23:10:06 -0800 Subject: [PATCH] Minor review for CMake --- CMakeLists.txt | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b5930c38..5c2fb91d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -179,22 +179,22 @@ install(FILES DESTINATION cmake/) #--- Command-line tools -if(BUILD_TOOLS AND WIN32) +if(BUILD_TOOLS AND WIN32 AND (NOT WINDOWS_STORE)) add_executable(texassemble Texassemble/texassemble.cpp Texassemble/AnimatedGif.cpp) - target_link_libraries(texassemble ${PROJECT_NAME} version.lib) + target_link_libraries(texassemble ${PROJECT_NAME} ole32.lib version.lib) source_group(texassemble REGULAR_EXPRESSION Texassemble/*.*) add_executable(texconv Texconv/texconv.cpp Texconv/ExtendedBMP.cpp Texconv/PortablePixMap.cpp) - target_link_libraries(texconv ${PROJECT_NAME} version.lib) + target_link_libraries(texconv ${PROJECT_NAME} ole32.lib shell32.lib version.lib) source_group(texconv REGULAR_EXPRESSION Texconv/*.*) add_executable(texdiag Texdiag/texdiag.cpp) - target_link_libraries(texdiag ${PROJECT_NAME} version.lib) + target_link_libraries(texdiag ${PROJECT_NAME} ole32.lib version.lib) source_group(texdiag REGULAR_EXPRESSION Texdiag/*.*) if(ENABLE_OPENEXR_SUPPORT) @@ -210,15 +210,15 @@ endif() if(MSVC) target_compile_options(${PROJECT_NAME} PRIVATE /fp:fast) - if(BUILD_TOOLS AND WIN32) + if(BUILD_TOOLS AND WIN32 AND (NOT WINDOWS_STORE)) target_compile_options(texassemble PRIVATE /fp:fast) target_compile_options(texconv PRIVATE /fp:fast) target_compile_options(texdiag PRIVATE /fp:fast) endif() - if (${CMAKE_SIZEOF_VOID_P} EQUAL "4") + if ((${CMAKE_SIZEOF_VOID_P} EQUAL "4") AND (NOT ${CMAKE_VS_PLATFORM_NAME} MATCHES "arm")) target_compile_options(${PROJECT_NAME} PRIVATE /arch:SSE2) - if(BUILD_TOOLS AND WIN32) + if(BUILD_TOOLS AND WIN32 AND (NOT WINDOWS_STORE)) target_compile_options(texassemble PRIVATE /arch:SSE2) target_compile_options(texconv PRIVATE /arch:SSE2) target_compile_options(texdiag PRIVATE /arch:SSE2) @@ -232,7 +232,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") # OpenMP is not supported for clang for Windows by default - if(BUILD_TOOLS AND WIN32) + if(BUILD_TOOLS AND WIN32 AND (NOT WINDOWS_STORE)) set(WarningsEXE ${WarningsLib} "-Wno-c++98-compat" "-Wno-c++98-compat-pedantic" "-Wno-switch" "-Wno-switch-enum" "-Wno-language-extension-token" "-Wno-missing-prototypes") target_compile_options(texassemble PRIVATE ${WarningsEXE}) target_compile_options(texconv PRIVATE ${WarningsEXE} "-Wno-global-constructors") @@ -241,7 +241,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") endif() if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC") target_compile_options(${PROJECT_NAME} PRIVATE /permissive- /JMC- /Zc:__cplusplus) - if(BUILD_TOOLS AND WIN32) + if(BUILD_TOOLS AND WIN32 AND (NOT WINDOWS_STORE)) target_compile_options(texassemble PRIVATE /permissive- /Zc:__cplusplus) target_compile_options(texconv PRIVATE /permissive- /Zc:__cplusplus) target_compile_options(texdiag PRIVATE /permissive- /Zc:__cplusplus) @@ -249,7 +249,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC") if(ENABLE_CODE_ANALYSIS) target_compile_options(${PROJECT_NAME} PRIVATE /analyze) - if(BUILD_TOOLS AND WIN32) + if(BUILD_TOOLS AND WIN32 AND (NOT WINDOWS_STORE)) target_compile_options(texassemble PRIVATE /analyze) target_compile_options(texconv PRIVATE /analyze) target_compile_options(texdiag PRIVATE /analyze) @@ -258,7 +258,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC") if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.26) target_compile_options(${PROJECT_NAME} PRIVATE /Zc:preprocessor /wd5105) - if(BUILD_TOOLS AND WIN32) + if(BUILD_TOOLS AND WIN32 AND (NOT WINDOWS_STORE)) target_compile_options(texassemble PRIVATE /Zc:preprocessor /wd5105) target_compile_options(texconv PRIVATE /Zc:preprocessor /wd5105) target_compile_options(texdiag PRIVATE /Zc:preprocessor /wd5105) @@ -267,13 +267,13 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC") if(BC_USE_OPENMP) target_compile_options(${PROJECT_NAME} PRIVATE /openmp /Zc:twoPhase-) - if(BUILD_TOOLS AND WIN32) + if(BUILD_TOOLS AND WIN32 AND (NOT WINDOWS_STORE)) target_compile_options(texconv PRIVATE /openmp /Zc:twoPhase-) endif() endif() - if(BUILD_TOOLS AND WIN32) - set(WarningsEXE "/wd4061" "/wd4062" "/wd4365" "/wd4668" "/wd4710" "/wd4820" "/wd5039" "/wd5045" "/wd5219") + if(BUILD_TOOLS AND WIN32 AND (NOT WINDOWS_STORE)) + set(WarningsEXE "/wd4061" "/wd4062" "/wd4365" "/wd4514" "/wd4625" "/wd4626" "/wd4627" "/wd4668" "/wd4710" "/wd4751" "/wd4820" "/wd5026" "/wd5027" "/wd5039" "/wd5045" "/wd5219") target_compile_options(texassemble PRIVATE ${WarningsEXE}) target_compile_options(texconv PRIVATE ${WarningsEXE}) target_compile_options(texdiag PRIVATE ${WarningsEXE}) @@ -282,7 +282,7 @@ endif() if(WIN32) target_compile_definitions(${PROJECT_NAME} PRIVATE _UNICODE UNICODE) - if(BUILD_TOOLS) + if(BUILD_TOOLS AND (NOT WINDOWS_STORE)) target_compile_definitions(texassemble PRIVATE _UNICODE UNICODE _WIN32_WINNT=0x0601) target_compile_definitions(texconv PRIVATE _UNICODE UNICODE _WIN32_WINNT=0x0601) target_compile_definitions(texdiag PRIVATE _UNICODE UNICODE _WIN32_WINNT=0x0601) @@ -295,6 +295,6 @@ if(WIN32) endif() endif() -if(BUILD_TOOLS AND WIN32) +if(BUILD_TOOLS AND WIN32 AND (NOT WINDOWS_STORE)) set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT texconv) endif()