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