author | koda |
Thu, 21 Mar 2013 14:38:58 +0100 | |
branch | cmake_pascal |
changeset 8823 | 65b430b6cd68 |
parent 8821 | e85ff6e298b5 |
child 8829 | 6940e86a7df6 |
permissions | -rw-r--r-- |
8750
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
1 |
# This file sets the basic flags for the Pascal language in CMake. |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
2 |
# It also loads the available platform file for the system-compiler |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
3 |
# if it exists. |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
4 |
|
8815 | 5 |
get_filename_component(CMAKE_BASE_NAME ${CMAKE_Pascal_COMPILER} NAME_WE) |
6 |
set(CMAKE_SYSTEM_AND_Pascal_COMPILER_INFO_FILE |
|
7 |
${CMAKE_ROOT}/Modules/Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}.cmake) |
|
8 |
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL) |
|
8750
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
9 |
|
8821
e85ff6e298b5
adjust verbosity, move debug/release variables in the right section
koda
parents:
8815
diff
changeset
|
10 |
# This section should actually be in Platform/${CMAKE_SYSTME_NAME}-fpc.cmake |
e85ff6e298b5
adjust verbosity, move debug/release variables in the right section
koda
parents:
8815
diff
changeset
|
11 |
set(CMAKE_Pascal_FLAGS_INIT "-l- -v0ewn") |
e85ff6e298b5
adjust verbosity, move debug/release variables in the right section
koda
parents:
8815
diff
changeset
|
12 |
set(CMAKE_Pascal_FLAGS_DEBUG_INIT "-g -gl -gp -gh") |
e85ff6e298b5
adjust verbosity, move debug/release variables in the right section
koda
parents:
8815
diff
changeset
|
13 |
set(CMAKE_Pascal_FLAGS_MINSIZEREL_INIT "-Os -dNDEBUG") |
e85ff6e298b5
adjust verbosity, move debug/release variables in the right section
koda
parents:
8815
diff
changeset
|
14 |
set(CMAKE_Pascal_FLAGS_RELEASE_INIT "-O3 -dNDEBUG") |
e85ff6e298b5
adjust verbosity, move debug/release variables in the right section
koda
parents:
8815
diff
changeset
|
15 |
set(CMAKE_Pascal_FLAGS_RELWITHDEBINFO_INIT "-O2 -g -gl -gp") |
e85ff6e298b5
adjust verbosity, move debug/release variables in the right section
koda
parents:
8815
diff
changeset
|
16 |
|
8750
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
17 |
# This should be included before the _INIT variables are |
8821
e85ff6e298b5
adjust verbosity, move debug/release variables in the right section
koda
parents:
8815
diff
changeset
|
18 |
# used to initialize the cache. Since the rule variables |
8750
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
19 |
# have if blocks on them, users can still define them here. |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
20 |
# But, it should still be after the platform file so changes can |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
21 |
# be made to those values. |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
22 |
|
8815 | 23 |
if(CMAKE_USER_MAKE_RULES_OVERRIDE) |
24 |
include(${CMAKE_USER_MAKE_RULES_OVERRIDE}) |
|
25 |
endif(CMAKE_USER_MAKE_RULES_OVERRIDE) |
|
8750
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
26 |
|
8815 | 27 |
if(CMAKE_USER_MAKE_RULES_OVERRIDE_Pascal) |
28 |
include(${CMAKE_USER_MAKE_RULES_OVERRIDE_Pascal}) |
|
29 |
endif(CMAKE_USER_MAKE_RULES_OVERRIDE_Pascal) |
|
8750
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
30 |
|
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
31 |
# Create a set of shared library variable specific to Pascal |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
32 |
# For 90% of the systems, these are the same flags as the C versions |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
33 |
# so if these are not set just copy the flags from the c version |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
34 |
#IF(NOT CMAKE_SHARED_LIBRARY_CREATE_Ada_FLAGS) |
8770
53481d654691
partial conversion of pascal_flags to CMAKE_Pascal_FLAGS
koda
parents:
8758
diff
changeset
|
35 |
#-dynamiclib -Wl,-headerpad_max_install_names for C |
8750
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
36 |
# SET(CMAKE_SHARED_LIBRARY_CREATE_Ada_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}) |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
37 |
#ENDIF(NOT CMAKE_SHARED_LIBRARY_CREATE_Ada_FLAGS) |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
38 |
|
8815 | 39 |
if(NOT CMAKE_SHARED_LIBRARY_Pascal_FLAGS) |
40 |
#another similarity, fpc: -fPIC Same as -Cg |
|
41 |
#(maybe required only for x86_64) |
|
42 |
set(CMAKE_SHARED_LIBRARY_Pascal_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS}) |
|
43 |
endif(NOT CMAKE_SHARED_LIBRARY_Pascal_FLAGS) |
|
8750
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
44 |
|
8815 | 45 |
if(NOT CMAKE_SHARED_LIBRARY_LINK_Pascal_FLAGS) |
46 |
set(CMAKE_SHARED_LIBRARY_LINK_Pascal_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS}) |
|
47 |
endif(NOT CMAKE_SHARED_LIBRARY_LINK_Pascal_FLAGS) |
|
8750
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
48 |
|
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
49 |
#IF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_Ada_FLAG) |
8752
48cf2ccb83c6
with lot of hackery, use add_executable on pascal files, SUCCSS
koda
parents:
8750
diff
changeset
|
50 |
# SET(CMAKE_SHARED_LIBRARY_RUNTIME_Ada_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG}) |
8750
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
51 |
#ENDIF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_Ada_FLAG) |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
52 |
|
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
53 |
#IF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_Ada_FLAG_SEP) |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
54 |
# SET(CMAKE_SHARED_LIBRARY_RUNTIME_Ada_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP}) |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
55 |
#ENDIF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_Ada_FLAG_SEP) |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
56 |
|
8770
53481d654691
partial conversion of pascal_flags to CMAKE_Pascal_FLAGS
koda
parents:
8758
diff
changeset
|
57 |
if(NOT CMAKE_SHARED_LIBRARY_RPATH_LINK_Pascal_FLAG) |
8815 | 58 |
set(CMAKE_SHARED_LIBRARY_RPATH_LINK_Pascal_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG}) |
8770
53481d654691
partial conversion of pascal_flags to CMAKE_Pascal_FLAGS
koda
parents:
8758
diff
changeset
|
59 |
endif(NOT CMAKE_SHARED_LIBRARY_RPATH_LINK_Pascal_FLAG) |
53481d654691
partial conversion of pascal_flags to CMAKE_Pascal_FLAGS
koda
parents:
8758
diff
changeset
|
60 |
|
53481d654691
partial conversion of pascal_flags to CMAKE_Pascal_FLAGS
koda
parents:
8758
diff
changeset
|
61 |
# for most systems a module is the same as a shared library |
53481d654691
partial conversion of pascal_flags to CMAKE_Pascal_FLAGS
koda
parents:
8758
diff
changeset
|
62 |
# so unless the variable CMAKE_MODULE_EXISTS is set just |
53481d654691
partial conversion of pascal_flags to CMAKE_Pascal_FLAGS
koda
parents:
8758
diff
changeset
|
63 |
# copy the values from the LIBRARY variables |
53481d654691
partial conversion of pascal_flags to CMAKE_Pascal_FLAGS
koda
parents:
8758
diff
changeset
|
64 |
if(NOT CMAKE_MODULE_EXISTS) |
8815 | 65 |
set(CMAKE_SHARED_MODULE_Pascal_FLAGS ${CMAKE_SHARED_LIBRARY_Pascal_FLAGS}) |
66 |
set(CMAKE_SHARED_MODULE_CREATE_Pascal_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_Pascal_FLAGS}) |
|
67 |
endif(NOT CMAKE_MODULE_EXISTS) |
|
8770
53481d654691
partial conversion of pascal_flags to CMAKE_Pascal_FLAGS
koda
parents:
8758
diff
changeset
|
68 |
|
8750
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
69 |
# repeat for modules |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
70 |
#IF(NOT CMAKE_SHARED_MODULE_CREATE_Ada_FLAGS) |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
71 |
# SET(CMAKE_SHARED_MODULE_CREATE_Ada_FLAGS ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS}) |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
72 |
#ENDIF(NOT CMAKE_SHARED_MODULE_CREATE_Ada_FLAGS) |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
73 |
|
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
74 |
#IF(NOT CMAKE_SHARED_MODULE_Ada_FLAGS) |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
75 |
# SET(CMAKE_SHARED_MODULE_Ada_FLAGS ${CMAKE_SHARED_MODULE_C_FLAGS}) |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
76 |
#ENDIF(NOT CMAKE_SHARED_MODULE_Ada_FLAGS) |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
77 |
|
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
78 |
#IF(NOT CMAKE_SHARED_MODULE_RUNTIME_Ada_FLAG) |
8752
48cf2ccb83c6
with lot of hackery, use add_executable on pascal files, SUCCSS
koda
parents:
8750
diff
changeset
|
79 |
# SET(CMAKE_SHARED_MODULE_RUNTIME_Ada_FLAG ${CMAKE_SHARED_MODULE_RUNTIME_C_FLAG}) |
8750
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
80 |
#ENDIF(NOT CMAKE_SHARED_MODULE_RUNTIME_Ada_FLAG) |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
81 |
|
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
82 |
#IF(NOT CMAKE_SHARED_MODULE_RUNTIME_Ada_FLAG_SEP) |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
83 |
# SET(CMAKE_SHARED_MODULE_RUNTIME_Ada_FLAG_SEP ${CMAKE_SHARED_MODULE_RUNTIME_C_FLAG_SEP}) |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
84 |
#ENDIF(NOT CMAKE_SHARED_MODULE_RUNTIME_Ada_FLAG_SEP) |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
85 |
|
8815 | 86 |
if(NOT CMAKE_INCLUDE_FLAG_Pascal) |
87 |
#amazing, fpc: -I<x> Add <x> to include path |
|
88 |
set(CMAKE_INCLUDE_FLAG_Pascal ${CMAKE_INCLUDE_FLAG_C}) |
|
89 |
endif(NOT CMAKE_INCLUDE_FLAG_Pascal) |
|
8750
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
90 |
|
8815 | 91 |
if(NOT CMAKE_INCLUDE_FLAG_SEP_Pascal) |
92 |
set(CMAKE_INCLUDE_FLAG_SEP_Pascal ${CMAKE_INCLUDE_FLAG_SEP_C}) |
|
93 |
endif(NOT CMAKE_INCLUDE_FLAG_SEP_Pascal) |
|
8750
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
94 |
|
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
95 |
# Copy C version of this flag which is normally determined in platform file. |
8815 | 96 |
if(NOT CMAKE_SHARED_LIBRARY_SONAME_Pascal_FLAG) |
97 |
set(CMAKE_SHARED_LIBRARY_SONAME_Pascal_FLAG ${CMAKE_SHARED_LIBRARY_SONAME_C_FLAG}) |
|
98 |
endif(NOT CMAKE_SHARED_LIBRARY_SONAME_Pascal_FLAG) |
|
8750
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
99 |
|
8815 | 100 |
set(CMAKE_VERBOSE_MAKEFILE FALSE CACHE BOOL "If this value is on, makefiles will be generated without the .SILENT directive, and all commands will be echoed to the console during the make. This is useful for debugging only. With Visual Studio IDE projects all commands are done without /nologo.") |
8750
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
101 |
|
8815 | 102 |
set(CMAKE_Pascal_FLAGS "$ENV{FPFLAGS} ${CMAKE_Pascal_FLAGS_INIT}" CACHE STRING "Flags for Pascal compiler.") |
8750
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
103 |
|
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
104 |
INCLUDE(CMakeCommonLanguageInclude) |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
105 |
|
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
106 |
# now define the following rule variables |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
107 |
|
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
108 |
# CMAKE_Ada_CREATE_SHARED_LIBRARY |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
109 |
# CMAKE_Ada_CREATE_SHARED_MODULE |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
110 |
# CMAKE_Ada_CREATE_STATIC_LIBRARY |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
111 |
# CMAKE_Ada_COMPILE_OBJECT |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
112 |
# CMAKE_Ada_LINK_EXECUTABLE |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
113 |
|
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
114 |
# variables supplied by the generator at use time |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
115 |
# <TARGET> |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
116 |
# <TARGET_BASE> the target without the suffix |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
117 |
# <OBJECTS> |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
118 |
# <OBJECT> |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
119 |
# <LINK_LIBRARIES> |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
120 |
# <FLAGS> |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
121 |
# <LINK_FLAGS> |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
122 |
|
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
123 |
# Ada compiler information |
8752
48cf2ccb83c6
with lot of hackery, use add_executable on pascal files, SUCCSS
koda
parents:
8750
diff
changeset
|
124 |
# <CMAKE_Ada_COMPILER> |
8750
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
125 |
# <CMAKE_SHARED_LIBRARY_CREATE_Ada_FLAGS> |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
126 |
# <CMAKE_SHARED_MODULE_CREATE_Ada_FLAGS> |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
127 |
# <CMAKE_Ada_LINK_FLAGS> |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
128 |
|
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
129 |
# Static library tools |
8752
48cf2ccb83c6
with lot of hackery, use add_executable on pascal files, SUCCSS
koda
parents:
8750
diff
changeset
|
130 |
# <CMAKE_AR> |
8750
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
131 |
# <CMAKE_RANLIB> |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
132 |
|
8815 | 133 |
if(NOT EXECUTABLE_OUTPUT_PATH) |
8756 | 134 |
set (EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}) |
8815 | 135 |
endif(NOT EXECUTABLE_OUTPUT_PATH) |
8750
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
136 |
|
8823 | 137 |
# create a Pascal shared library |
138 |
if(NOT CMAKE_Pascal_CREATE_SHARED_LIBRARY) |
|
139 |
if(WIN32) |
|
140 |
set(CMAKE_Pascal_CREATE_SHARED_LIBRARY "${EXECUTABLE_OUTPUT_PATH}/ppas.bat") |
|
141 |
else(WIN32) |
|
142 |
set(CMAKE_Pascal_CREATE_SHARED_LIBRARY "${EXECUTABLE_OUTPUT_PATH}/ppas.sh") |
|
143 |
endif(WIN32) |
|
144 |
# other expandable variables here are <CMAKE_Pascal_COMPILER> <CMAKE_SHARED_LIBRARY_Pascal_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_Pascal_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_Pascal_FLAG> <TARGET_SONAME> <TARGET> <OBJECTS> <LINK_LIBRARIES> |
|
145 |
endif(NOT CMAKE_Pascal_CREATE_SHARED_LIBRARY) |
|
8750
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
146 |
|
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
147 |
# create an Ada shared module just copy the shared library rule |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
148 |
IF(NOT CMAKE_Ada_CREATE_SHARED_MODULE) |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
149 |
SET(CMAKE_Ada_CREATE_SHARED_MODULE ${CMAKE_Ada_CREATE_SHARED_LIBRARY}) |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
150 |
ENDIF(NOT CMAKE_Ada_CREATE_SHARED_MODULE) |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
151 |
|
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
152 |
# create an Ada static library |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
153 |
IF(NOT CMAKE_Ada_CREATE_STATIC_LIBRARY) |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
154 |
SET(CMAKE_Ada_CREATE_STATIC_LIBRARY |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
155 |
"<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS> " |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
156 |
"<CMAKE_RANLIB> <TARGET> ") |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
157 |
ENDIF(NOT CMAKE_Ada_CREATE_STATIC_LIBRARY) |
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
158 |
|
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
159 |
# compile a Pascal file into an object file |
8815 | 160 |
if(NOT CMAKE_Pascal_COMPILE_OBJECT) |
161 |
if(UNIX) |
|
162 |
#when you have multiple ld installation make sure you get the one bundled with the system C compiler |
|
163 |
include(Platform/${CMAKE_SYSTEM_NAME}-GNU-C.cmake OPTIONAL) |
|
164 |
if(CMAKE_C_COMPILER) |
|
165 |
get_filename_component(CMAKE_C_COMPILER_DIR ${CMAKE_C_COMPILER} PATH) |
|
166 |
set(CMAKE_Pascal_UNIX_FLAGS "-FD${CMAKE_C_COMPILER_DIR}") |
|
167 |
endif(CMAKE_C_COMPILER) |
|
168 |
if(APPLE) |
|
169 |
#add user framework directory |
|
170 |
set(CMAKE_Pascal_UNIX_FLAGS "-Ff~/Library/Frameworks ${CMAKE_Pascal_UNIX_FLAGS}") |
|
171 |
#when sysroot is set, make sure that fpc picks it |
|
172 |
if(CMAKE_OSX_SYSROOT) |
|
173 |
set(CMAKE_Pascal_UNIX_FLAGS "-XD${CMAKE_OSX_SYSROOT} ${CMAKE_Pascal_UNIX_FLAGS}") |
|
174 |
endif(CMAKE_OSX_SYSROOT) |
|
175 |
endif(APPLE) |
|
176 |
endif(UNIX) |
|
177 |
||
178 |
set(CMAKE_Pascal_COMPILE_OBJECT |
|
179 |
"<CMAKE_Pascal_COMPILER> -Cn -FE${EXECUTABLE_OUTPUT_PATH} -FU${CMAKE_CURRENT_BINARY_DIR}/<OBJECT_DIR> -Fi${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_Pascal_UNIX_FLAGS} <FLAGS> <SOURCE>") |
|
180 |
endif(NOT CMAKE_Pascal_COMPILE_OBJECT) |
|
8750
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
181 |
|
8778 | 182 |
# link Pascal objects in a single executable |
8815 | 183 |
if(NOT CMAKE_Pascal_LINK_EXECUTABLE) |
184 |
if(WIN32) |
|
185 |
set(CMAKE_Pascal_LINK_EXECUTABLE "${EXECUTABLE_OUTPUT_PATH}/ppas.bat") |
|
186 |
else(WIN32) |
|
187 |
set(CMAKE_Pascal_LINK_EXECUTABLE "${EXECUTABLE_OUTPUT_PATH}/ppas.sh") |
|
188 |
endif(WIN32) |
|
8823 | 189 |
# other expandable variables here are <CMAKE_Pascal_LINK_FLAGS> <LINK_FLAGS> <TARGET_BASE> <FLAGS> <LINK_LIBRARIES> |
8815 | 190 |
endif(NOT CMAKE_Pascal_LINK_EXECUTABLE) |
8750
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
191 |
|
8815 | 192 |
if(CMAKE_Pascal_STANDARD_LIBRARIES_INIT) |
193 |
set(CMAKE_Pascal_STANDARD_LIBRARIES "${CMAKE_Pascal_STANDARD_LIBRARIES_INIT}" |
|
194 |
CACHE STRING "Libraries linked by default (usually handled internally).") |
|
195 |
MARK_AS_ADVANCED(CMAKE_Pascal_STANDARD_LIBRARIES) |
|
196 |
endif(CMAKE_Pascal_STANDARD_LIBRARIES_INIT) |
|
8750
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
197 |
|
8815 | 198 |
if(NOT CMAKE_NOT_USING_CONFIG_FLAGS) |
8821
e85ff6e298b5
adjust verbosity, move debug/release variables in the right section
koda
parents:
8815
diff
changeset
|
199 |
SET (CMAKE_Pascal_FLAGS_DEBUG "${CMAKE_Pascal_FLAGS_DEBUG_INIT}" CACHE STRING |
8750
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
200 |
"Flags used by the compiler during debug builds.") |
8821
e85ff6e298b5
adjust verbosity, move debug/release variables in the right section
koda
parents:
8815
diff
changeset
|
201 |
SET (CMAKE_Pascal_FLAGS_MINSIZEREL "${CMAKE_Pascal_FLAGS_MINSIZEREL_INIT}" CACHE STRING |
8750
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
202 |
"Flags used by the compiler during release minsize builds.") |
8821
e85ff6e298b5
adjust verbosity, move debug/release variables in the right section
koda
parents:
8815
diff
changeset
|
203 |
SET (CMAKE_Pascal_FLAGS_RELEASE "${CMAKE_Pascal_FLAGS_RELEASE_INIT}" CACHE STRING |
8750
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
204 |
"Flags used by the compiler during release builds (/MD /Ob1 /Oi /Ot /Oy /Gs will produce slightly less optimized but smaller files).") |
8821
e85ff6e298b5
adjust verbosity, move debug/release variables in the right section
koda
parents:
8815
diff
changeset
|
205 |
SET (CMAKE_Pascal_FLAGS_RELWITHDEBINFO "${CMAKE_Pascal_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING |
8750
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
206 |
"Flags used by the compiler during Release with Debug Info builds.") |
8815 | 207 |
endif(NOT CMAKE_NOT_USING_CONFIG_FLAGS) |
8750
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
208 |
|
8815 | 209 |
mark_as_advanced(CMAKE_Pascal_FLAGS CMAKE_Pascal_FLAGS_DEBUG CMAKE_Pascal_FLAGS_MINSIZEREL |
210 |
CMAKE_Pascal_FLAGS_RELEASE CMAKE_Pascal_FLAGS_RELWITHDEBINFO) |
|
211 |
set(CMAKE_Pascal_INFORMATION_LOADED 1) |
|
8750
d9e57426e759
barebone cmake config file to support pascal files, based off plplot's ada files
koda
parents:
diff
changeset
|
212 |