Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
josevcm committed Feb 14, 2022
2 parents ab25f5a + 1048281 commit 405c0d4
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 19 deletions.
17 changes: 14 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.17)

project(nfc-lab VERSION 2.6.7)
project(nfc-lab VERSION 2.6.8)

set(CMAKE_C_FLAGS_DEBUG "-g -msse -msse3 -mno-avx -fno-math-errno -falign-functions=32 -falign-loops=32" CACHE INTERNAL "" FORCE)
set(CMAKE_CXX_FLAGS_DEBUG "-g -msse -msse3 -mno-avx -fno-math-errno -falign-functions=32 -falign-loops=32" CACHE INTERNAL "" FORCE)
Expand All @@ -10,14 +10,25 @@ set(CMAKE_CXX_FLAGS_RELEASE "-g1 -O3 -msse -msse3 -mno-avx -fno-math-errno -fali

set(USB_INCLUDE_DIR ${CMAKE_CURRENT_LIST_DIR}/dll/usb-1.0.20/include)

set(SYSTEM_INSTALL_DIR "@ApplicationsDirX64@")

find_library(USB_LIBRARY usb-1.0 HINTS ${CMAKE_CURRENT_LIST_DIR}/dll/usb-1.0.20/x86_64-w64-mingw32/lib)

message(STATUS "USB_LIBRARY: ${USB_LIBRARY}")

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/dat/installer/config.xml.in ${CMAKE_CURRENT_BINARY_DIR}/installer/config/config.xml)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/dat/installer/package.xml.in ${CMAKE_CURRENT_BINARY_DIR}/installer/packages/nfc-lab/meta/package.xml)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/dat/installer/license.txt.in ${CMAKE_CURRENT_BINARY_DIR}/installer/packages/nfc-lab/meta/license.txt)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/dat/installer/package.xml.in ${CMAKE_CURRENT_BINARY_DIR}/installer/packages/org.josevcm.nfclab/meta/package.xml)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/dat/installer/license.txt.in ${CMAKE_CURRENT_BINARY_DIR}/installer/packages/org.josevcm.nfclab/meta/license.txt)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/dat/scripts/build-installer.ps1.in ${CMAKE_CURRENT_BINARY_DIR}/build-installer.ps1)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/dat/scripts/build-runenv.ps1.in ${CMAKE_CURRENT_BINARY_DIR}/build-runenv.ps1)

add_subdirectory(src)

add_custom_target(build-runenv
COMMAND powershell -File build-runenv.ps1
DEPENDS nfc-lab)

add_custom_target(build-installer
COMMAND powershell -File build-installer.ps1
DEPENDS nfc-lab)

2 changes: 1 addition & 1 deletion dat/installer/config.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
<Title>NFC Laboratory Installer</Title>
<Publisher>Jose Vicente Campos Martinez</Publisher>
<StartMenuDir>NFC Laboratory</StartMenuDir>
<TargetDir>@ApplicationsDirX64@/nfc-laboratory</TargetDir>
<TargetDir>@SYSTEM_INSTALL_DIR@/nfc-laboratory</TargetDir>
</Installer>
8 changes: 8 additions & 0 deletions dat/installer/installscript.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
function Component()
{
}

Component.prototype.createOperations = function() {
component.createOperations();
component.addOperation("CreateShortcut", "@TargetDir@/nfc-lab.exe", "@StartMenuDir@/NFC-Laboratory.lnk", "workingDirectory=@TargetDir@");
}
4 changes: 4 additions & 0 deletions dat/installer/package.xml.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Package>
<Name>org.josevcm.nfclab</Name>
<DisplayName>NFC Laboratory @nfc-lab_VERSION@ - josevcm@gmail.com</DisplayName>
<Description>NFC Laboratory Package Installer</Description>
<Version>@nfc-lab_VERSION@</Version>
Expand All @@ -8,4 +9,7 @@
<License name="License Agreement" file="license.txt" />
</Licenses>
<Default>true</Default>
<ForcedInstallation>true</ForcedInstallation>
<ForcedUpdate>true</ForcedUpdate>
<Script>installscript.js</Script>
</Package>
18 changes: 10 additions & 8 deletions dat/scripts/build-installer.ps1.in
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
$SourcePath="@CMAKE_CURRENT_SOURCE_DIR@"
$TargetPath="@CMAKE_CURRENT_BINARY_DIR@"

# Copy application resources
Copy-Item -Force -Recurse $SourcePath/dat/config $TargetPath/installer/packages/nfc-lab/data
New-Item -Force -Path $TargetPath/installer/packages/org.josevcm.nfclab/data/ -ItemType "directory"
New-Item -Force -Path $TargetPath/installer/packages/org.josevcm.nfclab/meta/ -ItemType "directory"

