Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
grodansparadis committed Sep 25, 2024
2 parents e7d5eab + 9906357 commit b269f5a
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 16 deletions.
4 changes: 4 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
]
Expand Down
26 changes: 19 additions & 7 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand All @@ -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
}
28 changes: 19 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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%
#
Expand All @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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/
Expand All @@ -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}
Expand All @@ -631,7 +636,8 @@ if (MSVC)
${CURL_INCLUDE_DIR}
)
else()
include_directories( PUBLIC ./src
include_directories( PUBLIC
./src
./build
./ui
third_party/mqtt
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b269f5a

Please sign in to comment.