Skip to content

Commit 1d7de74

Browse files
authored
Merge pull request #1 from oclero/dev
v1.3.0
2 parents 23b69fe + 3c0ea36 commit 1d7de74

File tree

15 files changed

+274
-154
lines changed

15 files changed

+274
-154
lines changed

.github/workflows/linux.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ on:
55
branches:
66
- master
77
- dev
8-
- setup-ci
98
pull_request:
109
branches:
1110
- master
@@ -20,17 +19,18 @@ jobs:
2019
uses: actions/checkout@v4
2120

2221
- name: Install Qt
23-
uses: jurplel/install-qt-action@v3
22+
uses: jurplel/install-qt-action@v4
2423
with:
25-
version: "5.15.2"
24+
version: "6.8.2"
2625
host: linux
2726
target: desktop
27+
arch: linux_gcc_64
2828

2929
- name: Configure CMake
30-
run: cmake --preset linux
30+
run: cmake --preset linux -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install
3131

3232
- name: Build library
33-
run: cmake --build --preset linux
33+
run: cmake --build --preset linux --target install
3434

3535
- name: Build tests
3636
run: cmake --build --preset linux-test

.github/workflows/macos.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ on:
55
branches:
66
- master
77
- dev
8-
- setup-ci
98
pull_request:
109
branches:
1110
- master
@@ -19,18 +18,22 @@ jobs:
1918
- name: Check Out
2019
uses: actions/checkout@v4
2120

21+
- name: Install Ninja
22+
run: brew install ninja
23+
2224
- name: Install Qt
23-
uses: jurplel/install-qt-action@v3
25+
uses: jurplel/install-qt-action@v4
2426
with:
25-
version: "5.15.2"
27+
version: "6.8.2"
2628
host: mac
2729
target: desktop
30+
arch: clang_64
2831

2932
- name: Configure CMake
30-
run: cmake --preset macos -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED=OFF -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY="-"
33+
run: cmake --preset macos -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install
3134

3235
- name: Build library
33-
run: cmake --build --preset macos
36+
run: cmake --build --preset macos --target install
3437

3538
- name: Build tests
3639
run: cmake --build --preset macos-test

.github/workflows/windows.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ on:
55
branches:
66
- master
77
- dev
8-
- setup-ci
98
pull_request:
109
branches:
1110
- master
@@ -20,17 +19,18 @@ jobs:
2019
uses: actions/checkout@v4
2120

2221
- name: Install Qt
23-
uses: jurplel/install-qt-action@v3
22+
uses: jurplel/install-qt-action@v4
2423
with:
25-
version: "5.15.2"
24+
version: "6.8.2"
2625
host: windows
2726
target: desktop
27+
arch: win64_msvc2022_64
2828

2929
- name: Configure CMake
30-
run: cmake --preset windows
30+
run: cmake --preset windows -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install
3131

3232
- name: Build library
33-
run: cmake --build --preset windows
33+
run: cmake --build --preset windows --target install
3434

3535
- name: Build tests
3636
run: cmake --build --preset windows-test

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## v1.3.0
4+
5+
- Switch to Qt6.
6+
- Switch to Ninja for macOS builds.
7+
- Add `QTAPPINSTANCEMANAGER_TESTS` and `QTAPPINSTANCEMANAGER_EXAMPLES` options to enable tests and examples.
8+
39
## v1.2.1
410

511
- Recommend FetchContent instead of submodule.

CMakeLists.txt

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
cmake_minimum_required(VERSION 3.21.0)
2+
3+
# Enable parallel build (not enabled by default on Windows).
4+
set(CMAKE_BUILD_PARALLEL_LEVEL $ENV{NUMBER_OF_PROCESSORS})
5+
26
enable_testing()
37

48
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
5-
include(DeployQt)
69

710
# Set project information.
811
project("QtAppInstanceManager"
912
LANGUAGES CXX
10-
VERSION 1.2.1.0
13+
VERSION 1.3.0.0
14+
DESCRIPTION "A tool to communicate between the instances of your Qt application."
15+
HOMEPAGE_URL "https://github.com/oclero/QtAppInstanceManager"
1116
)
1217
set(PROJECT_NAMESPACE "oclero")
1318

