Skip to content

Commit

Permalink
emoved switch
Browse files Browse the repository at this point in the history
  • Loading branch information
grodansparadis committed Sep 25, 2024
1 parent abe3809 commit 9906357
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 16 deletions.
8 changes: 8 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@
"preLaunchTask": "g++ build active file",
"miDebuggerPath": "/usr/bin/gdb",
"visualizerFile": "/home/akhe/.config/Code/User/workspaceStorage/b3a88788bb1e8a32eb6392485a993de5/tonka3000.qtvsctools/qt.natvis.xml"
},
{
"type": "cmake",
"request": "launch",
"name": "Debug portfile(s)",
"cmakeDebugType": "external",
"pipeName": "\\\\.\\pipe\\vcpkg_ext_portfile_dbg",
"preLaunchTask": "Debug vcpkg commands"
}
]
}
26 changes: 19 additions & 7 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,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 @@ -111,5 +113,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
}
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"command": "cd build; make clean; export CMAKE_PREFIX_PATH=~/Qt/5.15.2/gcc_64:$CMAKE_PREFIX_PATH; cmake -DCMAKE_BUILD_TYPE=Debug .. ; make -j4 -Wall",
"args": [],
"group": {
"kind": "build",
"kind": "build"
},
"problemMatcher": {
"owner": "cpp",
Expand Down
27 changes: 19 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#
# windows
# -------
# 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\5.15.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.6.2\msvc2019_64\bin;%PATH%
#
Expand All @@ -38,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 @@ -60,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 @@ -607,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 @@ -621,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 @@ -630,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 @@ -663,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 9906357

Please sign in to comment.