Closed LonghronShen closed 2 years ago
I don't believe CMake honors things like %PATH%
and other variables like %WINDOWSPHONEKITDIR %
in a Developer Command Prompt. Or at least my testing did not confirm it.
If the changes are working for you it is probably a side effect of failing to honor them as expected.
You're right... The syntax should be changed to $ENV{VAR} to get system environment. Let me have a try.
The new fix has been done. It works as expected.
Please check the new implementation which should work in all environments:
if(MSVC)
set(CRYPTOPP_MSVC_COMPILE_OPTIONS)
# TODO: what about ICC and LLVM on Windows?
if(CMAKE_SYSTEM_VERSION MATCHES "10\\.0.*")
# https://docs.microsoft.com/en-us/cpp/porting/modifying-winver-and-win32-winnt
list(APPEND CRYPTOPP_COMPILE_DEFINITIONS "_WIN32_WINNT=0x0A00")
endif()
# winapifamily.h is missing on AppVeyor machines
include(CheckIncludeFileCXX)
check_include_file_cxx("winapifamily.h" HAVE_WINAPIFAMILY_H)
if(HAVE_WINAPIFAMILY_H)
list(APPEND CRYPTOPP_MSVC_COMPILE_OPTIONS "/FIwinapifamily.h")
endif()
endif()
The above solution doesn't work for me... But I found another solution: According to the answer here: https://stackoverflow.com/questions/40577415/detect-availablility-of-sdkddkver-h-and-winapifamily-h-from-developer-comman The CMakeList.txt can be modified like this.