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