Refactor CMakeLists to conditionally include SCRCPY for macOS.
Moved the inclusion of SCRCPY and executable definition to within the APPLE conditional block. This ensures platform-specific sources are handled appropriately, improving configurability and avoiding redundancy.
This commit is contained in:
parent
d52574c50f
commit
bf976f04c7
@ -22,12 +22,9 @@ elseif (APPLE)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17) # или 20, если нужно
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ObjC++")
|
||||
set(SCRCPY ${CMAKE_CURRENT_SOURCE_DIR}/views/scrcpy/ScrcpyWindow_mac.mm)
|
||||
endif ()
|
||||
|
||||
set(SCRCPY
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/views/scrcpy/ScrcpyWindow_mac.mm
|
||||
)
|
||||
|
||||
find_package(Qt6 REQUIRED COMPONENTS
|
||||
Widgets
|
||||
Sql
|
||||
@ -53,16 +50,15 @@ file(GLOB_RECURSE MODELS_SOURCES
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/models/*.h"
|
||||
)
|
||||
|
||||
add_executable(ARCDesktopProject
|
||||
if (WIN32)
|
||||
add_executable(ARCDesktopProject
|
||||
main.cpp
|
||||
${VIEW_SOURCES}
|
||||
${SERVICES_SOURCES}
|
||||
${DB_SOURCES}
|
||||
${MODELS_SOURCES}
|
||||
${SCRCPY}
|
||||
)
|
||||
)
|
||||
|
||||
if (WIN32)
|
||||
target_link_libraries(ARCDesktopProject
|
||||
Qt6::Widgets
|
||||
Qt6::Sql
|
||||
@ -75,6 +71,15 @@ if (WIN32)
|
||||
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/rus.traineddata" DESTINATION "${CMAKE_BINARY_DIR}")
|
||||
|
||||
elseif (APPLE)
|
||||
add_executable(ARCDesktopProject
|
||||
main.cpp
|
||||
${VIEW_SOURCES}
|
||||
${SERVICES_SOURCES}
|
||||
${DB_SOURCES}
|
||||
${MODELS_SOURCES}
|
||||
${SCRCPY}
|
||||
)
|
||||
|
||||
target_link_libraries(ARCDesktopProject
|
||||
Qt6::Widgets
|
||||
Qt6::Sql
|
||||
|
||||
Loading…
Reference in New Issue
Block a user