~ubuntu-branches/ubuntu/lucid/cmake/lucid

« back to all changes in this revision

Viewing changes to Modules/Platform/Windows-bcc32.cmake

  • Committer: Bazaar Package Importer
  • Author(s): Artur Rona
  • Date: 2009-12-16 11:11:54 UTC
  • mfrom: (3.1.9 sid)
  • Revision ID: james.westby@ubuntu.com-20091216111154-6accvv6yq86h2hkc
Tags: 2.8.0-5ubuntu1
* Merge from debian testing (LP: #497349). Remaining changes:
  - Keep the Replaces: on cmake-data to cover the Kubuntu version from
    Jaunty in case someone decides to do an (unsupported) Jaunty->Lucid
    upgrade.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Borland shared library issues:
2
 
# When building dll's with borland, the run time dll c/c++ library from
3
 
# borland must be used.   This is specified with the -tWR compiler option.
4
 
# This flag must be present during compilation of c and c++ files and
5
 
# for the linking of exe and dll files.   But wait, there is more,
6
 
# the -tWR flag must come after the  -tWD and -tWM flags, but before the -tWC flag.
7
 
# Order counts, so be careful!
8
 
# if building static, you don't want the -tWR flag as it will make your program
9
 
# depend on the borland run time dll.
10
 
# So, if a project has CMAKE_BUILD_SHARED on, then the -tWR flag is added all over, and
11
 
# it is left out if not.
12
 
 
13
 
SET(CMAKE_LIBRARY_PATH_FLAG "-L")
14
 
SET(CMAKE_LINK_LIBRARY_FLAG "")
15
 
SET(CMAKE_SHARED_BUILD_CXX_FLAGS "-tWR")
16
 
SET(CMAKE_SHARED_BUILD_C_FLAGS "-tWR")
17
 
SET(BORLAND 1)
18
 
 
19
 
SET(CMAKE_FIND_LIBRARY_SUFFIXES "-bcc.lib" ".lib")
20
 
 
21
 
# uncomment these out to debug makefiles
22
 
#SET(CMAKE_START_TEMP_FILE "")
23
 
#SET(CMAKE_END_TEMP_FILE "")
24
 
#SET(CMAKE_VERBOSE_MAKEFILE 1)
25
 
 
26
 
# Borland cannot handle + in the file name, so mangle object file name
27
 
SET (CMAKE_MANGLE_OBJECT_FILE_NAMES "ON")
28
 
 
29
 
# Create an import library for another target.
30
 
SET(CMAKE_CXX_CREATE_IMPORT_LIBRARY
31
 
  "implib -c -w <TARGET_IMPLIB> <TARGET>"
32
 
  )
33
 
 
34
 
# Create a C++ module library.
35
 
SET(CMAKE_CXX_CREATE_SHARED_MODULE
36
 
 "<CMAKE_CXX_COMPILER>  ${CMAKE_START_TEMP_FILE}-e<TARGET>  -tWD  <LINK_FLAGS> -tWR <LINK_LIBRARIES> <OBJECTS>${CMAKE_END_TEMP_FILE}"
37
 
)
38
 
 
39
 
# Create a C++ shared library.
40
 
# First create a module and then its import library.
41
 
SET(CMAKE_CXX_CREATE_SHARED_LIBRARY
42
 
  ${CMAKE_CXX_CREATE_SHARED_MODULE}
43
 
  ${CMAKE_CXX_CREATE_IMPORT_LIBRARY})
44
 
 
45
 
# Create an import library for another target.
46
 
SET(CMAKE_C_CREATE_IMPORT_LIBRARY ${CMAKE_CXX_CREATE_IMPORT_LIBRARY})
47
 
 
48
 
# Create a C module library.
49
 
SET(CMAKE_C_CREATE_SHARED_MODULE
50
 
 "<CMAKE_C_COMPILER> ${CMAKE_START_TEMP_FILE}-e<TARGET> -tWD  <LINK_FLAGS> -tWR <LINK_LIBRARIES> <OBJECTS>${CMAKE_END_TEMP_FILE}"
51
 
)
52
 
 
53
 
# Create a C shared library.
54
 
# First create a module and then its import library.
55
 
SET(CMAKE_C_CREATE_SHARED_LIBRARY
56
 
  ${CMAKE_C_CREATE_SHARED_MODULE}
57
 
  ${CMAKE_C_CREATE_IMPORT_LIBRARY})
58
 
 
59
 
# create a C++ static library
60
 
SET(CMAKE_CXX_CREATE_STATIC_LIBRARY  "tlib ${CMAKE_START_TEMP_FILE}/p512 <LINK_FLAGS> /a <TARGET> <OBJECTS>${CMAKE_END_TEMP_FILE}")
61
 
 
62
 
# create a C static library
63
 
SET(CMAKE_C_CREATE_STATIC_LIBRARY ${CMAKE_CXX_CREATE_STATIC_LIBRARY})
64
 
 
65
 
# compile a C++ file into an object file
66
 
# place <DEFINES> outside the response file because Borland refuses
67
 
# to parse quotes from the response file.
68
 
SET(CMAKE_CXX_COMPILE_OBJECT
69
 
    "<CMAKE_CXX_COMPILER> <DEFINES> ${CMAKE_START_TEMP_FILE}-DWIN32 -P <FLAGS> -o<OBJECT> -c <SOURCE>${CMAKE_END_TEMP_FILE}")
70
 
 
71
 
# compile a C file into an object file
72
 
# place <DEFINES> outside the response file because Borland refuses
73
 
# to parse quotes from the response file.
74
 
SET(CMAKE_C_COMPILE_OBJECT
75
 
    "<CMAKE_C_COMPILER> <DEFINES> ${CMAKE_START_TEMP_FILE}-DWIN32 -o<OBJECT> <FLAGS> -c <SOURCE>${CMAKE_END_TEMP_FILE}")
76
 
 
77
 
 
78
 
SET(CMAKE_C_LINK_EXECUTABLE
79
 
  "<CMAKE_C_COMPILER> ${CMAKE_START_TEMP_FILE}-e<TARGET> <LINK_FLAGS> <FLAGS> <LINK_LIBRARIES> <OBJECTS> ${CMAKE_END_TEMP_FILE}"
80
 
#  "implib -c -w <TARGET_IMPLIB> <TARGET>"
81
 
  )
82
 
 
83
 
 
84
 
SET(CMAKE_CXX_LINK_EXECUTABLE
85
 
  "<CMAKE_CXX_COMPILER> ${CMAKE_START_TEMP_FILE} <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> -e<TARGET> <FLAGS> <LINK_LIBRARIES> <OBJECTS> ${CMAKE_END_TEMP_FILE}"
86
 
#  "implib -c -w <TARGET_IMPLIB> <TARGET>"
87
 
  )
88
 
 
89
 
SET (CMAKE_BUILD_TYPE Debug CACHE STRING 
90
 
     "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel.")
91
 
 
92
 
# extra flags for a win32 exe
93
 
SET(CMAKE_CREATE_WIN32_EXE "-tW -tWM" )
94
 
# extra flags for a console app
95
 
SET(CMAKE_CREATE_CONSOLE_EXE "-tWC" )
96
 
 
97
 
SET (CMAKE_CXX_FLAGS_INIT "-tWM")
98
 
SET (CMAKE_CXX_FLAGS_DEBUG_INIT "-Od -v")
99
 
SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-O1 -DNDEBUG")
100
 
SET (CMAKE_CXX_FLAGS_RELEASE_INIT "-O2 -DNDEBUG")
101
 
SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-Od")
102
 
SET (CMAKE_C_FLAGS_INIT "-tWM")
103
 
SET (CMAKE_C_FLAGS_DEBUG_INIT "-Od -v")
104
 
SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "-O1 -DNDEBUG")
105
 
