Skip to content

Commit 7dfb0fa

Browse files
authored
Merge pull request #61 from oblivioncth/dev
Merge to master for v0.7.5.4
2 parents a7f5de5 + 183ecd7 commit 7dfb0fa

22 files changed

+581
-258
lines changed

.github/workflows/build-project.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ jobs:
2222
with:
2323
runs_exclude: >
2424
[
25-
{ "os": "windows-latest", "linkage": "shared" },
26-
{ "os": "ubuntu-20.04"},
27-
{ "os": "ubuntu-22.04"}
25+
{ "linkage": "shared" },
26+
{ "compiler": "g++-10" }
2827
]
29-

CMakeLists.txt

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ cmake_minimum_required(VERSION 3.24.0...3.30.0)
66
# Project
77
# NOTE: DON'T USE TRAILING ZEROS IN VERSIONS
88
project(FIL
9-
VERSION 0.7.5.3
9+
VERSION 0.7.5.4
1010
LANGUAGES CXX
1111
DESCRIPTION "Flashpoint Importer for Launchers"
1212
)
@@ -34,7 +34,9 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
3434
set(CMAKE_AUTOUIC ON)
3535
set(CMAKE_AUTOMOC ON)
3636
set(CMAKE_AUTORCC ON)
37-
enable_language("RC")
37+
if(CMAKE_SYSTEM_NAME STREQUAL Windows)
38+
enable_language("RC")
39+
endif()
3840

3941
#================= Build =========================
4042

@@ -59,10 +61,17 @@ set(FIL_QX_COMPONENTS
5961
Gui
6062
Network
6163
Widgets
62-
Windows-gui
6364
Xml
6465
)
6566

