CMakeRCInformation.cmake 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 Fortran language in CMake.
  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. get_filename_component(CMAKE_BASE_NAME ${CMAKE_RC_COMPILER} NAME_WE)
  19. if("${CMAKE_BASE_NAME}" MATCHES "windres")
  20. set(CMAKE_BASE_NAME "windres")
  21. endif()
  22. set(CMAKE_SYSTEM_AND_RC_COMPILER_INFO_FILE
  23. ${CMAKE_ROOT}/Modules/Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}.cmake)
  24. include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL)
  25. set (CMAKE_RC_FLAGS "$ENV{RCFLAGS} ${CMAKE_RC_FLAGS_INIT}" CACHE STRING
  26. "Flags for Fortran compiler.")
  27. # These are the only types of flags that should be passed to the rc
  28. # command, if COMPILE_FLAGS is used on a target this will be used
  29. # to filter out any other flags
  30. set(CMAKE_RC_FLAG_REGEX "^[-/](D|I)")
  31. # now define the following rule variables
  32. # CMAKE_RC_COMPILE_OBJECT
  33. set(CMAKE_INCLUDE_FLAG_RC "-I")
  34. # compile a Resource file into an object file
  35. if(NOT CMAKE_RC_COMPILE_OBJECT)
  36. set(CMAKE_RC_COMPILE_OBJECT
  37. "<CMAKE_RC_COMPILER> <FLAGS> <DEFINES> /fo<OBJECT> <SOURCE>")
  38. endif()
  39. mark_as_advanced(
  40. CMAKE_RC_FLAGS
  41. )
  42. # set this variable so we can avoid loading this more than once.
  43. set(CMAKE_RC_INFORMATION_LOADED 1)