I'm trying to compile one of the CMakelist based demos under Visual Studio instead of Qt Creator. My problem is that when compiling in Debug, Visual Studio is not getting the correct "d" version of the libraries. It properly links the "d" version of all the Qt libraries, but not EsriRuntimeQt or EsriCommonQt. I have to manually add the "d" in Visual Studio.
I'm using the CMakelist.txt generated by the demo so I'm not quite sure what's going on.
#-------------------------------------------------
# Copyright 2022 ESRI
#
# All rights reserved under the copyright laws of the United States
# and applicable international laws, treaties, and conventions.
#
# You may freely redistribute and use this sample code, with or
# without modification, provided you include the original copyright
# notice and use restrictions.
#
# See the Sample code usage restrictions document for further information.
#-------------------------------------------------
cmake_minimum_required(VERSION 3.5)
project(testmap2 LANGUAGES CXX)
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
set(CMAKE_INCLUDE_CURRENT_DIR ON)
find_package(Qt5 REQUIRED COMPONENTS Core Widgets Multimedia Positioning Sensors)
find_package(ArcGISRuntime 100.14 REQUIRED COMPONENTS Cpp)
set(SOURCE_FILES
main.cpp
Testmap2.cpp)
add_executable(testmap2 ${SOURCE_FILES})
# Copy required dynamic libraries to the build folder as a post-build step.
if(DEFINED ArcGISRuntime_LIBRARIES)
add_custom_command(TARGET testmap2 POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${ArcGISRuntime_LIBRARIES}
$<TARGET_FILE_DIR:testmap2>)
endif()
target_link_libraries(testmap2 PUBLIC
Qt5::Core
Qt5::Widgets
Qt5::Multimedia
Qt5::Positioning
Qt5::Sensors
ArcGISRuntime::Cpp)