diff options
Diffstat (limited to 'CMake')
| -rw-r--r-- | CMake/Android/AndroidManifest.xml.in | 22 | ||||
| -rw-r--r-- | CMake/Android/CMakeList.txt.in | 60 | ||||
| -rw-r--r-- | CMake/Android/HelloAndroid.cxx.in | 137 | ||||
| -rw-r--r-- | CMake/Android/Roboto-Regular.ttf | bin | 306672 -> 0 bytes | |||
| -rw-r--r-- | CMake/Android/app.build.gradle.in | 26 | ||||
| -rw-r--r-- | CMake/Android/build.gradle.in | 17 | ||||
| -rw-r--r-- | CMake/Android/fl_config.cmake.in | 25 | ||||
| -rwxr-xr-x | CMake/Android/hdpi.ic_launcher.png | bin | 3059 -> 0 bytes | |||
| -rwxr-xr-x | CMake/Android/mdpi.ic_launcher.png | bin | 1715 -> 0 bytes | |||
| -rw-r--r-- | CMake/Android/settings.gradle.in | 1 | ||||
| -rw-r--r-- | CMake/Android/strings.xml.in | 4 | ||||
| -rwxr-xr-x | CMake/Android/xhdpi.ic_launcher.png | bin | 4082 -> 0 bytes | |||
| -rwxr-xr-x | CMake/Android/xxhdpi.ic_launcher.png | bin | 7266 -> 0 bytes | |||
| -rw-r--r-- | CMake/FindSDL2.cmake | 169 | ||||
| -rw-r--r-- | CMake/android.cmake | 141 | ||||
| -rw-r--r-- | CMake/fl_create_example.cmake | 25 | ||||
| -rw-r--r-- | CMake/options.cmake | 15 | ||||
| -rw-r--r-- | CMake/setup.cmake | 3 | ||||
| -rw-r--r-- | CMake/variables.cmake | 2 |
19 files changed, 13 insertions, 634 deletions
diff --git a/CMake/Android/AndroidManifest.xml.in b/CMake/Android/AndroidManifest.xml.in deleted file mode 100644 index 4e5c6154b..000000000 --- a/CMake/Android/AndroidManifest.xml.in +++ /dev/null @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="org.fltk.@ANDROID_APP_NAME@" - android:versionCode="1" - android:versionName="1.0"> - <application - android:allowBackup="false" - android:fullBackupContent="false" - android:icon="@mipmap/ic_launcher" - android:label="@string/app_name" - android:hasCode="false"> - <activity android:name="android.app.NativeActivity" - android:label="@string/app_name"> - <meta-data android:name="android.app.lib_name" - android:value="test_@ANDROID_APP_NAME@" /> - <intent-filter> - <action android:name="android.intent.action.MAIN" /> - <category android:name="android.intent.category.LAUNCHER" /> - </intent-filter> - </activity> - </application> -</manifest> diff --git a/CMake/Android/CMakeList.txt.in b/CMake/Android/CMakeList.txt.in deleted file mode 100644 index 7c7aeb1fa..000000000 --- a/CMake/Android/CMakeList.txt.in +++ /dev/null @@ -1,60 +0,0 @@ -# -# Copyright (C) The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Modified to be a template for Android builds in FLTK -# Copyright 2019 Matthias Melcher and others -# - -cmake_minimum_required(VERSION 3.4.1) - -set(FLTK_DIR "@ANDROID_FLTK_DIR@") -set(FLTK_IDE_DIR "../../../..") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") - - -# FIXME: this includes the entire CMakeLists again, creating an entire library -# build in every target -# TODO: create separate targets for all fltk libraries that can be easily -# linked by all app targets -add_subdirectory("${FLTK_DIR}/" "${CMAKE_CURRENT_BINARY_DIR}/lib" EXCLUDE_FROM_ALL) - -# run Fluid build steps for every .fl file, if any -@ANDROID_FLUID_COMMANDS@ -# now build app's shared lib -add_library( - test_@ANDROID_APP_NAME@ SHARED -@ANDROID_APP_SOURCES@) - -target_include_directories( - test_@ANDROID_APP_NAME@ PRIVATE - ${FLTK_DIR}/ - ${FLTK_IDE_DIR}/ ) - -# Export ANativeActivity_onCreate() -# Refer to: https://github.com/android-ndk/ndk/issues/381. -set(CMAKE_SHARED_LINKER_FLAGS - "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate") - -# add lib dependencies -# FIXME: apps may depend on additional fltk libraries; thise dependencies -# must be created in the CREATE_ANDROID_IDE_FOR_TEST macro -target_link_libraries( - test_@ANDROID_APP_NAME@ - fltk - android - log - m -) - diff --git a/CMake/Android/HelloAndroid.cxx.in b/CMake/Android/HelloAndroid.cxx.in deleted file mode 100644 index edba702e9..000000000 --- a/CMake/Android/HelloAndroid.cxx.in +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright (C) 2010 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - - -#include "../../../test/@ANDROID_APP_NAME@.cxx" - - -/* - - Missing: - - screen scale and size: most desktop apps expect to be in a draggable window - on a larger desktop surface. For Android, there is usually no desktop, and - screen resolution is often very high, so that a regular FLTK window would - hide as a tiny gray spot in the top left corner - * windows should probably be centered by default - ? the screen resolution should adapt to the first opened window - ? we should be able to hint at a prefered screen resolution - * drawing call must scale at some point (line width!) - * rotating the screen must call the app handler and(?) window resize - * proportions: pixels should be square - Need Work: - - Fl_Android_Graphics_Driver::pie(int) needs refactoring - - ...::line(...) has round ing issues (see rounded box type) - - grab() not working when leaving window (adjuster...) - - scrolling if implemented as a complete redraw. Must implement real scrolling - - the 'hotspot' idea to position dialogs under the mouse cursor makes little sense on touch screen devices - - fix screen when keyboard pops up in front of the text cursor or input field (temporarily shift up?) - - ending 'message' will not quit the app right away, but wait for some timeout - - no support for dead-key entry - - no Shift-Tab - - * test/CubeMain.cxx : UNSUPPORTED - needs OpenGL - * test/CubeView.cxx : UNSUPPORTED - needs OpenGL - * test/shape.cxx : UNSUPPORTED - needs OpenGL - * test/cube.cxx : UNSUPPORTED - needs OpenGL - * test/fractals.cxx : UNSUPPORTED - needs OpenGL - * test/fracviewer.cxx : UNSUPPORTED - needs OpenGL - * test/fullscreen.cxx : UNSUPPORTED - needs OpenGL - * test/gl_overlay.cxx : UNSUPPORTED - needs OpenGL - * test/glpuzzle.cxx : UNSUPPORTED - needs OpenGL - * test/mandelbrot.cxx : UNSUPPORTED - needs Fluid - * test/keyboard.cxx : UNSUPPORTED - needs Fluid - * test/CubeViewUI.fl - * test/keyboard_ui.fl - * test/radio.fl - * test/tree.fl - * test/fast_slow.fl - * test/mandelbrot_ui.fl - * test/resize.fl - * test/valuators.fl - * test/inactive.fl - * test/preferences.fl - * test/tabs.fl - * test/cairo_test.cxx : UNSUPPORTED - needs Cairo - * test/tiled_image.cxx : UNSUPPORTED - X11 only - * test/forms.cxx : UNSUPPORTED - needs Forms - - * test/doublebuffer.cxx : FIXME - redering is completely wrong - * test/line_style.cxx : TODO - no line styles yet - * test/list_visuals.cxx : TODO - needs config.h - * test/threads.cxx : TODO - needs config.h for pthreads - * test/animated.cxx : TODO - redering errors (alpha channel?) - * test/native-filechooser.cxx : TODO - not yet implemented - * test/blocks.cxx : TODO - needs config.h - * test/offscreen.cxx : TODO - not yet implemented - * test/overlay.cxx : TODO - no overlay yet - * test/pixmap_browser.cxx : TODO - filebrowser not yet implemented, no images, no printer - * test/clock.cxx : TODO - no system clock call yet - * test/resizebox.cxx : TODO - no window manager yet - * test/rotated_text.cxx : TODO - no rotated text - * test/subwindow.cxx : TODO - no subwindows yet - * test/sudoku.cxx : TODO - sound support is in our way - * test/demo.cxx : TODO - fails to open window, but is is useful at all? - * test/device.cxx : TODO - printing support - * test/tile.cxx : TODO - subwindow support - * test/editor.cxx : TODO - file chooser missing - * test/file_chooser.cxx : TODO - file chooser missing - * test/fonts.cxx : TODO - works, but does not list system fonts or resource fonts - * test/help_dialog.cxx : TODO - not implemented - * test/icon.cxx : TODO - what does this do on Android? - * test/iconize.cxx : TODO - no window manager - * test/utf8.cxx : TODO - window manager, clipping - * test/windowfocus.cxx : TODO - what does this do? - * test/browser.cxx : TODO - needs text resource to load browser content - * test/unittests.cxx : TODO - crashing, no alpha in image drawing, clipping issues - - * test/image.cxx : + works - * test/twowin.cxx : + works - * test/table.cxx : + works, but window is much too large for mobile device - * test/cursor.cxx : + works, but no cursor on Android - * test/colbrowser.cxx : + works - * test/checkers.cxx : + works - * test/pixmap.cxx : + works - * test/navigation.cxx : + works - * test/curve.cxx : + works - * test/input_choice.cxx : + works - * test/input.cxx : + works - * test/scroll.cxx : - works ok - - some dirt when a popup draws over another menu button!? - - on touch-screens, menuitem should be selected when released - - on touch-screens, scroll groups should scroll on multitouch, or when not causing any other action - * test/bitmap.cxx : + 'bitmap' works - * test/message.cxx : - 'message' mostly works - - when ending the app, it will not close right away but instead hang around for a few seconds - * test/menubar.cxx : - 'menubar' mostly works including unicode - ! pressing 'button' will hang the app - - shortcut modifiers don't work - - right-click does not work (should this be emulated via click-and-hold?) - * test/output.cxx : + 'output' works - * test/ask.cxx : + 'ask' works - * test/button.cxx : + 'button' works, including beep - * test/pack.cxx : + 'pack' works - * test/adjuster.cxx : + 'adjuster' works - * test/arc.cxx : + 'arc' works as expected - * test/minimum.cxx : + 'minimum' works - * test/boxtype.cxx : + 'boxtype' works - * test/buttons.cxx : + 'buttons' works - * test/color_chooser.cxx: + 'color_chooser' works - * test/symbols.cxx : + 'symbols' working as expected - * test/hello.cxx : + 'hello' works fine, italics, shadow, etc. - * test/label.cxx : + 'label' works - - */ diff --git a/CMake/Android/Roboto-Regular.ttf b/CMake/Android/Roboto-Regular.ttf Binary files differdeleted file mode 100644 index 88dae907b..000000000 --- a/CMake/Android/Roboto-Regular.ttf +++ /dev/null diff --git a/CMake/Android/app.build.gradle.in b/CMake/Android/app.build.gradle.in deleted file mode 100644 index 9e579a4c7..000000000 --- a/CMake/Android/app.build.gradle.in +++ /dev/null @@ -1,26 +0,0 @@ -apply plugin: 'com.android.application' - - android { - compileSdkVersion 25 - - defaultConfig { - applicationId 'org.fltk.@ANDROID_APP_NAME@' - minSdkVersion 14 - targetSdkVersion 25 - externalNativeBuild { - cmake { - arguments '-DANDROID_STL=c++_shared' - } - } - } - buildTypes { - release { - minifyEnabled false - } - } - externalNativeBuild { - cmake { - path 'src/main/cpp/CMakeLists.txt' - } - } - } diff --git a/CMake/Android/build.gradle.in b/CMake/Android/build.gradle.in deleted file mode 100644 index f48a2c6ec..000000000 --- a/CMake/Android/build.gradle.in +++ /dev/null @@ -1,17 +0,0 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. -buildscript { - repositories { - jcenter() - google() - } - dependencies { - classpath 'com.android.tools.build:gradle:3.2.1' - } -} - -allprojects { - repositories { - jcenter() - google() - } -} diff --git a/CMake/Android/fl_config.cmake.in b/CMake/Android/fl_config.cmake.in deleted file mode 100644 index 5200197a9..000000000 --- a/CMake/Android/fl_config.cmake.in +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Configuration file for the Fast Light Tool Kit (FLTK). - * - * Copyright 1998-2020 by Bill Spitzak and others. - * - * This library is free software. Distribution and use rights are outlined in - * the file "COPYING" which should have been included with this file. If this - * file is missing or damaged, see the license at: - * - * https://www.fltk.org/COPYING.php - * - * Please see the following page on how to report bugs and issues: - * - * https://www.fltk.org/bugs.php - */ - -/* - ============================================================================ - DO NOT EDIT - This file is generated by CMake ! - ============================================================================ -*/ - -/* define FL_ABI_VERSION as 10x0y for FLTK ABI version 1.x.y */ - -/* #undef FL_ABI_VERSION */ diff --git a/CMake/Android/hdpi.ic_launcher.png b/CMake/Android/hdpi.ic_launcher.png Binary files differdeleted file mode 100755 index 1c28eb22b..000000000 --- a/CMake/Android/hdpi.ic_launcher.png +++ /dev/null diff --git a/CMake/Android/mdpi.ic_launcher.png b/CMake/Android/mdpi.ic_launcher.png Binary files differdeleted file mode 100755 index 4f12dba6a..000000000 --- a/CMake/Android/mdpi.ic_launcher.png +++ /dev/null diff --git a/CMake/Android/settings.gradle.in b/CMake/Android/settings.gradle.in deleted file mode 100644 index 8b1378917..000000000 --- a/CMake/Android/settings.gradle.in +++ /dev/null @@ -1 +0,0 @@ - diff --git a/CMake/Android/strings.xml.in b/CMake/Android/strings.xml.in deleted file mode 100644 index 351315218..000000000 --- a/CMake/Android/strings.xml.in +++ /dev/null @@ -1,4 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<resources> - <string name="app_name">@ANDROID_APP_NAME@</string> -</resources> diff --git a/CMake/Android/xhdpi.ic_launcher.png b/CMake/Android/xhdpi.ic_launcher.png Binary files differdeleted file mode 100755 index aa48b8524..000000000 --- a/CMake/Android/xhdpi.ic_launcher.png +++ /dev/null diff --git a/CMake/Android/xxhdpi.ic_launcher.png b/CMake/Android/xxhdpi.ic_launcher.png Binary files differdeleted file mode 100755 index 91aad3864..000000000 --- a/CMake/Android/xxhdpi.ic_launcher.png +++ /dev/null diff --git a/CMake/FindSDL2.cmake b/CMake/FindSDL2.cmake deleted file mode 100644 index 28cb8c603..000000000 --- a/CMake/FindSDL2.cmake +++ /dev/null @@ -1,169 +0,0 @@ - -# This module defines -# SDL2_LIBRARY, the name of the library to link against -# SDL2_FOUND, if false, do not try to link to SDL2 -# SDL2_INCLUDE_DIR, where to find SDL.h -# -# This module responds to the the flag: -# SDL2_BUILDING_LIBRARY -# If this is defined, then no SDL2main will be linked in because -# only applications need main(). -# Otherwise, it is assumed you are building an application and this -# module will attempt to locate and set the the proper link flags -# as part of the returned SDL2_LIBRARY variable. -# -# Don't forget to include SDLmain.h and SDLmain.m your project for the -# OS X framework based version. (Other versions link to -lSDL2main which -# this module will try to find on your behalf.) Also for OS X, this -# module will automatically add the -framework Cocoa on your behalf. -# -# -# Additional Note: If you see an empty SDL2_LIBRARY_TEMP in your configuration -# and no SDL2_LIBRARY, it means CMake did not find your SDL2 library -# (SDL2.dll, libsdl2.so, SDL2.framework, etc). -# Set SDL2_LIBRARY_TEMP to point to your SDL2 library, and configure again. -# Similarly, if you see an empty SDL2MAIN_LIBRARY, you should set this value -# as appropriate. These values are used to generate the final SDL2_LIBRARY -# variable, but when these values are unset, SDL2_LIBRARY does not get created. -# -# -# $SDL2DIR is an environment variable that would -# correspond to the ./configure --prefix=$SDL2DIR -# used in building SDL2. -# l.e.galup 9-20-02 -# -# Modified by Eric Wing. -# Added code to assist with automated building by using environmental variables -# and providing a more controlled/consistent search behavior. -# Added new modifications to recognize OS X frameworks and -# additional Unix paths (FreeBSD, etc). -# Also corrected the header search path to follow "proper" SDL guidelines. -# Added a search for SDL2main which is needed by some platforms. -# Added a search for threads which is needed by some platforms. -# Added needed compile switches for MinGW. -# -# On OSX, this will prefer the Framework version (if found) over others. -# People will have to manually change the cache values of -# SDL2_LIBRARY to override this selection or set the CMake environment -# CMAKE_INCLUDE_PATH to modify the search paths. -# -# Note that the header path has changed from SDL2/SDL.h to just SDL.h -# This needed to change because "proper" SDL convention -# is #include "SDL.h", not <SDL2/SDL.h>. This is done for portability -# reasons because not all systems place things in SDL2/ (see FreeBSD). - -#============================================================================= -# Copyright 2003-2009 Kitware, Inc. -# -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#============================================================================= -# (To distribute this file outside of CMake, substitute the full -# License text for the above reference.) - -message("<FindSDL2.cmake>") - -SET(SDL2_SEARCH_PATHS - ~/Library/Frameworks - /Library/Frameworks - /usr/local - /usr - /sw # Fink - /opt/local # DarwinPorts - /opt/csw # Blastwave - /opt - ${SDL2_PATH} -) - -FIND_PATH(SDL2_INCLUDE_DIR SDL.h - HINTS - $ENV{SDL2DIR} - PATH_SUFFIXES include/SDL2 include - PATHS ${SDL2_SEARCH_PATHS} -) - -FIND_LIBRARY(SDL2_LIBRARY_TEMP - NAMES SDL2 - HINTS - $ENV{SDL2DIR} - PATH_SUFFIXES lib64 lib - PATHS ${SDL2_SEARCH_PATHS} -) - -IF(NOT SDL2_BUILDING_LIBRARY) - IF(NOT ${SDL2_INCLUDE_DIR} MATCHES ".framework") - # Non-OS X framework versions expect you to also dynamically link to - # SDL2main. This is mainly for Windows and OS X. Other (Unix) platforms - # seem to provide SDL2main for compatibility even though they don't - # necessarily need it. - FIND_LIBRARY(SDL2MAIN_LIBRARY - NAMES SDL2main - HINTS - $ENV{SDL2DIR} - PATH_SUFFIXES lib64 lib - PATHS ${SDL2_SEARCH_PATHS} - ) - ENDIF(NOT ${SDL2_INCLUDE_DIR} MATCHES ".framework") -ENDIF(NOT SDL2_BUILDING_LIBRARY) - -# SDL2 may require threads on your system. -# The Apple build may not need an explicit flag because one of the -# frameworks may already provide it. -# But for non-OSX systems, I will use the CMake Threads package. -IF(NOT APPLE) - FIND_PACKAGE(Threads) -ENDIF(NOT APPLE) - -# MinGW needs an additional library, mwindows -# It's total link flags should look like -lmingw32 -lSDL2main -lSDL2 -lmwindows -# (Actually on second look, I think it only needs one of the m* libraries.) -IF(MINGW) - SET(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW") -ENDIF(MINGW) - -IF(SDL2_LIBRARY_TEMP) - # For SDL2main - IF(NOT SDL2_BUILDING_LIBRARY) - IF(SDL2MAIN_LIBRARY) - SET(SDL2_LIBRARY_TEMP ${SDL2MAIN_LIBRARY} ${SDL2_LIBRARY_TEMP}) - ENDIF(SDL2MAIN_LIBRARY) - ENDIF(NOT SDL2_BUILDING_LIBRARY) - - # For OS X, SDL2 uses Cocoa as a backend so it must link to Cocoa. - # CMake doesn't display the -framework Cocoa string in the UI even - # though it actually is there if I modify a pre-used variable. - # I think it has something to do with the CACHE STRING. - # So I use a temporary variable until the end so I can set the - # "real" variable in one-shot. - IF(APPLE) - SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} "-framework Cocoa") - ENDIF(APPLE) - - # For threads, as mentioned Apple doesn't need this. - # In fact, there seems to be a problem if I used the Threads package - # and try using this line, so I'm just skipping it entirely for OS X. - IF(NOT APPLE) - SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} ${CMAKE_THREAD_LIBS_INIT}) - ENDIF(NOT APPLE) - - # For MinGW library - IF(MINGW) - SET(SDL2_LIBRARY_TEMP ${MINGW32_LIBRARY} ${SDL2_LIBRARY_TEMP}) - ENDIF(MINGW) - - # Set the final string here so the GUI reflects the final state. - SET(SDL2_LIBRARY ${SDL2_LIBRARY_TEMP} CACHE STRING "Where the SDL2 Library can be found") - # Set the temp variable to INTERNAL so it is not seen in the CMake GUI - SET(SDL2_LIBRARY_TEMP "${SDL2_LIBRARY_TEMP}" CACHE INTERNAL "") -ENDIF(SDL2_LIBRARY_TEMP) - -message("</FindSDL2.cmake>") - -INCLUDE(FindPackageHandleStandardArgs) - -FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2 REQUIRED_VARS SDL2_LIBRARY SDL2_INCLUDE_DIR) - diff --git a/CMake/android.cmake b/CMake/android.cmake deleted file mode 100644 index 9fc78d828..000000000 --- a/CMake/android.cmake +++ /dev/null @@ -1,141 +0,0 @@ -# -# android.cmake to build the FLTK AndroidStudio project using CMake -# Written by Matthias Melcher -# -# Copyright 1998-2019 by Bill Spitzak and others. -# -# This library is free software. Distribution and use rights are outlined in -# the file "COPYING" which should have been included with this file. If this -# file is missing or damaged, see the license at: -# -# https://www.fltk.org/COPYING.php -# -# Please see the following page on how to report bugs and issues: -# -# https://www.fltk.org/bugs.php -# - -# all target modules will be added here later -configure_file( - "${CMAKE_CURRENT_SOURCE_DIR}/CMake/Android/settings.gradle.in" - "${CMAKE_CURRENT_BINARY_DIR}/AndroidStudio/settings.gradle" - @ONLY -) - -# configuration file for all modules -configure_file( - "${CMAKE_CURRENT_SOURCE_DIR}/CMake/Android/build.gradle.in" - "${CMAKE_CURRENT_BINARY_DIR}/AndroidStudio/build.gradle" - @ONLY -) - -# create a custom abi file for this setup -configure_file( - "${CMAKE_CURRENT_SOURCE_DIR}/fl_config.cmake.in" - "${CMAKE_CURRENT_BINARY_DIR}/AndroidStudio/FL/fl_config.h" - @ONLY -) - -# TODO: where should we create config.h? - -macro(CREATE_ANDROID_IDE_FOR_TEST NAME SOURCES LIBRARIES) - - # message(STATUS "Creating Android IDE for ${NAME}") - - set (ANDROID_APP_NAME ${NAME}) - set (ANDROID_FLTK_DIR ${CMAKE_SOURCE_DIR}) - - set (srcs) - set (ANDROID_APP_SOURCES) - set (ANDROID_FLUID_COMMANDS) - set (flsrcs) # fluid source files - foreach(src ${SOURCES}) - if ("${src}" MATCHES "\\.fl$") - list(APPEND flsrcs ${src}) - string(REGEX REPLACE "(.*).fl" \\1 basename ${src}) - string(APPEND ANDROID_FLUID_COMMANDS - "add_custom_command(\n" - " OUTPUT \"\${FLTK_DIR}/test/${basename}.cxx\" \"\${FLTK_DIR}/test/${basename}.h\"\n" - " COMMAND fluid -c \"${src}\"\n" - " WORKING_DIRECTORY \"\${FLTK_DIR}/test\"\n" - " DEPENDS \"\${FLTK_DIR}/test/${src}\"\n" - " MAIN_DEPENDENCY \"\${FLTK_DIR}/test/${src}\"\n" - ")\n\n" - ) - file(TOUCH "${basename}.cxx") - file(TOUCH "${basename}.h") - file(TOUCH "${basename}.fl") - set(src_cxx ${basename}.cxx) - else () - list(APPEND srcs ${src}) - set(src_cxx ${src}) - endif ("${src}" MATCHES "\\.fl$") - string(APPEND ANDROID_APP_SOURCES " \"\${FLTK_DIR}/test/${src_cxx}\"\n") - endforeach(src) - - configure_file( - "${CMAKE_SOURCE_DIR}/CMake/Android/app.build.gradle.in" - "${CMAKE_BINARY_DIR}/AndroidStudio/${ANDROID_APP_NAME}/build.gradle" - @ONLY - ) - - configure_file( - "${CMAKE_SOURCE_DIR}/CMake/Android/AndroidManifest.xml.in" - "${CMAKE_BINARY_DIR}/AndroidStudio/${ANDROID_APP_NAME}/src/main/AndroidManifest.xml" - @ONLY - ) - - configure_file( - "${CMAKE_SOURCE_DIR}/CMake/Android/Roboto-Regular.ttf" - "${CMAKE_BINARY_DIR}/AndroidStudio/${ANDROID_APP_NAME}/src/main/assets/fonts/Roboto-Regular.ttf" - COPYONLY - ) - - configure_file( - "${CMAKE_SOURCE_DIR}/CMake/Android/mdpi.ic_launcher.png" - "${CMAKE_BINARY_DIR}/AndroidStudio/${ANDROID_APP_NAME}/src/main/res/mipmap-mdpi/ic_launcher.png" - COPYONLY - ) - - configure_file( - "${CMAKE_SOURCE_DIR}/CMake/Android/hdpi.ic_launcher.png" - "${CMAKE_BINARY_DIR}/AndroidStudio/${ANDROID_APP_NAME}/src/main/res/mipmap-hdpi/ic_launcher.png" - COPYONLY - ) - - configure_file( - "${CMAKE_SOURCE_DIR}/CMake/Android/xhdpi.ic_launcher.png" - "${CMAKE_BINARY_DIR}/AndroidStudio/${ANDROID_APP_NAME}/src/main/res/mipmap-xhdpi/ic_launcher.png" - COPYONLY - ) - - configure_file( - "${CMAKE_SOURCE_DIR}/CMake/Android/xxhdpi.ic_launcher.png" - "${CMAKE_BINARY_DIR}/AndroidStudio/${ANDROID_APP_NAME}/src/main/res/mipmap-xxhdpi/ic_launcher.png" - COPYONLY - ) - - configure_file( - "${CMAKE_SOURCE_DIR}/CMake/Android/strings.xml.in" - "${CMAKE_BINARY_DIR}/AndroidStudio/${ANDROID_APP_NAME}/src/main/res/values/strings.xml" - @ONLY - ) - - configure_file( - "${CMAKE_SOURCE_DIR}/CMake/Android/CMakeList.txt.in" - "${CMAKE_BINARY_DIR}/AndroidStudio/${ANDROID_APP_NAME}/src/main/cpp/CMakeLists.txt" - @ONLY - ) - - file(APPEND "${CMAKE_BINARY_DIR}/AndroidStudio/settings.gradle" "include ':${ANDROID_APP_NAME}'\n") - -endmacro(CREATE_ANDROID_IDE_FOR_TEST NAME SOURCES LIBRARIES) - - -macro(CREATE_ANDROID_IDE_WRAPUP) - - # message(STATUS "Wrapping up Android IDE creation") - -endmacro(CREATE_ANDROID_IDE_WRAPUP) - - diff --git a/CMake/fl_create_example.cmake b/CMake/fl_create_example.cmake index c2db54e30..09c99ec44 100644 --- a/CMake/fl_create_example.cmake +++ b/CMake/fl_create_example.cmake @@ -46,8 +46,7 @@ # quotes if more than one library is required, e.g. "fltk_gl;fltk" # # CREATE_EXAMPLE can have an optional fourth argument with a list of options -# - the option ANDROID_OK is set if CREATE_EXAMPLE creates code for Android -# builds in addition to the native build +# - these options are currently not used # ################################################################################ @@ -62,11 +61,11 @@ macro (CREATE_EXAMPLE NAME SOURCES LIBRARIES) # create macOS bundle? 0 = no, 1 = yes - if (APPLE AND (NOT OPTION_APPLE_X11) AND (NOT OPTION_APPLE_SDL)) + if (APPLE AND (NOT OPTION_APPLE_X11)) set (MAC_BUNDLE 1) else () set (MAC_BUNDLE 0) - endif (APPLE AND (NOT OPTION_APPLE_X11) AND (NOT OPTION_APPLE_SDL)) + endif (APPLE AND (NOT OPTION_APPLE_X11)) # rename target name "help" (reserved since CMake 2.8.12) # FIXME: not necessary in FLTK 1.4 but left for compatibility (06/2020) @@ -164,15 +163,17 @@ macro (CREATE_EXAMPLE NAME SOURCES LIBRARIES) endif (MAC_BUNDLE) ###################################################################### - # Parse optional fourth argument "ANDROID_OK", see description above. + # Parse optional fourth argument, see description above. ###################################################################### - if (${ARGC} GREATER 3) - foreach (OPTION ${ARGV3}) - if (${OPTION} STREQUAL "ANDROID_OK" AND OPTION_CREATE_ANDROID_STUDIO_IDE) - CREATE_ANDROID_IDE_FOR_TEST (${NAME} ${SOURCES} ${LIBRARIES}) - endif () - endforeach () - endif () + # code left commented out as an example + + # *unused* # if (${ARGC} GREATER 3) + # *unused* # foreach (OPTION ${ARGV3}) + # *unused* # if (${OPTION} STREQUAL "xxx") + # *unused* # # do something ... + # *unused* # endif () + # *unused* # endforeach () + # *unused* # endif () endmacro (CREATE_EXAMPLE NAME SOURCES LIBRARIES) diff --git a/CMake/options.cmake b/CMake/options.cmake index f1e347fbc..eb8f1fe92 100644 --- a/CMake/options.cmake +++ b/CMake/options.cmake @@ -65,7 +65,6 @@ endif (WIN32) ####################################################################### if (APPLE) option (OPTION_APPLE_X11 "use X11" OFF) - option (OPTION_APPLE_SDL "use SDL" OFF) if (CMAKE_OSX_SYSROOT) list (APPEND FLTK_CFLAGS "-isysroot ${CMAKE_OSX_SYSROOT}") endif (CMAKE_OSX_SYSROOT) @@ -100,14 +99,6 @@ if (OPTION_APPLE_X11) endif (X11_INCLUDE_DIR) endif (OPTION_APPLE_X11) -if (OPTION_APPLE_SDL) - find_package (SDL2 REQUIRED) - if (SDL2_FOUND) - set (USE_SDL 1) - list (APPEND FLTK_LDLIBS SDL2_LIBRARY) - endif (SDL2_FOUND) -endif (OPTION_APPLE_SDL) - ####################################################################### option (OPTION_USE_POLL "use poll if available" OFF) mark_as_advanced (OPTION_USE_POLL) @@ -238,8 +229,6 @@ if (OPTION_USE_GL) set (OPENGL_LIBRARIES -L${PATH_TO_XLIBS} -lGLU -lGL) unset(HAVE_GL_GLU_H CACHE) find_file (HAVE_GL_GLU_H GL/glu.h PATHS ${X11_INCLUDE_DIR}) - elseif (OPTION_APPLE_SDL) - set (OPENGL_FOUND FALSE) else() include (FindOpenGL) if (APPLE) @@ -619,10 +608,6 @@ endif (OPTION_USE_KDIALOG) ####################################################################### ####################################################################### -option (OPTION_CREATE_ANDROID_STUDIO_IDE "create files needed to compile FLTK for Android" OFF) -####################################################################### - -####################################################################### option (CMAKE_SUPPRESS_REGENERATION "suppress rules to re-run CMake on rebuild" OFF) mark_as_advanced (CMAKE_SUPPRESS_REGENERATION) diff --git a/CMake/setup.cmake b/CMake/setup.cmake index 84b3ebda4..e2fd7929f 100644 --- a/CMake/setup.cmake +++ b/CMake/setup.cmake @@ -89,9 +89,6 @@ if (APPLE) if (NOT(${CMAKE_SYSTEM_VERSION} VERSION_LESS 17.0.0)) # a.k.a. macOS version ≥ 10.13 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_LIBCPP_HAS_THREAD_API_PTHREAD") endif (NOT(${CMAKE_SYSTEM_VERSION} VERSION_LESS 17.0.0)) - elseif (OPTION_APPLE_SDL) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SDL2_INCLUDE_DIRS} -U__APPLE__") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SDL2_INCLUDE_DIRS} -U__APPLE__") else () set (__APPLE_QUARTZ__ 1) set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework Cocoa") diff --git a/CMake/variables.cmake b/CMake/variables.cmake index 7ff8a53e1..27672c7d5 100644 --- a/CMake/variables.cmake +++ b/CMake/variables.cmake @@ -41,8 +41,6 @@ endif (DEBUG_VARIABLES_CMAKE) if (WIN32) list (APPEND FLTK_LDLIBS -lole32 -luuid -lcomctl32 -lws2_32) -elseif (APPLE AND OPTION_APPLE_SDL) - # FIXME: do nothing? elseif (APPLE AND NOT OPTION_APPLE_X11) list (APPEND FLTK_LDLIBS "-framework Cocoa") else () |