@@ -16,15 +21,25 @@ set(CMAKE_CXX_EXTENSIONS OFF)
1621
set(CMAKE_CXX_STANDARD 17)
1722
set(CMAKE_CXX_STANDARD_REQUIRED ON)
1823
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
24+
if(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
25+
set(CMAKE_OSX_DEPLOYMENT_TARGET "13.6")
26+
endif()
27+
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
28+
29+
# Find Qt.
30+
find_package(Qt6 REQUIRED COMPONENTS Core Network)
31+
qt_standard_project_setup()
1932

2033
# The library.
2134
add_subdirectory(src)
2235

23-
if(${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME})
24-
# Tests.
36+
# Tests.
37+
if(QTAPPINSTANCEMANAGER_TESTS)
2538
add_subdirectory(tests)
39+
endif()
2640

27-
# Examples.
41+
# Examples.
42+
if(QTAPPINSTANCEMANAGER_EXAMPLES)
2843
add_subdirectory(examples/single)
2944
add_subdirectory(examples/multiple)
3045
endif()

CMakePresets.json

Lines changed: 93 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": 3,
2+
"version": 6,
33
"cmakeMinimumRequired": {
44
"major": 3,
55
"minor": 21,
@@ -9,11 +9,13 @@
99
{
1010
"name": "macos",
1111
"displayName": "macOS",
12-
"description": "Xcode project for macOS",
13-
"generator": "Xcode",
12+
"description": "Ninja Build for macOS",
13+
"generator": "Ninja",
1414
"binaryDir": "${sourceDir}/_build",
1515
"cacheVariables": {
16-
"Qt5_DIR": "/opt/homebrew/opt/qt/lib/cmake/Qt5"
16+
"CMAKE_PREFIX_PATH": "/opt/homebrew/opt/qt/lib/cmake/Qt6",
17+
"QTAPPINSTANCEMANAGER_TESTS": true,
18+
"QTAPPINSTANCEMANAGER_EXAMPLES": true
1719
},
1820
"condition": {
1921
"type": "equals",
@@ -28,7 +30,9 @@
2830
"generator": "Visual Studio 17 2022",
2931
"binaryDir": "${sourceDir}/_build",
3032
"cacheVariables": {
31-
"Qt5_DIR": "C:/Qt/5.15.2/msvc2019_64/lib/cmake/Qt5"
33+
"CMAKE_PREFIX_PATH": "C:/Qt/6.8.0/msvc2022_64",
34+
"QTAPPINSTANCEMANAGER_TESTS": true,
35+
"QTAPPINSTANCEMANAGER_EXAMPLES": true
3236
},
3337
"condition": {
3438
"type": "equals",
@@ -39,9 +43,13 @@
3943
{
4044
"name": "linux",
4145
"displayName": "Linux",
42-
"description": "Makefile for Linux",
43-
"generator": "Unix Makefiles",
46+
"description": "Ninja Build for Linux",
47+
"generator": "Ninja",
4448
"binaryDir": "${sourceDir}/_build",
49+
"cacheVariables": {
50+
"QTAPPINSTANCEMANAGER_TESTS": true,
51+
"QTAPPINSTANCEMANAGER_EXAMPLES": true
52+
},
4553
"condition": {
4654
"type": "equals",
4755
"lhs": "${hostSystemName}",
@@ -54,8 +62,10 @@
5462
"name": "macos",
5563
"displayName": "macOS",
5664
"configurePreset": "macos",
57-
"description": "Release build with Xcode for macOS",
58-
"targets": ["QtAppInstanceManager"],
65+
"description": "Release build for macOS",
66+
"targets": [
67+
"QtAppInstanceManager"
68+
],
5969
"configuration": "Release",
6070
"condition": {
6171
"type": "equals",
@@ -67,8 +77,10 @@
6777
"name": "macos-test",
6878
"displayName": "Tests for macOS",
6979
"configurePreset": "macos",
70-
"description": "Tests release build with Xcode for macOS",
71-
"targets": ["QtAppInstanceManagerTests"],
80+
"description": "Tests release build for macOS",
81+
"targets": [
82+
"QtAppInstanceManagerTests"
83+
],
7284
"configuration": "Release",
7385
"condition": {
7486
"type": "equals",
@@ -80,8 +92,10 @@
8092
"name": "windows",
8193
"displayName": "Windows",
8294
"configurePreset": "windows",
83-
"description": "Release build with Visual Studio for Windows",
84-
"targets": ["QtAppInstanceManager"],
95+
"description": "Release build for Windows",
96+
"targets": [
97+
"QtAppInstanceManager"
98+
],
8599
"configuration": "Release",
86100
"condition": {
87101
"type": "equals",
@@ -93,8 +107,10 @@
93107
"name": "windows-test",
94108
"displayName": "Tests for Windows",
95109
"configurePreset": "windows",
96-
"description": "Tests release build with Visual Studio for Windows",
97-
"targets": ["QtAppInstanceManagerTests"],
110+
"description": "Tests release build for Windows",
111+
"targets": [
112+
"QtAppInstanceManagerTests"
113+
],
98114
"configuration": "Release",
99115
"condition": {
100116
"type": "equals",
@@ -107,7 +123,9 @@
107123
"displayName": "Linux",
108124
"configurePreset": "linux",
109125
"description": "Release build for Linux",
110-
"targets": ["QtAppInstanceManager"],
126+
"targets": [
127+
"QtAppInstanceManager"
128+
],
111129
"configuration": "Release",
112130
"condition": {
113131
"type": "equals",
@@ -120,7 +138,9 @@
120138
"displayName": "Tests for Linux",
121139
"configurePreset": "linux",
122140
"description": "Tests release build for Linux",
123-
"targets": ["QtAppInstanceManagerTests"],
141+
"targets": [
142+
"QtAppInstanceManagerTests"
143+
],
124144
"configuration": "Release",
125145
"condition": {
126146
"type": "equals",
@@ -184,5 +204,61 @@
184204
"rhs": "Windows"
185205
}
186206
}
207+
],
208+
"workflowPresets": [
209+
{
210+
"name": "macos",
211+
"displayName": "macOS",
212+
"steps": [
213+
{
214+
"type": "configure",
215+
"name": "macos"
216+
},
217+
{
218+
"type": "build",
219+
"name": "macos-test"
220+
},
221+
{
222+
"type": "test",
223+
"name": "macos"
224+
}
225+
]
226+
},
227+
{
228+
"name": "windows",
229+
"displayName": "Windows",
230+
"steps": [
231+
{
232+
"type": "configure",
233+
"name": "windows"
234+
},
235+
{
236+
"type": "build",
237+
"name": "windows-test"
238+
},
239+
{
240+
"type": "test",
241+
"name": "windows"
242+
}
243+
]
244+
},
245+
{
246+
"name": "linux",
247+
"displayName": "Linux",
248+
"steps": [
249+
{
250+
"type": "configure",
251+
"name": "linux"
252+
},
253+
{
254+
"type": "build",
255+
"name": "linux-test"
256+
},
257+
{
258+
"type": "test",
259+
"name": "linux"
260+
}
261+
]
262+
}
187263
]
188264
}

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
[![License: MIT](https://img.shields.io/badge/license-MIT-green)](https://mit-license.org/)
88
[![CMake version](https://img.shields.io/badge/CMake-3.21+-064F8C?logo=cmake)](https://www.qt.io)
99
[![C++ version](https://img.shields.io/badge/C++-17-00599C?logo=++)](https://www.qt.io)
10-
[![Qt version](https://img.shields.io/badge/Qt-5.15.2+-41CD52?logo=qt)](https://www.qt.io)
10+
[![Qt version](https://img.shields.io/badge/Qt-6.6.0+-41CD52?logo=qt)](https://www.qt.io)
1111

12-
**QtAppInstanceManager** is a tool to control how many instances of your Qt5 application are running at the same time, and to send messages between instances. It uses a local socket under the hood. You may then build upon this foundation any messaging system or protocol, such as JSON-RPC for instance (NB: not provided because out of the scope of this library).
12+
**QtAppInstanceManager** is a tool to control how many instances of your Qt application are running at the same time, and to send messages between instances. It uses a local socket under the hood. You may then build upon this foundation any messaging system or protocol, such as JSON-RPC for instance (NB: not provided because out of the scope of this library).
1313

1414
It is intended to be a replacement for `QtSingleApplication`, the deprecated Qt4 official project.
1515

@@ -33,11 +33,11 @@ Also, it differs from [itay-grudev's SingleApplication](https://github.com/itay-
3333

3434
- Platform: Windows, MacOS, Linux.
3535
- [CMake 3.21+](https://cmake.org/download/)
36-
- [Qt 5.15+](https://www.qt.io/download-qt-installer)
36+
- [Qt 6.6+](https://www.qt.io/download-qt-installer)
3737

3838
## Usage
3939

40-
1. Add the library as a dependency with CMake FetchContent.
40+
1. Add the library as a dependency in your CMakeLists.txt, for example with FetchContent.
4141

4242
```cmake
4343
include(FetchContent)

0 commit comments

Comments
 (0)