Skip to content

Commit

Permalink
Refactor CMake source gathering
Browse files Browse the repository at this point in the history
  • Loading branch information
eplatonoff committed Sep 14, 2024
1 parent 98966d0 commit 0665d79
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ target_wrapper.*
*.qmlproject.user
*.qmlproject.user.*

# QtCreator CMake
CMakeLists.txt.user*
.idea/
.zed/

build

Expand Down
14 changes: 8 additions & 6 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ find_package(Qt6 REQUIRED COMPONENTS
Multimedia
)

include_directories(".")
include_directories(${PROJECT_SOURCE_DIR})
file(GLOB_RECURSE SRCS RELATIVE ${PROJECT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/*.cpp)
file(GLOB_RECURSE HDRS RELATIVE ${PROJECT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/*.h)
file(GLOB_RECURSE QRCS RELATIVE ${PROJECT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/*.qrc)

file(GLOB SRCS_TOP ${PROJECT_SOURCE_DIR}/*.cpp)
file( GLOB_RECURSE SRCS_NESTED)
file( GLOB_RECURSE HDRS)
file( GLOB_RECURSE QRCS *.qrc)
list(FILTER SRCS EXCLUDE REGEX "^build/")
list(FILTER HDRS EXCLUDE REGEX "^build/")
list(FILTER QRCS EXCLUDE REGEX "^build/")

IF(APPLE)
SET(CMAKE_EXE_LINKER_FLAGS "-framework Foundation -w")
Expand All @@ -32,7 +34,7 @@ IF(APPLE)
)
ENDIF()

set(SOURCE_FILES ${SRCS_TOP} ${SRCS_NESTED} ${HDRS} ${QRCS})
set(SOURCE_FILES ${SRCS} ${HDRS} ${QRCS})

qt_add_resources(SOURCE_FILES qml.qrc)

Expand Down
2 changes: 1 addition & 1 deletion src/mac/bundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ if [ "${CONFIGURATION}" == "Release" ] || [ "${CONFIGURATION}" == "MinSizeRel" ]
echo "Removing .dSYM from the bundle: $dsym"
rm -rf "$dsym"
done
fi
fi

0 comments on commit 0665d79

Please sign in to comment.