CMakeRCInformation.cmake 1.8 KB

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