CMakeRCInformation.cmake 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #=============================================================================
  2. # Copyright 2004-2009 Kitware, Inc.
  3. #
  4. # Distributed under the OSI-approved BSD License (the "License");
  5. # see accompanying file Copyright.txt for details.
  6. #
  7. # This software is distributed WITHOUT ANY WARRANTY; without even the
  8. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  9. # See the License for more information.
  10. #=============================================================================
  11. # (To distribute this file outside of CMake, substitute the full
  12. # License text for the above reference.)
  13. # This file sets the basic flags for the Windows Resource Compiler.
  14. # It also loads the available platform file for the system-compiler
  15. # if it exists.
  16. # make sure we don't use CMAKE_BASE_NAME from somewhere else
  17. set(CMAKE_BASE_NAME)
  18. if(CMAKE_RC_COMPILER MATCHES "windres[^/]*$")
  19. set(CMAKE_BASE_NAME "windres")
  20. else()
  21. get_filename_component(CMAKE_BASE_NAME ${CMAKE_RC_COMPILER} NAME_WE)
  22. endif()
  23. set(CMAKE_SYSTEM_AND_RC_COMPILER_INFO_FILE
  24. ${CMAKE_ROOT}/Modules/Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}.cmake)
  25. include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL)
  26. set (CMAKE_RC_FLAGS "$ENV{RCFLAGS} ${CMAKE_RC_FLAGS_INIT}" CACHE STRING
  27. "Flags for Windows Resource Compiler.")
  28. # These are the only types of flags that should be passed to the rc
  29. # command, if COMPILE_FLAGS is used on a target this will be used
  30. # to filter out any other flags
  31. set(CMAKE_RC_FLAG_REGEX "^[-/](D|I)")
  32. # now define the following rule variables
  33. # CMAKE_RC_COMPILE_OBJECT
  34. set(CMAKE_INCLUDE_FLAG_RC "-I")
  35. # compile a Resource file into an object file
  36. if(NOT CMAKE_RC_COMPILE_OBJECT)
  37. set(CMAKE_RC_COMPILE_OBJECT
  38. "<CMAKE_RC_COMPILER> <DEFINES> <INCLUDES> <FLAGS> /fo<OBJECT> <SOURCE>")
  39. endif()
  40. mark_as_advanced(
  41. CMAKE_RC_FLAGS
  42. )
  43. # set this variable so we can avoid loading this more than once.
  44. set(CMAKE_RC_INFORMATION_LOADED 1)