Skip to content

Commit

Permalink
cmake: add ucrt dir for vs project build
Browse files Browse the repository at this point in the history
lots of files are not found
  • Loading branch information
wang-bin committed Mar 14, 2017
1 parent 6d6fc87 commit 54fc5f8
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,20 @@ install(FILES
DESTINATION ${QT_INSTALL_LIBS}/cmake
)

if(CMAKE_GENERATOR MATCHES "Visual Studio.*")
set(UCRT_INCLUDE $ENV{UniversalCRTSDKDir}Include\\$ENV{UCRTVersion}\\ucrt)
set(VC_ARCH $ENV{Platform})
if(NOT VC_ARCH)
set(VC_ARCH x86)
endif()
set(UCRT_LIB $ENV{UniversalCRTSDKDir}Lib\\$ENV{UCRTVersion}\\ucrt\\${VC_ARCH})
if(EXISTS ${UCRT_INCLUDE})
message("VS project. ucrt: ${UCRT_LIB}")
include_directories(${UCRT_INCLUDE})
link_libraries(${CMAKE_LIBRARY_PATH_FLAG}${UCRT_LIB})
endif()
endif()

add_subdirectory(src)
find_package(Qt5Widgets)
if(Qt5Widgets_FOUND)
Expand Down

0 comments on commit 54fc5f8

Please sign in to comment.