Results 1 to 4 of 4

Thread: QMake doesnt do simple things in Windows

  1. #1
    Join Date
    Mar 2010
    Posts
    13
    Qt products
    Qt4
    Platforms
    Windows

    Exclamation QMake doesnt do simple things in Windows

    Hi,

    I have created a project that will compile SFML in all platforms.

    You can get project here:
    https://github.com/prsolucoes/sfml-project

    When you download, you will see that the .pro file have 3 builds (one for each platforms).
    The mac version is OK. The linux version is not implemented yet.
    And the windows version is what im trying finish now.
    The project is compiled with success, the problem is when i try copy all dlls to destination path and
    put the icon in .EXE file, like i do with mac final binary.
    It doesnt work with or without shadown build. Can anyone download the project and try help me on windows?

    Im using last qt sdk.
    Last edited by prchakal; 23rd April 2012 at 21:22.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: QMake doesnt do simple things in Windows

    The project is compiled with success, the problem is when i try copy all dlls to destination path
    Would you care to share what the problem is? Exactly what commands are executed? What are the error messages?
    IIRC there have been issues with INSTALLS and generated copy commands on Windows. I don't know if there still are, or if any of these apply to you.

    and put the icon in .EXE file, like i do with mac final binary.
    Nothing in your PRO file even attempts this. You put the application icon into the Windows application using a Windows resource file (RC_FILE) and an icon in Windows ICO format. That information is in the Qt docs.

    Here is the offending PRO file for those not willing to clone the git repo:
    Qt Code:
    1. TEMPLATE = app
    2. CONFIG += console
    3. CONFIG -= qt
    4.  
    5. SOURCES += main.cpp
    6.  
    7. ###############################################
    8. # CONFIGURATION
    9. ###############################################
    10.  
    11. CONFIG_APP_NAME = sfml-project
    12.  
    13. macx {
    14. CONFIG_PLATFORM_PATH = mac
    15. CONFIG_ICON_EXTENSION = icns
    16. }
    17.  
    18. win32 {
    19. CONFIG_PLATFORM_PATH = win32
    20. CONFIG_ICON_EXTENSION = png
    21. }
    22.  
    23. unix:!macx {
    24. CONFIG_PLATFORM_PATH = unix
    25. CONFIG_ICON_EXTENSION = png
    26. }
    27.  
    28. ICON = $${PWD}/resources/$${CONFIG_PLATFORM_PATH}/app.$${CONFIG_ICON_EXTENSION}
    29. TARGET = $${CONFIG_APP_NAME}
    30.  
    31. ###############################################
    32. # SFML LIBRARY
    33. ###############################################
    34.  
    35. INCLUDEPATH += "$${PWD}/library/sfml/$${CONFIG_PLATFORM_PATH}/include"
    36. LIBS += -L"$${PWD}/library/sfml/$${CONFIG_PLATFORM_PATH}/lib" \
    37. -lsfml-system \
    38. -lsfml-window \
    39. -lsfml-graphics \
    40. -lsfml-audio \
    41. -lsfml-network
    42.  
    43. macx {
    44. sfml-library.path = Contents/Frameworks
    45. sfml-library.files = $${PWD}/library/sfml/$${CONFIG_PLATFORM_PATH}/lib/
    46. QMAKE_BUNDLE_DATA += sfml-library
    47. }
    48.  
    49. win32 {
    50. sfml-library.path = $${DESTDIR}
    51. sfml-library.files = $${PWD}/library/sfml/$${CONFIG_PLATFORM_PATH}/bin/
    52. INSTALLS += sfml-library
    53. #QMAKE_BUNDLE_DATA += sfml-library
    54. #PRE_TARGETDEPS += $${PWD}/library/sfml/$${CONFIG_PLATFORM_PATH}/bin/*
    55. #copyfiles.commands += copy /y $${PWD}\\library\\sfml\\$${CONFIG_PLATFORM_PATH}\\bin\\sfml-system-2.dll debug
    56. #QMAKE_EXTRA_TARGETS += copyfiles
    57. }
    58.  
    59. unix:!macx {
    60. # need implement
    61. }
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Mar 2010
    Posts
    13
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QMake doesnt do simple things in Windows

    Hi.

    As you see in .pro file, i try many commands to copy DLLS, but the principal issue is that DESTDIR is empty.

    I try this methods:

    # method 1
    sfml-library.path = $${DESTDIR}
    sfml-library.files = $${PWD}/library/sfml/$${CONFIG_PLATFORM_PATH}/bin/
    INSTALLS += sfml-library

    # method 2+1
    #QMAKE_BUNDLE_DATA += sfml-library

    # method 3
    #EXTRA_BINFILES += \
    # $${PWD}/library/sfml/$${CONFIG_PLATFORM_PATH}/bin/sfml-system-2.dll
    #EXTRA_BINFILES_WIN = $${EXTRA_BINFILES}
    #EXTRA_BINFILES_WIN ~= s,/,\\,g
    # DESTDIR_WIN = $${DESTDIR}
    #DESTDIR_WIN ~= s,/,\\,g
    #for(FILE,EXTRA_BINFILES_WIN){
    # QMAKE_POST_LINK +=$$quote(cmd /c copy /y $${FILE} $${DESTDIR_WIN}$$escape_expand(\n\t))
    #}

    # method 4
    #QMAKE_POST_LINK += copy /Y $${PWD}/library/sfml/$${CONFIG_PLATFORM_PATH}/bin/sfml-system-2.dll $${PWD}/debug
    $${DESTDIR} is empty in all platforms and with or without shadown build.

    There is a variable that represent output dir to .EXE file that works in all platforms?

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: QMake doesnt do simple things in Windows

    DESTDIR is yours to set. If you do not set it then you get the current working directory. You can get the same result with:
    Qt Code:
    1. DESTDIR = .
    To copy to clipboard, switch view to plain text mode 
    if you absolutely have to have a value for DESTDIR.

Similar Threads

  1. Qt Mobility Multimedia Modul on Windows 7 doesnt work
    By Darian in forum Installation and Deployment
    Replies: 2
    Last Post: 30th January 2012, 21:39
  2. qmake x64 for windows
    By ashishbme in forum General Discussion
    Replies: 2
    Last Post: 8th April 2011, 13:10
  3. qmake x64 for windows
    By ashishbme in forum Best Practices in Qt Programming
    Replies: 0
    Last Post: 8th April 2011, 12:07
  4. QWT doesnt show any windows
    By Cal in forum Qwt
    Replies: 5
    Last Post: 30th June 2009, 17:05
  5. surprise why this simple statement doesnt work
    By salmanmanekia in forum Qt Programming
    Replies: 6
    Last Post: 28th July 2008, 12:42

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.