Skip to content

Commit

Permalink
reorganize resources
Browse files Browse the repository at this point in the history
  • Loading branch information
AllanChain committed Jul 12, 2024
1 parent 8886f5e commit 7a4eb52
Show file tree
Hide file tree
Showing 13 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(QT NAMES Qt6 REQUIRED COMPONENTS Widgets)
find_package(Qt6 REQUIRED COMPONENTS Widgets)

file(GLOB PROJECT_SOURCES "src/*.cpp" "src/*.h" "resources.qrc")
file(GLOB PROJECT_SOURCES "src/*.cpp" "src/*.h" "resources/index.qrc")

if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
file(GLOB_RECURSE PROJECT_SOURCES_LINUX "src/linux/*")
Expand All @@ -21,7 +21,7 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
file(GLOB_RECURSE PROJECT_SOURCES_MACOS "src/macos/*")
list(APPEND PROJECT_SOURCES ${PROJECT_SOURCES_MACOS})
set(MACOSX_BUNDLE_ICON_FILE icon.icns)
set(SANE_BREAK_ICON ${CMAKE_CURRENT_SOURCE_DIR}/images/icon.icns)
set(SANE_BREAK_ICON ${CMAKE_CURRENT_SOURCE_DIR}/packaging/macos/icon.icns)
set_source_files_properties(${SANE_BREAK_ICON} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
list(APPEND PROJECT_SOURCES ${SANE_BREAK_ICON})
elseif (CMAKE_SYSTEM_NAME STREQUAL "Windows")
Expand Down Expand Up @@ -50,7 +50,8 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
target_link_libraries(sane-break PRIVATE "-framework IOKit")
target_link_libraries(sane-break PRIVATE "-framework CoreFoundation")
set_target_properties(sane-break PROPERTIES
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/MacOSXBundleInfo.plist.in")
MACOSX_BUNDLE_INFO_PLIST
"${CMAKE_CURRENT_SOURCE_DIR}/packaging/macos/MacOSXBundleInfo.plist.in")
endif()

set_target_properties(sane-break PROPERTIES
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
2 changes: 1 addition & 1 deletion resources.qrc → resources/index.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
<file>images/[email protected]</file>
<file>images/icon-lime.png</file>
<file>images/icon-yellow.png</file>
<file>src/style.css</file>
<file>style.css</file>
</qresource>
</RCC>
File renamed without changes.
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ int main(int argc, char *argv[]) {
a.setApplicationDisplayName("Sane Break");
SaneBreakApp *app = new SaneBreakApp();

QFile styleSheet(":/src/style.css");
QFile styleSheet(":/style.css");
if (styleSheet.open(QIODevice::ReadOnly | QIODevice::Text))
a.setStyleSheet(styleSheet.readAll());

Expand Down

0 comments on commit 7a4eb52

Please sign in to comment.