build: consolidate cmake vars more
move most project defines needed in cmake to the main file
This commit is contained in:
committed by
Chris Rizzitello
parent
5be1e9f9b9
commit
aff25415ff
@ -92,9 +92,10 @@ project(
|
||||
LANGUAGES C CXX)
|
||||
|
||||
# Define Additional "PROJECT" vars for packaging and metadata
|
||||
set(CMAKE_PROJECT_COPYRIGHT "(C) 2024-2025 Deskflow Devs")
|
||||
set(CMAKE_PROJECT_PROPER_NAME "Deskflow")
|
||||
set(CMAKE_PROJECT_VENDOR "Deskflow Devs")
|
||||
set(CMAKE_PROJECT_VENDOR "${CMAKE_PROJECT_PROPER_NAME} Devs")
|
||||
set(CMAKE_PROJECT_COPYRIGHT "(C) 2024-2025 ${CMAKE_PROJECT_VENDOR}")
|
||||
set(CMAKE_PROJECT_CONTACT "${CMAKE_PROJECT_PROPER_NAME} <maintainers@deskflow.org>")
|
||||
|
||||
#Unset the vars used in the project call
|
||||
unset(DESKFLOW_VERSION_MAJOR)
|
||||
|
||||
@ -12,7 +12,7 @@ file(COPY_FILE
|
||||
# Generic Package Items
|
||||
set(CPACK_STRIP_FILES TRUE)
|
||||
set(CPACK_PACKAGE_NAME ${CMAKE_PROJECT_NAME})
|
||||
set(CPACK_PACKAGE_CONTACT "Deskflow <maintainers@deskflow.org>")
|
||||
set(CPACK_PACKAGE_CONTACT ${CMAKE_PROJECT_CONTACT})
|
||||
set(CPACK_PACKAGE_DESCRIPTION ${CMAKE_PROJECT_DESCRIPTION})
|
||||
set(CPACK_PACKAGE_VENDOR ${CMAKE_PROJECT_VENDOR})
|
||||
set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_BINARY_DIR}/LICENSE.txt)
|
||||
|
||||
@ -7,7 +7,7 @@ set(MY_DIR ${CMAKE_CURRENT_LIST_DIR})
|
||||
|
||||
install(CODE "execute_process(COMMAND
|
||||
${DEPLOYQT}
|
||||
\"\${CMAKE_INSTALL_PREFIX}/Deskflow.app\"
|
||||
\"\${CMAKE_INSTALL_PREFIX}/${CMAKE_PROJECT_PROPER_NAME}.app\"
|
||||
-timestamp -codesign=-
|
||||
)")
|
||||
|
||||
@ -15,6 +15,6 @@ set(OS_STRING "macos-${CMAKE_SYSTEM_PROCESSOR}")
|
||||
set(CPACK_PACKAGE_ICON "${MY_DIR}/dmg-volume.icns")
|
||||
set(CPACK_DMG_BACKGROUND_IMAGE "${MY_DIR}/dmg-background.tiff")
|
||||
set(CPACK_DMG_DS_STORE_SETUP_SCRIPT "${MY_DIR}/generate_ds_store.applescript")
|
||||
set(CPACK_DMG_VOLUME_NAME "Deskflow")
|
||||
set(CPACK_DMG_VOLUME_NAME "${CMAKE_PROJECT_PROPER_NAME}")
|
||||
set(CPACK_DMG_SLA_USE_RESOURCE_FILE_LICENSE ON)
|
||||
set(CPACK_GENERATOR "DragNDrop")
|
||||
|
||||
@ -25,14 +25,14 @@ if (NOT "${WIX_APP}" STREQUAL "")
|
||||
list(APPEND CPACK_GENERATOR "WIX")
|
||||
endif()
|
||||
|
||||
set(CPACK_PACKAGE_NAME "Deskflow")
|
||||
set(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_PROPER_NAME}")
|
||||
|
||||
# Menu Entry
|
||||
set(CPACK_WIX_PROGRAM_MENU_FOLDER "Deskflow")
|
||||
set(CPACK_PACKAGE_EXECUTABLES "deskflow" "Deskflow")
|
||||
set(CPACK_WIX_PROGRAM_MENU_FOLDER "${CMAKE_PROJECT_PROPER_NAME}")
|
||||
set(CPACK_PACKAGE_EXECUTABLES "deskflow" "${CMAKE_PROJECT_PROPER_NAME}")
|
||||
|
||||
# Default Install Path
|
||||
set(CPACK_PACKAGE_INSTALL_DIRECTORY "Deskflow")
|
||||
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CMAKE_PROJECT_PROPER_NAME}")
|
||||
|
||||
# Wix Specific Values
|
||||
set(CPACK_WIX_UPGRADE_GUID "027D1C8A-E7A5-4754-BB93-B2D45BFDBDC8")
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(target deskflow-client)
|
||||
set(target ${CMAKE_PROJECT_NAME}-client)
|
||||
|
||||
if(WIN32)
|
||||
# Generate rc file
|
||||
@ -42,7 +42,7 @@ if(WIN32)
|
||||
set(EXE_RC_MENU "
|
||||
IDR_TASKBAR MENU DISCARDABLE
|
||||
BEGIN
|
||||
POPUP \"Deskflow\"
|
||||
POPUP \"${CMAKE_PROJECT_PROPER_NAME}\"
|
||||
BEGIN
|
||||
MENUITEM \"Show Status\", IDC_TASKBAR_STATUS
|
||||
MENUITEM \"Show Log\", IDC_TASKBAR_SHOW_LOG
|
||||
@ -66,16 +66,16 @@ if(WIN32)
|
||||
set(EXE_RC_STRINGTABLE "
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_FAILED \"Deskflow is about to quit with errors or warnings. Please check the log then click OK.\"
|
||||
IDS_INIT_FAILED \"Deskflow failed to initialize: %{1}\"
|
||||
IDS_FAILED \"${CMAKE_PROJECT_PROPER_NAME} is about to quit with errors or warnings. Please check the log then click OK.\"
|
||||
IDS_INIT_FAILED \"${CMAKE_PROJECT_PROPER_NAME} failed to initialize: %{1}\"
|
||||
IDS_UNCAUGHT_EXCEPTION \"Uncaught exception: %{1}\"
|
||||
END
|
||||
")
|
||||
|
||||
configure_file(${CMAKE_SOURCE_DIR}/src/apps/res/rc_template.rc.in deskflow-client.rc)
|
||||
configure_file(${CMAKE_SOURCE_DIR}/src/apps/res/rc_template.rc.in ${target}.rc)
|
||||
|
||||
set(PLATFORM_SOURCES
|
||||
deskflow-client.exe.manifest
|
||||
${target}.exe.manifest
|
||||
MSWindowsClientTaskBarReceiver.cpp
|
||||
MSWindowsClientTaskBarReceiver.h
|
||||
resource.h
|
||||
@ -83,7 +83,7 @@ if(WIN32)
|
||||
${PROJECT_SOURCE_DIR}/src/apps/res/tb_error.ico
|
||||
${PROJECT_SOURCE_DIR}/src/apps/res/tb_idle.ico
|
||||
${PROJECT_SOURCE_DIR}/src/apps/res/tb_run.ico
|
||||
${CMAKE_CURRENT_BINARY_DIR}/deskflow-client.rc
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${target}.rc
|
||||
)
|
||||
elseif(APPLE)
|
||||
set(PLATFORM_SOURCES
|
||||
@ -97,7 +97,7 @@ elseif(UNIX)
|
||||
)
|
||||
endif()
|
||||
|
||||
add_executable(${target} ${PLATFORM_SOURCES} deskflow-client.cpp)
|
||||
add_executable(${target} ${PLATFORM_SOURCES} ${target}.cpp)
|
||||
|
||||
target_link_libraries(
|
||||
${target}
|
||||
@ -114,7 +114,7 @@ target_link_libraries(
|
||||
${libs})
|
||||
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
set_target_properties(${target} PROPERTIES RUNTIME_OUTPUT_DIRECTORY $<TARGET_BUNDLE_CONTENT_DIR:Deskflow>/MacOS)
|
||||
set_target_properties(${target} PROPERTIES RUNTIME_OUTPUT_DIRECTORY $<TARGET_BUNDLE_CONTENT_DIR:${CMAKE_PROJECT_PROPER_NAME}>/MacOS)
|
||||
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
install(TARGETS ${target} DESTINATION bin)
|
||||
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
|
||||
|
||||
@ -15,17 +15,17 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(target deskflow-core)
|
||||
set(target ${CMAKE_PROJECT_NAME}-core)
|
||||
|
||||
add_executable(${target} "${target}.cpp")
|
||||
if(WIN32)
|
||||
# Generate rc file
|
||||
set(EXE_DESCRIPTION "${CMAKE_PROJECT_DESCRIPTION}\\n CLI combined server and client")
|
||||
configure_file(${CMAKE_SOURCE_DIR}/src/apps/res/rc_template.rc.in deskflow-core.rc)
|
||||
configure_file(${CMAKE_SOURCE_DIR}/src/apps/res/rc_template.rc.in ${target}.rc)
|
||||
|
||||
target_sources(${target} PRIVATE
|
||||
"${target}.exe.manifest"
|
||||
${CMAKE_CURRENT_BINARY_DIR}/deskflow-core.rc
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${target}.rc
|
||||
)
|
||||
endif()
|
||||
|
||||
@ -44,7 +44,7 @@ target_link_libraries(
|
||||
${libs})
|
||||
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
set_target_properties(${target} PROPERTIES RUNTIME_OUTPUT_DIRECTORY $<TARGET_BUNDLE_CONTENT_DIR:Deskflow>/MacOS)
|
||||
set_target_properties(${target} PROPERTIES RUNTIME_OUTPUT_DIRECTORY $<TARGET_BUNDLE_CONTENT_DIR:${CMAKE_PROJECT_PROPER_NAME}>/MacOS)
|
||||
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
install(TARGETS ${target} DESTINATION bin)
|
||||
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
|
||||
|
||||
@ -17,16 +17,13 @@
|
||||
|
||||
# Daemon is only needed on Windows for elevating processes to deal with UAC.
|
||||
if(WIN32)
|
||||
set(target deskflow-daemon)
|
||||
set(target ${CMAKE_PROJECT_NAME}-daemon)
|
||||
|
||||
# Generate rc file
|
||||
set(EXE_DESCRIPTION "This service runs in the background to help deskflow deal with UAC prompts")
|
||||
configure_file(${CMAKE_SOURCE_DIR}/src/apps/res/rc_template.rc.in deskflow-deamon.rc)
|
||||
set(EXE_DESCRIPTION "This service runs in the background to help ${CMAKE_PROJECT_NAME} deal with UAC prompts")
|
||||
configure_file(${CMAKE_SOURCE_DIR}/src/apps/res/rc_template.rc.in ${target}.rc)
|
||||
|
||||
add_executable(${target} WIN32
|
||||
deskflow-daemon.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/deskflow-daemon.rc
|
||||
)
|
||||
add_executable(${target} WIN32 ${target}.cpp ${CMAKE_CURRENT_BINARY_DIR}/${target}.rc)
|
||||
|
||||
target_link_libraries(
|
||||
${target}
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(target deskflow-server)
|
||||
set(target ${CMAKE_PROJECT_NAME}-server)
|
||||
|
||||
if(WIN32)
|
||||
# Generate rc file
|
||||
@ -43,7 +43,7 @@ if(WIN32)
|
||||
set(EXE_RC_MENU "
|
||||
IDR_TASKBAR MENU DISCARDABLE
|
||||
BEGIN
|
||||
POPUP \"Deskflow\"
|
||||
POPUP \"${CMAKE_PROJECT_PROPER_NAME}\"
|
||||
BEGIN
|
||||
MENUITEM \"Show Status\", IDC_TASKBAR_STATUS
|
||||
MENUITEM \"Show Log\", IDC_TASKBAR_SHOW_LOG
|
||||
@ -70,16 +70,16 @@ if(WIN32)
|
||||
set(EXE_RC_STRINGTABLE "
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_FAILED \"Deskflow is about to quit with errors or warnings. Please check the log then click OK.\"
|
||||
IDS_INIT_FAILED \"Deskflow failed to initialize: %{1}\"
|
||||
IDS_FAILED \"${CMAKE_PROJECT_PROPER_NAME} is about to quit with errors or warnings. Please check the log then click OK.\"
|
||||
IDS_INIT_FAILED \"${CMAKE_PROJECT_PROPER_NAME} failed to initialize: %{1}\"
|
||||
IDS_UNCAUGHT_EXCEPTION \"Uncaught exception: %{1}\"
|
||||
END
|
||||
")
|
||||
|
||||
configure_file(${CMAKE_SOURCE_DIR}/src/apps/res/rc_template.rc.in deskflow-server.rc)
|
||||
configure_file(${CMAKE_SOURCE_DIR}/src/apps/res/rc_template.rc.in ${target}.rc)
|
||||
|
||||
set(PLATFORM_SOURCES
|
||||
deskflow-server.exe.manifest
|
||||
${target}.exe.manifest
|
||||
MSWindowsServerTaskBarReceiver.cpp
|
||||
MSWindowsServerTaskBarReceiver.h
|
||||
resource.h
|
||||
@ -87,7 +87,7 @@ if(WIN32)
|
||||
${PROJECT_SOURCE_DIR}/src/apps/res/tb_error.ico
|
||||
${PROJECT_SOURCE_DIR}/src/apps/res/tb_idle.ico
|
||||
${PROJECT_SOURCE_DIR}/src/apps/res/tb_run.ico
|
||||
${CMAKE_CURRENT_BINARY_DIR}/deskflow-server.rc
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${target}.rc
|
||||
)
|
||||
elseif(APPLE)
|
||||
set(PLATFORM_SOURCES
|
||||
@ -101,7 +101,7 @@ elseif(UNIX)
|
||||
)
|
||||
endif()
|
||||
|
||||
add_executable(${target} ${PLATFORM_SOURCES} deskflow-server.cpp)
|
||||
add_executable(${target} ${PLATFORM_SOURCES} ${target}.cpp)
|
||||
|
||||
target_link_libraries(
|
||||
${target}
|
||||
@ -118,7 +118,7 @@ target_link_libraries(
|
||||
${libs})
|
||||
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
set_target_properties(${target} PROPERTIES RUNTIME_OUTPUT_DIRECTORY $<TARGET_BUNDLE_CONTENT_DIR:Deskflow>/MacOS)
|
||||
set_target_properties(${target} PROPERTIES RUNTIME_OUTPUT_DIRECTORY $<TARGET_BUNDLE_CONTENT_DIR:${CMAKE_PROJECT_PROPER_NAME}>/MacOS)
|
||||
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
install(TARGETS ${target} DESTINATION bin)
|
||||
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
|
||||
|
||||
Reference in New Issue
Block a user