X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fmain%2FCMakeLists.txt;h=6ef3f7833cac4aeea818b5624469f82dde244804;hb=f9efdde7f3a6004af8f834c409cfa6ae1d877692;hp=036746723dfc6062e14cb29e65227d24838e6907;hpb=1e40fc6bc04df8f658f677ca5be4c970f150dc10;p=quassel.git diff --git a/src/main/CMakeLists.txt b/src/main/CMakeLists.txt index 03674672..6ef3f783 100644 --- a/src/main/CMakeLists.txt +++ b/src/main/CMakeLists.txt @@ -8,11 +8,6 @@ function(setup_executable _target _define) install(TARGETS ${_target} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endfunction() -# We need to initialize the appropriate resources, so let's give our main.cpp some hints -if (EMBED_DATA) - set_property(SOURCE main.cpp APPEND PROPERTY COMPILE_DEFINITIONS EMBED_DATA) -endif() - if (HAVE_UMASK) set_property(SOURCE main.cpp APPEND PROPERTY COMPILE_DEFINITIONS HAVE_UMASK) endif() @@ -21,14 +16,32 @@ if (WITH_BUNDLED_ICONS) set_property(SOURCE main.cpp APPEND PROPERTY COMPILE_DEFINITIONS WITH_BUNDLED_ICONS) endif() +# Windows icon resource +if(WIN32) + if(MINGW) + find_program(WINDRES_EXECUTABLE NAMES windres) + if(WINDRES_EXECUTABLE) + exec_program(windres + ARGS "-i ${CMAKE_SOURCE_DIR}/pics/win32.rc" + "-o ${CMAKE_CURRENT_BINARY_DIR}/win32.o" + "--include-dir=${CMAKE_SOURCE_DIR}/pics" + ) + set(WIN_RC ${CMAKE_CURRENT_BINARY_DIR}/win32.o) + endif() + else() + set(WIN_RC ${CMAKE_SOURCE_DIR}/pics/win32.rc) + endif() +endif() + + # Build the executables if (WANT_CORE) - add_executable(quasselcore main.cpp) + add_executable(quasselcore main.cpp ${WIN_RC}) setup_executable(quasselcore -DBUILD_CORE Qt5::Core Quassel::Core) endif() if (WANT_CLIENT OR WANT_QTCLIENT) - add_executable(quasselclient WIN32 main.cpp) + add_executable(quasselclient WIN32 main.cpp ${WIN_RC}) setup_executable(quasselclient -DBUILD_QTUI Qt5::Core Qt5::Gui Quassel::QtUi) if (WITH_KDE) target_link_libraries(quasselclient PRIVATE KF5::CoreAddons) @@ -36,7 +49,7 @@ if (WANT_CLIENT OR WANT_QTCLIENT) endif() if (WANT_MONO) - add_executable(quassel WIN32 main.cpp monoapplication.cpp) + add_executable(quassel WIN32 main.cpp monoapplication.cpp ${WIN_RC}) setup_executable(quassel -DBUILD_MONO Qt5::Core Qt5::Gui Quassel::Core Quassel::QtUi) if (WITH_KDE) target_link_libraries(quassel PRIVATE KF5::CoreAddons)