Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10267


Ignore:
Timestamp:
Feb 12, 2015, 6:05:25 PM (5 years ago)
Author:
muemart
Message:

Add program icon for Windows builds (MSVC only for now)

Location:
code/trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/cmake/tools/SourceFileUtilities.cmake

    r8729 r10267  
    8181      STRING(REPLACE "/" "\\\\" _group_path "${_relative_path}")
    8282      SOURCE_GROUP("Source\\${_group_path}" FILES ${_file})
     83    ELSEIF(_relative_path MATCHES ".*\\.rc") #Resource files
     84      SOURCE_GROUP("Resource Files" FILES ${_file})
    8385    ELSE()
    8486      # File is being generated in the binary directory
  • code/trunk/cmake/tools/TargetUtilities.cmake

    r10252 r10267  
    287287  # Don't compile header files
    288288  FOREACH(_file ${_${_target_name}_files})
    289     IF(NOT _file MATCHES "\\.(c|cc|cpp|cxx|mm)$")
     289    IF(NOT _file MATCHES "\\.(c|cc|cpp|cxx|mm|rc)$")
    290290      SET_SOURCE_FILES_PROPERTIES(${_file} PROPERTIES HEADER_FILE_ONLY TRUE)
    291291    ENDIF()
  • code/trunk/src/CMakeLists.txt

    r10186 r10267  
    5858IF(APPLE)
    5959  LIST(APPEND ORXONOX_MAIN_FILES OrxonoxMac.mm)
     60# Add the icon for win32 builds
     61# TODO: does this work for mingw too?
     62ELSEIF(WIN32 AND MSVC)
     63  LIST(APPEND ORXONOX_MAIN_FILES ${CMAKE_SOURCE_DIR}/contrib/winresource.rc)
    6064ENDIF()
    6165
  • code/trunk/src/libraries/core/CMakeLists.txt

    r9667 r10267  
    6868ADD_SUBDIRECTORY(object)
    6969
     70#Add the icon (for the renderwindow)
     71IF(WIN32 AND MSVC)
     72  List(APPEND CORE_SRC_FILES ${CMAKE_SOURCE_DIR}/contrib/winresource.rc)
     73ENDIF()
     74
    7075ORXONOX_ADD_LIBRARY(core
    7176  FIND_HEADER_FILES
  • code/trunk/src/libraries/core/GraphicsManager.cc

    r9675 r10267  
    316316
    317317        Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(Ogre::MIP_UNLIMITED);
     318
     319        //Add program icon
     320#if defined(ORXONOX_PLATFORM_WINDOWS) && defined(_MSC_VER)
     321        HWND hwnd;
     322        this->renderWindow_->getCustomAttribute("WINDOW", (void*)&hwnd);
     323        LONG iconID = (LONG)LoadIcon(GetModuleHandle(0), MAKEINTRESOURCE(101));
     324        SetClassLong(hwnd, GCL_HICON, iconID);
     325#endif
     326
    318327
    319328        // add console commands
Note: See TracChangeset for help on using the changeset viewer.