CMakeRCInformation.cmake 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. # file Copyright.txt or https://cmake.org/licensing for details.
  3. # This file sets the basic flags for the Windows Resource Compiler.
  4. # It also loads the available platform file for the system-compiler
  5. # if it exists.
  6. # make sure we don't use CMAKE_BASE_NAME from somewhere else
  7. set(CMAKE_BASE_NAME)
  8. if(CMAKE_RC_COMPILER MATCHES "windres[^/]*$")
  9. set(CMAKE_BASE_NAME "windres")
  10. else()
  11. get_filename_component(CMAKE_BASE_NAME ${CMAKE_RC_COMPILER} NAME_WE)
  12. endif()
  13. set(CMAKE_SYSTEM_AND_RC_COMPILER_INFO_FILE
  14. ${CMAKE_ROOT}/Modules/Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}.cmake)
  15. include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL)
  16. set(CMAKE_RC_FLAGS_INIT "$ENV{RCFLAGS} ${CMAKE_RC_FLAGS_INIT}")
  17. cmake_initialize_per_config_variable(CMAKE_RC_FLAGS "Flags for Windows Resource Compiler")
  18. # These are the only types of flags that should be passed to the rc
  19. # command, if COMPILE_FLAGS is used on a target this will be used
  20. # to filter out any other flags
  21. set(CMAKE_RC_FLAG_REGEX "^[-/](D|I)")
  22. # now define the following rule variables
  23. # CMAKE_RC_COMPILE_OBJECT
  24. set(CMAKE_INCLUDE_FLAG_RC "-I")
  25. # compile a Resource file into an object file
  26. if(NOT CMAKE_RC_COMPILE_OBJECT)
  27. set(CMAKE_RC_COMPILE_OBJECT
  28. "<CMAKE_RC_COMPILER> <DEFINES> <INCLUDES> <FLAGS> /fo<OBJECT> <SOURCE>")
  29. endif()
  30. # set this variable so we can avoid loading this more than once.
  31. set(CMAKE_RC_INFORMATION_LOADED 1)