Skip to content

Commit

Permalink
Added windows port fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Mar 30, 2021
1 parent 6d98f61 commit dc8362e
Show file tree
Hide file tree
Showing 61 changed files with 944 additions and 784 deletions.
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,17 @@ build
src/CMakeCache.txt
src/CMakeFiles/
src/cmake_install.cmake

# Buildfiles on windows
ALL_BUILD.vcxproj
ALL_BUILD.vcxproj.filters
CMakeCache.txt
CMakeFiles/
INSTALL.vcxproj
INSTALL.vcxproj.filters
ZERO_CHECK.vcxproj
ZERO_CHECK.vcxproj.filters
cmake_install.cmake
vscp-works-qt.sln
vscp-works-qt.vcxproj
vscp-works-qt.vcxproj.filters
11 changes: 3 additions & 8 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,8 @@
"**/.git/subtree-cache/**": true,
"**/node_modules/**": true
},
"cSpell.words": [
"c",
"display",
"dlg",
"guid",
"index",
"sensor",
"str"
"cmake.configureArgs": [
"-DVCPKG_TARGET_TRIPLET=x64-windows",
"-DCMAKE_TOOLCHAIN_FILE=E:/development/vcpkg/scripts/buildsystems/vcpkg.cmake"
]
}
24 changes: 18 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ endif()

if(WIN32)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
add_definitions(-DWIN32_LEAN_AND_MEANS)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
set(LIBS_SYSTEM ws2_32)
elseif(UNIX)
Expand All @@ -59,6 +60,11 @@ if (WIN32)
#set (CMAKE_PREFIX_PATH "E:\\Qt\\5.15.2\\msvc2019_64\\")
endif()

# if (MSVC)
# # use precompiled headers
# set (CMAKE_AUTOMOC_MOC_OPTIONS "-bstdafx.h" "-fstdafx.h")
# endif()

set(CMAKE_INCLUDE_CURRENT_DIR ON)

set(CMAKE_AUTOUIC ON)
Expand Down Expand Up @@ -122,6 +128,7 @@ if (WIN32)
# set(DLFCN__LIBS "E:\\development\\dlfcn-win32\\src\\")
endif()


# Set civetweb build flags
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_IPV6 -DUSE_WEBSOCKET")
string(FIND "${OPENSSL_VERSION}" "1.1." SSL_VER_POS)
Expand Down Expand Up @@ -436,12 +443,17 @@ add_executable(vscp-works-qt
${VSCP_PATH}/src/common/fastpbkdf2.h
${VSCP_PATH}/src/common/fastpbkdf2.c
install/vscp-works-qt.desktop
${TS_FILES}
${TS_FILES}
)

# add_executable(vscp-works-qt
# src/StdAfx.h
# src/StdAfx.cpp
# )

if (WIN32)
set(LOCAL_WIN_INCLUDE "windows\\include\\")
set(LOCAL_SYSLOG_INCLUDE "windows\\syslog\\include\\")
#set(LOCAL_WIN_INCLUDE "windows\\include\\")
#set(LOCAL_SYSLOG_INCLUDE "windows\\syslog\\include\\")
endif()

if (WIN32)
Expand Down Expand Up @@ -543,9 +555,9 @@ message(" PAHO_LIBRARIES = ${PAHO_LIBRARIES}")

message(Main include: "${VCPKG_HOME}/installed/x64_linux/include")

#include(GNUInstallDirs)
if(WIN32)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
add_definitions(-DWIN32_LEAN_AND_MEANS)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
set(LIBS_SYSTEM ws2_32)
elseif(UNIX)
Expand All @@ -562,4 +574,4 @@ install(FILES ${CMAKE_SOURCE_DIR}/install/vscp-works-qt.desktop
install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/icons/ DESTINATION ${INSTALL_PATH}/share/icons/)

# Event database etc
install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/install/share/ DESTINATION ${INSTALL_PATH}/share/vscp-works-qt/)
install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/install/share/ DESTINATION ${INSTALL_PATH}/share/vscp-works-qt/)
4 changes: 4 additions & 0 deletions src/canalconfigwizard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
// SOFTWARE.
//

#ifdef WIN32
#include "StdAfx.h"
#endif

#include <QtWidgets>
#include <QDebug>

Expand Down
4 changes: 4 additions & 0 deletions src/cdlgcanfilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
// SOFTWARE.
//

#ifdef WIN32
#include "StdAfx.h"
#endif

#include "cdlgcanfilter.h"
#include "ui_cdlgcanfilter.h"

Expand Down
3 changes: 3 additions & 0 deletions src/cdlgconnsettingscanal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
// SOFTWARE.
//

#ifdef WIN32
#include "StdAfx.h"
#endif

#include "cdlgconnsettingscanal.h"
#include "ui_cdlgconnsettingscanal.h"
Expand Down
3 changes: 3 additions & 0 deletions src/cdlgconnsettingslocal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
// SOFTWARE.
//

#ifdef WIN32
#include "StdAfx.h"
#endif

#include "cdlgconnsettingslocal.h"
#include "ui_cdlgconnsettingslocal.h"
Expand Down
4 changes: 4 additions & 0 deletions src/cdlgconnsettingsmqtt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
// SOFTWARE.
//

#ifdef WIN32
#include "StdAfx.h"
#endif

#include "vscpworks.h"
#include <vscphelper.h>

Expand Down
4 changes: 4 additions & 0 deletions src/cdlgconnsettingsmulticast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
// SOFTWARE.
//

#ifdef WIN32
#include "StdAfx.h"
#endif

#include <vscp.h>
#include <vscphelper.h>