# Copy application external libraries
Copy-Item -Force $SourcePath/dll/usb-1.0.20/x86_64-w64-mingw32/bin/*.dll $TargetPath/installer/packages/nfc-lab/data/
# Copy application resources
Copy-Item -Force $SourcePath/dat/config/*.conf $TargetPath/installer/packages/org.josevcm.nfclab/data/
Copy-Item -Force $SourcePath/dll/usb-1.0.20/x86_64-w64-mingw32/bin/*.dll $TargetPath/installer/packages/org.josevcm.nfclab/data/
Copy-Item -Force $TargetPath/src/nfc-app/app-qt/nfc-lab.exe $TargetPath/installer/packages/org.josevcm.nfclab/data/

# Copy application executable
Copy-Item -Force $TargetPath/src/nfc-app/app-qt/nfc-lab.exe $TargetPath/installer/packages/nfc-lab/data/
# Copy installer resources
Copy-Item -Force $SourcePath/dat/installer/*.js $TargetPath/installer/packages/org.josevcm.nfclab/meta/

# Create QT deployment from executable
windeployqt.exe --debug --force --compiler-runtime --no-translations --no-system-d3d-compiler --no-angle --no-opengl-sw $TargetPath/installer/packages/nfc-lab/data/nfc-lab.exe
# windeployqt.exe --release --force --compiler-runtime --no-translations --no-system-d3d-compiler --no-angle --no-opengl-sw $TargetPath/installer/packages/nfc-lab/data/nfc-lab.exe
windeployqt.exe --debug --force --compiler-runtime --no-translations --no-system-d3d-compiler --no-angle --no-opengl-sw $TargetPath/installer/packages/org.josevcm.nfclab/data/nfc-lab.exe
# windeployqt.exe --release --force --compiler-runtime --no-translations --no-system-d3d-compiler --no-angle --no-opengl-sw $TargetPath/installer/packages/org.josevcm.nfclab/data/nfc-lab.exe

# Create QT installer
binarycreator.exe -c $TargetPath/installer/config/config.xml -p $TargetPath/installer/packages $TargetPath/nfc-lab-@nfc-lab_VERSION@-x86_64.exe
4 changes: 2 additions & 2 deletions dat/scripts/build-runenv.ps1.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ $TargetPath="@CMAKE_CURRENT_BINARY_DIR@"
if (Test-Path "$TargetPath/src/nfc-app/app-qt/nfc-lab.exe") {

# Copy application resources
Copy-Item -Force -Recurse $SourcePath/dat/config $BuildDebugPath
Copy-Item -Force -Recurse $SourcePath/dat/config/*.conf $TargetPath

# Copy application external libraries
Copy-Item -Force $SourcePath/dll/usb-1.0.20/x86_64-w64-mingw32/bin/*.dll $BuildDebugPath
Copy-Item -Force $SourcePath/dll/usb-1.0.20/x86_64-w64-mingw32/bin/*.dll $TargetPath

# Deploy QT required libraries
windeployqt.exe --debug --compiler-runtime --no-translations --no-system-d3d-compiler --no-angle --no-opengl-sw $TargetPath/src/nfc-app/app-qt/nfc-lab.exe
Expand Down
2 changes: 1 addition & 1 deletion src/nfc-app/app-qt/src/main/cpp/QtApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ struct QtApplication::Impl
// decoder control
QPointer<QtDecoder> decoder;

Impl() : settings("conf/nfc-lab.conf", QSettings::IniFormat)
Impl() : settings("nfc-lab.conf", QSettings::IniFormat)
{
// create user interface window
memory = new QtMemory(settings);
Expand Down
6 changes: 3 additions & 3 deletions src/nfc-app/app-qt/src/main/cpp/QtConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
*/
#define NFC_LAB_VERSION_MAJOR 2
#define NFC_LAB_VERSION_MINOR 6
#define NFC_LAB_VERSION_PATCH 7
#define NFC_LAB_VERSION_STRING "2.6.7"
#define NFC_LAB_VENDOR_STRING "NFC laboratory 2.6.7, Jose Vicente Campos Martinez - josevcm@gmail.com"
#define NFC_LAB_VERSION_PATCH 8
#define NFC_LAB_VERSION_STRING "2.6.8"
#define NFC_LAB_VENDOR_STRING "NFC laboratory 2.6.8, Jose Vicente Campos Martinez - josevcm@gmail.com"
2 changes: 1 addition & 1 deletion src/nfc-lib/lib-sdr/sdr-io/src/main/cpp/RecordDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ struct RecordDevice::Impl
bool writeHeader()
{
FILEHeader header = {
{{{'R', 'I', 'F', 'F'}, 0}, {'W', 'A', 'V', 'E'}},
{{{'R', 'I', 'F', 'F'}, 0}, {'W', 'A', 'V', 'E'}},
{{{'f', 'm', 't', ' '}, 0}, 0, 0, 0, 0, 0, 0},
{{{'L', 'I', 'S', 'T'}, 0}, {{'d', 'a', 't', 'e'}, 0}},
{{{'d', 'a', 't', 'a'}, 0}}
Expand Down

0 comments on commit 405c0d4

Please sign in to comment.