SET (CMAKE_C_FLAGS_RELEASE_INIT "-O2 -DNDEBUG")
106
 
SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-Od")
107
 
 
108
 
SET (CMAKE_EXE_LINKER_FLAGS_INIT "-tWM -lS:10000000 -lSc:10000000 ")
109
 
SET (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "-v")
110
 
SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "-v")
111
 
SET (CMAKE_SHARED_LINKER_FLAGS_INIT ${CMAKE_EXE_LINKER_FLAGS_INIT})
112
 
SET (CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT})
113
 
SET (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT})
114
 
SET (CMAKE_MODULE_LINKER_FLAGS_INIT ${CMAKE_SHARED_LINKER_FLAGS_INIT})
115
 
SET (CMAKE_MODULE_LINKER_FLAGS_DEBUG_INIT ${CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT})
116
 
SET (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT})
117
 
 
118
 
SET (CMAKE_C_STANDARD_LIBRARIES_INIT "import32.lib")
119
 
SET (CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}")
120
 
 
121
 
# preprocess C and CXX files
122
 
# place <DEFINES> outside the response file because Borland refuses
123
 
# to parse quotes from the response file.
124
 
SET (CMAKE_C_CREATE_PREPROCESSED_SOURCE
125
 
    "cpp32 <DEFINES> ${CMAKE_START_TEMP_FILE}-DWIN32 <FLAGS> -o<PREPROCESSED_SOURCE> -c <SOURCE>${CMAKE_END_TEMP_FILE}")
126
 
SET (CMAKE_CXX_CREATE_PREPROCESSED_SOURCE
127
 
    "cpp32 <DEFINES> ${CMAKE_START_TEMP_FILE}-DWIN32 <FLAGS> -o<PREPROCESSED_SOURCE> -P -c <SOURCE>${CMAKE_END_TEMP_FILE}")
128
 
# Borland >= 5.6 allows -P option for cpp32, <= 5.5 does not