67+
if(CMAKE_SYSTEM_NAME STREQUAL Windows)
68+
list(APPEND FIL_QX_COMPONENTS Windows-gui)
69+
endif()
70+
71+
if(CMAKE_SYSTEM_NAME STREQUAL Linux)
72+
list(APPEND FIL_QX_COMPONENTS Linux)
73+
endif()
74+
6675
include(OB/FetchQx)
6776
ob_fetch_qx(
6877
REF "0572d288936afd63ff6f5b6ce4b1fbfc0f03b0eb"
@@ -75,6 +84,8 @@ include(OB/Fetchlibfp)
7584
ob_fetch_libfp("183a479d00235d332aa1046a9b5ba98f62699752")
7685

7786
# Fetch CLIFp (build and import from source)
87+
include(OB/Utility)
88+
ob_cache_project_version(CLIFp)
7889
include(OB/FetchCLIFp)
7990
ob_fetch_clifp("7139ae998b292eb595e751ba4cb8599230435358")
8091

README.md

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ For Platforms, the importer is capable of importing each game/animation along wi
77

88
Checkout **[Usage (Primary)](#usage-primary)** to get started.
99

10-
[![Dev Builds](https://github.com/oblivioncth/FIL/actions/workflows/push-reaction.yml/badge.svg?branch=dev)](https://github.com/oblivioncth/FIL/actions/workflows/push-reaction.yml)
10+
[![Dev Builds](https://github.com/oblivioncth/FIL/actions/workflows/build-project.yml/badge.svg?branch=dev)](https://github.com/oblivioncth/FIL/actions/workflows/build-project.yml)
1111

1212
## Function
1313
This utility makes use of its sister project [CLIFp (Command-line Interface for Flashpoint)](https://github.com/oblivioncth/CLIFp) to allow launchers to actually start and exit the games correctly. It is automatically deployed into your Flashpoint installation (updated if necessary) at the end of a successful import and the latest version of CLIFp will be included in each release of this utility so it is not generally something the end-user needs to concern themselves with.
@@ -139,11 +139,11 @@ The symbolic link related options for handling images require the importer to be
139139
## Usage (Tools)
140140

141141
### Tag Filter
142-
The tag filter editor allows you to customize which titles will be imported based on their tags.
142+
The tag filter editor allows you to customize which titles will be imported based on their tags.
143143

144144
![Tag Filter](https://i.imgur.com/EzEd0H1.png)
145145

146-
Tags are listed alphabetically, nested under their categories names so that you can select or unselect an entire category easily. Exclusions take precedence, so if a title features a single tag that you have unselected it will not be included in the import.
146+
Tags are listed alphabetically, nested under their categories names so that you can select or unselect an entire category easily. Exclusions take precedence, so if a title features a single tag that you have unselected it will not be included in the import.
147147

148148
All tags are included by default.
149149

@@ -160,7 +160,7 @@ This tool automatically handles installing/updating the command-line interface F
160160

161161
## Other Features
162162
- The playlist import feature is "smart" in the sense that it won't include games that you aren't importing. So if you only want to import the Flash platform for example and a couple playlists, you wont have to worry about useless entries in the playlist that point to games from other platforms you didn't import. This of course does not apply if you are using the "Force All" playlist game mode.
163-
163+
164164
## Limitations
165165
- Although general compatibility is quite high, compatibility with every single title cannot be assured. Issues with a title or group of titles will be fixed as they are discovered.
166166
- The "smart" feature of the Playlist import portion of the tool has the drawback that only games that were included in the same import will be considered for that playlist. If you previously imported a Platform and now want to import a Playlist that contains games from that Platform you must make sure you select it again for it to be updated/re-imported in order for those games to be added to that Playlist. Alternatively, you can use the "Force All" playlist game mode, but this will also possibly add new platforms you did not previously import.
@@ -171,7 +171,7 @@ This tool automatically handles installing/updating the command-line interface F
171171
### Summary
172172

173173
- C++20
174-
- CMake 3.24.0
174+
- CMake >= 3.24.0
175175
- Targets Windows 10 and above
176176

177177
### Dependencies
@@ -182,8 +182,30 @@ This tool automatically handles installing/updating the command-line interface F
182182
- [Neargye's Magic Enum](https://github.com/Neargye/magic_enum)
183183
- [OBCMake](https://github.com/oblivioncth/OBCmake)
184184

185-
### Builds
186-
Tested with MSVC2022.
187-
188185
### Details
189-
The source for this project is managed by a sensible CMake configuration that allows for straightforward compilation and consumption of its target(s), either as a sub-project or as an imported package. All required dependencies except for Qt6 are automatically acquired via CMake's FetchContent mechanism.
186+
The source for this project is managed by a sensible CMake configuration that allows for straightforward compilation and consumption of its target(s), either as a sub-project or as an imported package. All required dependencies except for Qt6 are automatically acquired via CMake's FetchContent mechanism.
187+
188+
### Building
189+
Ensure Qt6 is installed and locatable by CMake (or alternatively use the `qt-cmake` script that comes with Qt in-place of the`cmake` command).
190+
191+
Right now, a static build is required in order for CLIFp to work correctly.
192+
193+
Should work with MSVC, MINGW64, clang, and gcc.
194+
195+
```
196+
# Acquire source
197+
git clone https://github.com/oblivioncth/FIL
198+
199+
# Configure (ninja optional, but recommended)
200+
cmake -S FIL -B build-FIL -G "Ninja Multi-config"
201+
202+
# Build
203+
cmake --build build-FIL
204+
205+
# Install
206+
cmake --install build-FIL
207+
208+
# Run
209+
cd "build-FIL/out/install/bin"
210+
fil
211+
```

app/CMakeLists.txt

Lines changed: 88 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# This statement creates a command that is known to be able to create the appropraite
66
# output file (CLIFP.exe) by copying it from the CLIFp build. The command depends on
77
# CLIFp having been built in-order to be invoked
8-
set(CLIFP_RES_PATH "${CMAKE_CURRENT_BINARY_DIR}/res/file/CLIFp.exe")
8+
set(CLIFP_RES_PATH "${CMAKE_CURRENT_BINARY_DIR}/res/file/clifp")
99
add_custom_command(OUTPUT
1010
"${CLIFP_RES_PATH}"
1111
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:CLIFp::CLIFp>
@@ -22,63 +22,84 @@ add_custom_target(fil_copy_clifp
2222
)
2323

2424
# ------------------ Setup FIL --------------------------
25+
set(FIL_SOURCE
26+
frontend/fe-data.h
27+
frontend/fe-data.cpp
28+
frontend/fe-installfoundation.h
29+
frontend/fe-installfoundation.cpp
30+
frontend/fe-installfoundation_win.cpp
31+
frontend/fe-installfoundation_linux.cpp
32+
frontend/fe-install.h
33+
frontend/fe-install.cpp
34+
frontend/fe-items.h
35+
frontend/fe-items.cpp
36+
frontend/attractmode/am-data.h
37+
frontend/attractmode/am-data.cpp
38+
frontend/attractmode/am-install.h
39+
frontend/attractmode/am-install.cpp
40+
frontend/attractmode/am-install_win.cpp
41+
frontend/attractmode/am-install_linux.cpp
42+
frontend/attractmode/am-items.h
43+
frontend/attractmode/am-items.cpp
44+
frontend/attractmode/am-settings-data.h
45+
frontend/attractmode/am-settings-data.cpp
46+
frontend/attractmode/am-settings-items.h
47+
frontend/attractmode/am-settings-items.cpp
48+
ui/mainwindow.h
49+
ui/mainwindow.cpp
50+
ui/mainwindow.ui
51+
ui/progresspresenter.h
52+
ui/progresspresenter.cpp
53+
clifp.h
54+
clifp.cpp
55+
import-worker.h
56+
import-worker.cpp
57+
main.cpp
58+
)
2559

26-
# Add via ob standard executable
27-
include(OB/Executable)
28-
ob_add_standard_executable(${APP_TARGET_NAME}
29-
NAMESPACE "${PROJECT_NAMESPACE}"
30-
ALIAS "${APP_ALIAS_NAME}"
31-
SOURCE
32-
clifp.h
33-
clifp.cpp
34-
frontend/fe-data.h
35-
frontend/fe-data.cpp
36-
frontend/fe-installfoundation.h
37-
frontend/fe-installfoundation.cpp
38-
frontend/fe-install.h
39-
frontend/fe-install.cpp
40-
frontend/fe-items.h
41-
frontend/fe-items.cpp
42-
frontend/attractmode/am-data.h
43-
frontend/attractmode/am-data.cpp
44-
frontend/attractmode/am-install.h
45-
frontend/attractmode/am-install.cpp
46-
frontend/attractmode/am-items.h
47-
frontend/attractmode/am-items.cpp
48-
frontend/attractmode/am-settings-data.h
49-
frontend/attractmode/am-settings-data.cpp
50-
frontend/attractmode/am-settings-items.h
51-
frontend/attractmode/am-settings-items.cpp
60+
if(CMAKE_SYSTEM_NAME STREQUAL Windows)
61+
list(APPEND FIL_SOURCE
5262
frontend/launchbox/lb-data.h
5363
frontend/launchbox/lb-data.cpp
5464
frontend/launchbox/lb-install.h
5565
frontend/launchbox/lb-install.cpp
5666
frontend/launchbox/lb-items.h
5767
frontend/launchbox/lb-items.cpp
58-
import-worker.h
59-
import-worker.cpp
60-
mainwindow.h
61-
mainwindow.cpp
62-
mainwindow.ui
63-
main.cpp
68+
)
69+
endif()
70+
71+
set(FIL_LINKS
72+
PRIVATE
73+
Qt6::Core
74+
Qt6::Gui
75+
Qt6::Widgets
76+
Qt6::Xml
77+
Qt6::Sql
78+
Qx::Core
79+
Qx::Io
80+
Qx::Gui
81+
Qx::Network
82+
Qx::Widgets
83+
Qx::Xml
84+
Fp::Fp
85+
magic_enum::magic_enum
86+
)
87+
88+
if(CMAKE_SYSTEM_NAME STREQUAL Windows)
89+
list(APPEND FIL_LINKS
90+
Qx::Windows
91+
Qx::Windows-gui
92+
)
93+
endif()
94+
95+
# Add via ob standard executable
96+
include(OB/Executable)
97+
ob_add_standard_executable(${APP_TARGET_NAME}
98+
NAMESPACE "${PROJECT_NAMESPACE}"
99+
ALIAS "${APP_ALIAS_NAME}"
100+
SOURCE ${FIL_SOURCE}
64101
RESOURCE "resources.qrc"
65-
LINKS
66-
PRIVATE
67-
Qt6::Core
68-
Qt6::Gui
69-
Qt6::Widgets
70-
Qt6::Xml
71-
Qt6::Sql
72-
Qx::Core
73-
Qx::Io
74-
Qx::Gui
75-
Qx::Network
76-
Qx::Widgets
77-
Qx::Windows
78-
Qx::Windows-gui
79-
Qx::Xml
80-
Fp::Fp
81-
magic_enum::magic_enum
102+
LINKS ${FIL_LINKS}
82103
CONFIG STANDARD
83104
WIN32
84105
)
@@ -104,20 +125,23 @@ ob_add_cpp_vars(${APP_TARGET_NAME}
104125
SHORT_NAME "\"${PROJECT_NAME}\""
105126
VERSION_STR "\"${PROJECT_VERSION}\""
106127
TARGET_FP_VER_PFX_STR "\"${TARGET_FP_VERSION_PREFIX}\""
128+
BUNDLED_CLIFP_VERSION "\"${CLIFp_VERSION}\""
107129
)
108130

109131
# Set target exe details
110-
include(OB/WinExecutableDetails)
111-
ob_set_win_executable_details(${APP_TARGET_NAME}
112-
ICON "res/app/FIL.ico"
113-
FILE_VER ${PROJECT_VERSION}
114-
PRODUCT_VER ${TARGET_FP_VERSION_PREFIX}
115-
COMPANY_NAME "oblivioncth"
116-
FILE_DESC "Flashpoint Importer for Launchers"
117-
INTERNAL_NAME "FIL"
118-
COPYRIGHT "Open Source @ 2021 oblivioncth"
119-
TRADEMARKS_ONE "All Rights Reserved"
120-
TRADEMARKS_TWO "GNU AGPL V3"
121-
ORIG_FILENAME "FIL.exe"
122-
PRODUCT_NAME "${PROJECT_DESCRIPTION}"
123-
)
132+
if(CMAKE_SYSTEM_NAME STREQUAL Windows)
133+
include(OB/WinExecutableDetails)
134+
ob_set_win_executable_details(${APP_TARGET_NAME}
135+
ICON "res/app/FIL.ico"
136+
FILE_VER ${PROJECT_VERSION}
137+
PRODUCT_VER ${TARGET_FP_VERSION_PREFIX}
138+
COMPANY_NAME "oblivioncth"
139+
FILE_DESC "Flashpoint Importer for Launchers"
140+
INTERNAL_NAME "FIL"
141+
COPYRIGHT "Open Source @ 2021 oblivioncth"
142+
TRADEMARKS_ONE "All Rights Reserved"
143+
TRADEMARKS_TWO "GNU AGPL V3"
144+
ORIG_FILENAME "FIL.exe"
145+
PRODUCT_NAME "${PROJECT_DESCRIPTION}"
146+
)
147+
endif()

app/src/clifp.cpp

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,56 @@
22
#include "clifp.h"
33

44
// Qx Includes
5+
#ifdef _WIN32
56
#include <qx/windows/qx-filedetails.h>
7+
#endif
68

79
// libfp Includes
810
#include <fp/fp-install.h>
911

12+
// Project Includes
13+
#include "project_vars.h"
14+
1015
//===============================================================================================================
1116
// CLIFp
1217
//===============================================================================================================
1318

1419
//-Class Functions--------------------------------------------------------------------------------------------
1520
//Public:
16-
QString CLIFp::standardCLIFpPath(const Fp::Install& fpInstall) { return fpInstall.dir().absoluteFilePath(EXE_NAME); }
17-
18-
bool CLIFp::hasCLIFp(const Fp::Install& fpInstall)
21+
Qx::VersionNumber CLIFp::internalVersion()
1922
{
20-
QFileInfo presentInfo(standardCLIFpPath(fpInstall));
21-
return presentInfo.exists() && presentInfo.isFile();
23+
static Qx::VersionNumber v = Qx::VersionNumber::fromString(PROJECT_BUNDLED_CLIFP_VERSION);
24+
return v;
2225
}
2326

24-
Qx::VersionNumber CLIFp::currentCLIFpVersion(const Fp::Install& fpInstall)
27+
Qx::VersionNumber CLIFp::installedVersion(const Fp::Install& fpInstall)
2528
{
2629
if(!hasCLIFp(fpInstall))
2730
return Qx::VersionNumber();
2831
else
32+
{
33+
#ifdef _WIN32
2934
return Qx::FileDetails::readFileDetails(standardCLIFpPath(fpInstall)).fileVersion();
35+
#endif
36+
/* TODO: For now on Linux we just return a null version so that deployment always
37+
* occurs. Eventually, find a good way to grab version info from the installed ELF.
38+
*
39+
* Currently, we can't run it since it doesn't output to console, and there is no
40+
* standardized way to embed the info as part of the ELF structure.
41+
*/
42+
return Qx::VersionNumber();
43+
}
44+
}
45+
46+
QString CLIFp::standardCLIFpPath(const Fp::Install& fpInstall) { return fpInstall.dir().absoluteFilePath(EXE_NAME); }
47+
48+
bool CLIFp::hasCLIFp(const Fp::Install& fpInstall)
49+
{
50+
QFileInfo presentInfo(standardCLIFpPath(fpInstall));
51+
return presentInfo.exists() && presentInfo.isFile();
3052
}
3153

32-
bool CLIFp::deployCLIFp(QString& errorMsg, const Fp::Install& fpInstall, const QString& sourcePath)
54+
bool CLIFp::deployCLIFp(QString& errorMsg, const Fp::Install& fpInstall)
3355
{
3456
// Delete existing if present
3557
QFile clifp(standardCLIFpPath(fpInstall));
@@ -44,7 +66,7 @@ bool CLIFp::deployCLIFp(QString& errorMsg, const Fp::Install& fpInstall, const Q
4466
}
4567

4668
// Deploy new
47-
QFile internalCLIFp(sourcePath);
69+
QFile internalCLIFp(u":/file/clifp"_s);
4870
if(!internalCLIFp.copy(clifp.fileName()))
4971
{
5072
errorMsg = internalCLIFp.errorString();

0 commit comments

Comments
 (0)