diff --git a/.vscode/launch.json b/.vscode/launch.json index dcd0df8..c8e6da4 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -52,7 +52,11 @@ "request": "launch", "name": "Debug portfile(s)", "cmakeDebugType": "external", +<<<<<<< HEAD "pipeName": "/tmp/vcpkg_ext_portfile_dbg", +======= + "pipeName": "\\\\.\\pipe\\vcpkg_ext_portfile_dbg", +>>>>>>> 99063577d2c6f0b876be4ba772a602728c9740bf "preLaunchTask": "Debug vcpkg commands" } ] diff --git a/.vscode/settings.json b/.vscode/settings.json index a0df106..d53689f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -98,12 +98,14 @@ "**/node_modules/*/**": true, "**/.hg/store/**": true }, - "cmake.configureArgs": [ - "-DVCPKG_HOST_TRIPLET=x64-windows-static", - "-DVCPKG_TARGET_TRIPLET=x64-windows-static", - "-DQT_PATH=G:/Qt/", - "-DCMAKE_TOOLCHAIN_FILE=G:/akhe/development/vcpkg/scripts/buildsystems/vcpkg.cmake", - "-DVCPKG_ROOT=G:/akhe/development/vcpkg" + "cmake.configureArgs": [ + "-DVCPKG_HOST_TRIPLET=x64-windows-static", + "-DQT_PATH=G:/Qt/", + "-DCMAKE_TOOLCHAIN_FILE=G:/vcpkg/scripts/buildsystems/vcpkg.cmake", + "-DVCPKG_ROOT=G:/vcpkg", + "-DVCPKG_TARGET_TRIPLET=", + "-DVCPKG_APPLOCAL_DEPS=ON", + "-DX_VCPKG_APPLOCAL_DEPS_INSTALL=ON" ], "cSpell.language": "sv,en", "cSpell.words": [ @@ -112,5 +114,15 @@ "cmake.clearOutputBeforeBuild": false, "cmake.configureEnvironment": { "CMAKE_PREFIX_PATH": "~/Qt/6.7.2/gcc_64" - } + }, + "vcpkg.general.enable": true, + "vcpkg.target.hostTriplet": "x64-windows", + "vcpkg.target.defaultTriplet": "", + "vcpkg.target.useStaticLib": false, + "cmake.configureSettings": { + "CMAKE_TOOLCHAIN_FILE": "G:\\vcpkg/scripts/buildsystems/vcpkg.cmake" + }, + "vcpkg.target.installDependencies": true, + "vcpkg.target.preferSystemLibs": false, + "vcpkg.target.useManifest": false } \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 45de5ed..cf4800c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,8 +27,7 @@ # # windows # ------- -# Set environment variabel to VSCP_ROOT -# cmake .. -G "Visual Studio 16 2019" -DVCPKG_TARGET_TRIPLET=x64-windows -DCMAKE_TOOLCHAIN_FILE=G:\vcpkg\scripts\buildsystems\vcpkg.cmake -DCMAKE_PREFIX_PATH=G:\Qt\6.7.2\msvc2019_64\ +# cmake .. -G "Visual Studio 17 2022" -DVCPKG_TARGET_TRIPLET=x64-windows -DCMAKE_TOOLCHAIN_FILE=G:\vcpkg\scripts\buildsystems\vcpkg.cmake -DCMAKE_PREFIX_PATH=G:\Qt\6.7.2\msvc2019_64\ # cmake --build . --config Debug # set PATH=G:\Qt\Qt-6.7.2\msvc2019_64\bin;%PATH% # @@ -39,12 +38,17 @@ project(vscp-works-qt LANGUAGES CXX C) option(USE_SSL "Use SSL" TRUE) ## --- C++14 build flags --- -set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS ON) # Generate position-independent code (-fPIC on UNIX) -set(CMAKE_POSITION_INDEPENDENT_CODE ON) +#set(CMAKE_POSITION_INDEPENDENT_CODE ON) + +set_target_properties(${PROJECT_NAM} PROPERTIES + WIN32_EXECUTABLE ON + MACOSX_BUNDLE ON +) # --- System Libraries --- include(GNUInstallDirs) @@ -61,7 +65,7 @@ file(TO_CMAKE_PATH "$ENV{VSCP_ROOT}" VSCP_PATH) message(STATUS "VSCP path = $ENV{VSCP_ROOT}") file(TO_CMAKE_PATH "$ENV{QT_ROOT_DIR}" QT_PATH) -message(STATUS "Qt path = $ENV{QT_PATH}") +message(STATUS "QT_ROOT_DIR = $ENV{QT_ROOT_DIR}") if(MSVC) add_definitions(-D_CRT_SECURE_NO_WARNINGS) @@ -608,7 +612,8 @@ if (MSVC) find_path(MOSQUITTO_INCLUDE_DIR mosquitto.h) message(STATUS "Include: ${MOSQUITTO_INCLUDE_DIR}") - include_directories( PUBLIC ./src + include_directories( PUBLIC + ./src ./build ./ui $ENV{VSCP_ROOT}/src/vscp/common/ @@ -622,7 +627,7 @@ if (MSVC) ${PThreads4W_INCLUDE_DIR} ${CMAKE_BINARY_DIR} ${OPENSSL_INCLUDE_DIR} - ${MOSQUITTO_INCLUDE_DIRS} + ${MOSQUITTO_INCLUDE_DIRS}cd bui ${LIBWEBSOCKETS_INCLUDE_DIR} ${EXPAT_INCLUDE_DIRS} ${DLFCN_INCLUDES} @@ -631,7 +636,8 @@ if (MSVC) ${CURL_INCLUDE_DIR} ) else() - include_directories( PUBLIC ./src + include_directories( PUBLIC + ./src ./build ./ui third_party/mqtt @@ -664,7 +670,11 @@ if (MSVC) message(STATUS "lib websockets lib: ${LIBWEBSOCKETS_LIBRARY_DIR} --- ${VCPKG_ROOT}/installed/x64-windows/lib/${LIBWEBSOCKETS_LIBRARIES}") link_directories(${LIBWEBSOCKETS_LIBRARY_DIR}) -target_link_libraries(${PROJECT_NAME} PRIVATE +target_link_libraries(${PROJECT_NAME} PRIVATE + Qt6::Widgets + Qt6::Qml + Qt6::Sql + Qt6::Charts PThreads4W::PThreads4W OpenSSL::SSL OpenSSL::Crypto