#Compiling an app with windows SDK depending from Visual studio with cmake, missing vcruntime.h

3 messages · Page 1 of 1 (latest)

maiden juncoBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

strange copper
#

Here's my CMakeLists.txt :

cmake_minimum_required(VERSION 3.10)

# Set the project name and version
project(DXGIDesktopDuplicationSample VERSION 1.0)

# Specify the C++ standard
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)

# Set DirectX SDK and Windows SDK paths (update these paths based on your installation)
set(WINDOWS_SDK_PATH "C:/Program Files (x86)/Windows Kits/10")
set(WINDOWS_SDK_INCLUDE_VERSION "10.0.26100.0")

# Include directories
include_directories(
    ${CMAKE_SOURCE_DIR}/include
    "${WINDOWS_SDK_PATH}/Include/${WINDOWS_SDK_INCLUDE_VERSION}/um"
    "${WINDOWS_SDK_PATH}/Include/${WINDOWS_SDK_INCLUDE_VERSION}/shared"
    "${WINDOWS_SDK_PATH}/Include/${WINDOWS_SDK_INCLUDE_VERSION}/winrt"
    "${WINDOWS_SDK_PATH}/Include/${WINDOWS_SDK_INCLUDE_VERSION}/ucrt"
)

# Link directories
link_directories(
    "${WINDOWS_SDK_PATH}/Lib/${WINDOWS_SDK_INCLUDE_VERSION}/um/x64"
)

# Add source files
set(SOURCES
    ${CMAKE_SOURCE_DIR}/src/DuplicationManager.cpp
    ${CMAKE_SOURCE_DIR}/src/DesktopDuplication.cpp
    ${CMAKE_SOURCE_DIR}/src/OutputManager.cpp
    ${CMAKE_SOURCE_DIR}/src/DisplayManager.cpp
    ${CMAKE_SOURCE_DIR}/src/ThreadManager.cpp
)

# Add executable target
add_executable(DXGIDesktopDuplicationSample ${SOURCES})

# Link required libraries
target_link_libraries(DXGIDesktopDuplicationSample
    dxgi
    d3d11
    dxguid
    dcomp
)

# Set compiler options for MinGW
if(MINGW)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++")
endif()
strange copper
#

Compiling an app with windows SDK depending from Visual studio with cmake, missing vcruntime.h