Expand Down
7 changes: 7 additions & 0 deletions src/cdlgconnsettingsrawcan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@
// SOFTWARE.
//

#ifdef WIN32
#include "StdAfx.h"
#endif

#ifndef WIN32

#include <vscphelper.h>
#include <vscp_client_socketcan.h>

Expand Down Expand Up @@ -507,3 +513,4 @@ void CDlgConnSettingsRawCan::onTestConnection(void)
}
}

#endif // WIN32
3 changes: 3 additions & 0 deletions src/cdlgconnsettingsrawcan.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
#ifndef CDLGCONNSETTINGSRAWCAN_H
#define CDLGCONNSETTINGSRAWCAN_H

#ifndef WIN32

#include "vscp_client_socketcan.h"

#include <QDialog>
Expand Down Expand Up @@ -147,5 +149,6 @@ class CDlgConnSettingsRawCan : public QDialog
vscpClientSocketCan m_clientSocketcan;
};

#endif // WIN23

#endif // CDLGCONNSETTINGSRAWCAN_H
4 changes: 4 additions & 0 deletions src/cdlgconnsettingsrawmqtt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
// SOFTWARE.
//

#ifdef WIN32
#include "StdAfx.h"
#endif

#include "vscpworks.h"
#include <vscphelper.h>

Expand Down
4 changes: 4 additions & 0 deletions src/cdlgconnsettingsrest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
// SOFTWARE.
//

#ifdef WIN32
#include "StdAfx.h"
#endif

#include <vscp.h>
#include <vscphelper.h>

Expand Down
7 changes: 7 additions & 0 deletions src/cdlgconnsettingssocketcan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@
// SOFTWARE.
//

#ifdef WIN32
#include "StdAfx.h"
#endif

#ifndef WIN32

#include <vscphelper.h>
#include <vscp_client_socketcan.h>

Expand Down Expand Up @@ -528,3 +534,4 @@ void CDlgConnSettingsSocketCan::onTestConnection(void)
}
}

#endif // WIN32
3 changes: 3 additions & 0 deletions src/cdlgconnsettingssocketcan.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
#ifndef CDLGCONNSETTINGSSOCKETCAN_H
#define CDLGCONNSETTINGSSOCKETCAN_H

#ifndef WIN32

#include "vscp_client_socketcan.h"

#include <QDialog>
Expand Down Expand Up @@ -166,5 +168,6 @@ class CDlgConnSettingsSocketCan : public QDialog
vscpClientSocketCan m_clientSocketcan;
};

#endif // WIN32

#endif // CDLGCONNSETTINGSSOCKETCAN_H
8 changes: 8 additions & 0 deletions src/cdlgconnsettingstcpip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@
// SOFTWARE.
//

#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif

#ifdef WIN32
#include "StdAfx.h"
#endif

#include "vscpworks.h"

#include "cdlgconnsettingstcpip.h"
Expand Down
3 changes: 3 additions & 0 deletions src/cdlgconnsettingstcpip.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
#ifndef CDLGCONNSETTINGSTCPIP_H
#define CDLGCONNSETTINGSTCPIP_H

#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif

#include "vscp_client_tcp.h"

Expand Down
4 changes: 4 additions & 0 deletions src/cdlgconnsettingsudp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
// SOFTWARE.
//

#ifdef WIN32
#include "StdAfx.h"
#endif

#include <vscp.h>
#include <vscphelper.h>

Expand Down
4 changes: 4 additions & 0 deletions src/cdlgconnsettingsws1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
// SOFTWARE.
//

#ifdef WIN32
#include "StdAfx.h"
#endif

#include <vscp.h>
#include <vscphelper.h>

Expand Down
4 changes: 4 additions & 0 deletions src/cdlgconnsettingsws2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
// SOFTWARE.
//

#ifdef WIN32
#include "StdAfx.h"
#endif

#include <vscp.h>
#include <vscphelper.h>

Expand Down
4 changes: 4 additions & 0 deletions src/cdlgeditguid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
// SOFTWARE.
//

#ifdef WIN32
#include "StdAfx.h"
#endif

#include <vscp.h>
#include <vscphelper.h>

Expand Down
4 changes: 4 additions & 0 deletions src/cdlgeditsensorindex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
// SOFTWARE.
//

#ifdef WIN32
#include "StdAfx.h"
#endif

#include <vscp.h>
#include <vscphelper.h>

Expand Down
4 changes: 4 additions & 0 deletions src/cdlgeditsessionfilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
// SOFTWARE.
//

#ifdef WIN32
#include "StdAfx.h"
#endif

#include <vscp.h>
#include <vscphelper.h>

Expand Down
4 changes: 4 additions & 0 deletions src/cdlgknownguid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
// SOFTWARE.
//

#ifdef WIN32
#include "StdAfx.h"
#endif

#include <vscp.h>
#include <guid.h>
#include <vscphelper.h>
Expand Down
4 changes: 4 additions & 0 deletions src/cdlglevel1filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
// SOFTWARE.
//

#ifdef WIN32
#include "StdAfx.h"
#endif

#include <vscp.h>
#include <vscphelper.h>

Expand Down
4 changes: 4 additions & 0 deletions src/cdlglevel1filterwizard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
// https://blog.csdn.net/weixin_30251587/article/details/96939409
//

#ifdef WIN32
#include "StdAfx.h"
#endif

#include "vscphelper.h"
#include "vscpworks.h"

Expand Down
4 changes: 4 additions & 0 deletions src/cdlglevel2filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
// SOFTWARE.
//

#ifdef WIN32
#include "StdAfx.h"
#endif

#include "vscphelper.h"
#include "vscpworks.h"

Expand Down
Loading

0 comments on commit dc8362e

Please sign in to comment.