-
Notifications
You must be signed in to change notification settings - Fork 0
/
fluid.patch
189 lines (177 loc) · 6.43 KB
/
fluid.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
diff --git a/CMake/export.cmake b/CMake/export.cmake
index 81f6e08d1..bf801fda3 100644
--- a/CMake/export.cmake
+++ b/CMake/export.cmake
@@ -21,20 +21,20 @@
# Set the fluid executable path used to create .cxx/.h from .fl files
-if (CMAKE_CROSSCOMPILING)
- # find a fluid executable on the host system
- find_file(FLUID_PATH
- NAMES fluid fluid.exe
- PATHS ENV PATH
- NO_CMAKE_FIND_ROOT_PATH
- )
- set (FLTK_FLUID_EXECUTABLE ${FLUID_PATH})
- set (FLUID) # don't export
-else ()
- # use the fluid executable we build
- set (FLTK_FLUID_EXECUTABLE fluid)
- set (FLUID fluid) # export
-endif (CMAKE_CROSSCOMPILING)
+# if (CMAKE_CROSSCOMPILING)
+# # find a fluid executable on the host system
+# find_file(FLUID_PATH
+# NAMES fluid fluid.exe
+# PATHS ENV PATH
+# NO_CMAKE_FIND_ROOT_PATH
+# )
+# set (FLTK_FLUID_EXECUTABLE ${FLUID_PATH})
+# set (FLUID) # don't export
+# else ()
+# # use the fluid executable we build
+# set (FLTK_FLUID_EXECUTABLE fluid)
+# set (FLUID fluid) # export
+# endif (CMAKE_CROSSCOMPILING)
# generate FLTK-Targets.cmake for build directory use
export(TARGETS ${FLUID} ${FLTK_LIBRARIES} FILE ${CMAKE_CURRENT_BINARY_DIR}/FLTK-Targets.cmake)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 72b9102d7..4aebbc01d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -159,6 +159,8 @@ if (FLTK_BUILD_EXAMPLES)
add_subdirectory (examples)
endif (FLTK_BUILD_EXAMPLES)
+add_subdirectory(fluid)
+
#######################################################################
# Android Studio wrapup
#######################################################################
diff --git a/fluid/CMakeLists.txt b/fluid/CMakeLists.txt
index d45b7b1b7..55796ef77 100644
--- a/fluid/CMakeLists.txt
+++ b/fluid/CMakeLists.txt
@@ -83,27 +83,27 @@ endif (WIN32)
source_group("Header Files" FILES ${HEADERFILES})
-if (APPLE AND (NOT OPTION_APPLE_X11) AND (NOT OPTION_APPLE_SDL))
- set (ICON_NAME fluid.icns)
- set (ICON_PATH "${CMAKE_CURRENT_SOURCE_DIR}/icons/${ICON_NAME}")
- add_executable (fluid MACOSX_BUNDLE ${CPPFILES} ${HEADERFILES} ${ICON_PATH})
-
- # create macOS bundle wrapper script
-
- set (WRAPPER "${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/fluid")
- add_custom_command (
- TARGET fluid POST_BUILD
- COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/../CMake/macOS-bundle-wrapper.in ${WRAPPER}
- COMMAND chmod u+x,g+x,o+x ${WRAPPER}
- BYPRODUCTS ${WRAPPER}
- # COMMENT "Creating macOS bundle wrapper script ${WRAPPER}"
- VERBATIM
- )
- unset (WRAPPER)
-
-else ()
- add_executable (fluid WIN32 ${CPPFILES} ${HEADERFILES})
-endif (APPLE AND (NOT OPTION_APPLE_X11) AND (NOT OPTION_APPLE_SDL))
+# if (APPLE AND (NOT OPTION_APPLE_X11) AND (NOT OPTION_APPLE_SDL))
+# set (ICON_NAME fluid.icns)
+# set (ICON_PATH "${CMAKE_CURRENT_SOURCE_DIR}/icons/${ICON_NAME}")
+# add_executable (fluid MACOSX_BUNDLE ${CPPFILES} ${HEADERFILES} ${ICON_PATH})
+
+# # create macOS bundle wrapper script
+
+# set (WRAPPER "${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/fluid")
+# add_custom_command (
+# TARGET fluid POST_BUILD
+# COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/../CMake/macOS-bundle-wrapper.in ${WRAPPER}
+# COMMAND chmod u+x,g+x,o+x ${WRAPPER}
+# BYPRODUCTS ${WRAPPER}
+# # COMMENT "Creating macOS bundle wrapper script ${WRAPPER}"
+# VERBATIM
+# )
+# unset (WRAPPER)
+
+# else ()
+# add_executable (fluid WIN32 ${CPPFILES} ${HEADERFILES})
+# endif (APPLE AND (NOT OPTION_APPLE_X11) AND (NOT OPTION_APPLE_SDL))
target_link_libraries (fluid fltk fltk_images fltk_forms)
if (FLTK_HAVE_CAIRO)
@@ -116,38 +116,38 @@ endif (USE_GDIPLUS)
# install fluid
-if (APPLE AND (NOT OPTION_APPLE_X11) AND (NOT OPTION_APPLE_SDL))
- # create bundle
- set_target_properties (fluid PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/fluid.plist")
- set_target_properties (fluid PROPERTIES MACOSX_BUNDLE_ICON_FILE ${ICON_NAME})
- set_target_properties (fluid PROPERTIES RESOURCE ${ICON_PATH})
- # install
- install (TARGETS fluid DESTINATION ${FLTK_BINDIR})
-else()
- install (TARGETS fluid
- EXPORT FLTK-Targets
- RUNTIME DESTINATION ${FLTK_BINDIR}
- LIBRARY DESTINATION ${FLTK_LIBDIR}
- ARCHIVE DESTINATION ${FLTK_LIBDIR}
- )
-endif (APPLE AND (NOT OPTION_APPLE_X11) AND (NOT OPTION_APPLE_SDL))
+# if (APPLE AND (NOT OPTION_APPLE_X11) AND (NOT OPTION_APPLE_SDL))
+# # create bundle
+# set_target_properties (fluid PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/fluid.plist")
+# set_target_properties (fluid PROPERTIES MACOSX_BUNDLE_ICON_FILE ${ICON_NAME})
+# set_target_properties (fluid PROPERTIES RESOURCE ${ICON_PATH})
+# # install
+# install (TARGETS fluid DESTINATION ${FLTK_BINDIR})
+# else()
+# install (TARGETS fluid
+# EXPORT FLTK-Targets
+# RUNTIME DESTINATION ${FLTK_BINDIR}
+# LIBRARY DESTINATION ${FLTK_LIBDIR}
+# ARCHIVE DESTINATION ${FLTK_LIBDIR}
+# )
+# endif (APPLE AND (NOT OPTION_APPLE_X11) AND (NOT OPTION_APPLE_SDL))
# install desktop files
-if (UNIX)
- install (FILES fluid.desktop
- DESTINATION ${FLTK_DATADIR}/applications
- )
- # Install mime-type file (x-fluid.desktop method is deprecated)
- install (FILES fluid.xml
- DESTINATION ${FLTK_DATADIR}/mime/packages
- )
-
- # Install desktop icons
- foreach (icon 32 48 64 128)
- install (FILES icons/fluid-${icon}.png
- DESTINATION ${FLTK_DATADIR}/icons/hicolor/${icon}x${icon}/apps
- RENAME fluid.png
- )
- endforeach()
-endif (UNIX)
+# if (UNIX)
+# install (FILES fluid.desktop
+# DESTINATION ${FLTK_DATADIR}/applications
+# )
+# # Install mime-type file (x-fluid.desktop method is deprecated)
+# install (FILES fluid.xml
+# DESTINATION ${FLTK_DATADIR}/mime/packages
+# )
+
+# # Install desktop icons
+# foreach (icon 32 48 64 128)
+# install (FILES icons/fluid-${icon}.png
+# DESTINATION ${FLTK_DATADIR}/icons/hicolor/${icon}x${icon}/apps
+# RENAME fluid.png
+# )
+# endforeach()
+# endif (UNIX)
diff --git a/fluid/fluid.cxx b/fluid/fluid.cxx
index 7fe776fa9..0368e503f 100644
--- a/fluid/fluid.cxx
+++ b/fluid/fluid.cxx
@@ -1769,7 +1769,7 @@ static void sigint(SIGARG) {
in batch mode. Is that intentional? Does it circumvent issues with Windows'
stderr and stdout?
*/
-int main(int argc,char **argv) {
+extern "C" int fluid_main(int argc,char **argv) {
int i = 1;
setlocale(LC_ALL, ""); // enable multilanguage errors in file chooser