termux-packages/x11-packages/fltk/00-cmake-fix-lib-mess.patch

376 lines
16 KiB
Diff

diff -ruN b/CMake/macros.cmake a/CMake/macros.cmake
--- b/CMake/macros.cmake 2019-03-03 09:40:23.000000000 +0100
+++ a/CMake/macros.cmake 2019-03-10 21:58:32.895224605 +0100
@@ -22,11 +22,7 @@
#######################################################################
macro(FL_ADD_LIBRARY LIBNAME LIBTYPE LIBFILES)
- if (${LIBTYPE} STREQUAL "SHARED")
- set (LIBRARY_NAME ${LIBNAME}_SHARED)
- else ()
- set (LIBRARY_NAME ${LIBNAME})
- endif (${LIBTYPE} STREQUAL "SHARED")
+ set (LIBRARY_NAME ${LIBNAME}_${LIBTYPE})
if (MSVC)
set (LIBRARY_NAME_DEBUG "${LIBRARY_NAME}d")
@@ -38,7 +34,7 @@
set_target_properties(${LIBRARY_NAME}
PROPERTIES
- OUTPUT_NAME ${LIBRARY_NAME}
+ OUTPUT_NAME ${LIBNAME}
DEBUG_OUTPUT_NAME ${LIBRARY_NAME_DEBUG}
CLEAN_DIRECT_OUTPUT TRUE
COMPILE_DEFINITIONS "FL_LIBRARY"
@@ -47,6 +43,7 @@
if (${LIBTYPE} STREQUAL "SHARED")
set_target_properties(${LIBRARY_NAME}
PROPERTIES
+ OUTPUT_NAME ${LIBNAME}
VERSION ${FLTK_VERSION_FULL}
SOVERSION ${FLTK_VERSION_MAJOR}.${FLTK_VERSION_MINOR}
PREFIX "lib" # for MSVC static/shared coexistence
diff -ruN b/documentation/CMakeLists.txt a/documentation/CMakeLists.txt
--- b/documentation/CMakeLists.txt 2019-03-03 09:40:23.000000000 +0100
+++ a/documentation/CMakeLists.txt 2019-03-10 22:40:51.077135317 +0100
@@ -45,7 +45,7 @@
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating HTML documentation" VERBATIM
- DEPENDS fltk
+ DEPENDS fltk_STATIC
)
endif(OPTION_BUILD_HTML_DOCUMENTATION)
@@ -92,7 +92,7 @@
COMMAND cp -f latex/refman.pdf fltk.pdf
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating PDF documentation" VERBATIM
- DEPENDS fltk
+ DEPENDS fltk_STATIC
)
# add target 'pdf'
diff -ruN b/fluid/CMakeLists.txt a/fluid/CMakeLists.txt
--- b/fluid/CMakeLists.txt 2019-03-03 09:40:23.000000000 +0100
+++ a/fluid/CMakeLists.txt 2019-03-10 22:09:52.482801651 +0100
@@ -48,7 +48,7 @@
add_executable(fluid WIN32 ${CPPFILES})
endif(APPLE AND NOT OPTION_APPLE_X11)
-target_link_libraries(fluid fltk fltk_images fltk_forms)
+target_link_libraries(fluid fltk_STATIC fltk_images_STATIC fltk_forms_STATIC)
# install fluid
diff -ruN b/src/CMakeLists.txt a/src/CMakeLists.txt
--- b/src/CMakeLists.txt 2019-03-03 09:40:23.000000000 +0100
+++ a/src/CMakeLists.txt 2019-03-10 22:57:37.458302812 +0100
@@ -246,7 +246,7 @@
endif (WIN32)
if (FLTK_HAVE_CAIRO)
- list(APPEND OPTIONAL_LIBS fltk_cairo ${PKG_CAIRO_LIBRARIES})
+ list(APPEND OPTIONAL_LIBS fltk_cairo_STATIC ${PKG_CAIRO_LIBRARIES})
ENDif (FLTK_HAVE_CAIRO)
if (HAVE_XINERAMA)
@@ -275,41 +275,41 @@
#######################################################################
FL_ADD_LIBRARY(fltk STATIC "${STATIC_FILES}")
-target_link_libraries(fltk ${OPTIONAL_LIBS})
+target_link_libraries(fltk_STATIC ${OPTIONAL_LIBS})
#######################################################################
FL_ADD_LIBRARY(fltk_forms STATIC "${FLCPPFILES}")
-target_link_libraries(fltk_forms fltk)
+target_link_libraries(fltk_forms_STATIC fltk_STATIC)
#######################################################################
FL_ADD_LIBRARY(fltk_images STATIC "${IMGCPPFILES}")
-target_link_libraries(fltk_images fltk)
+target_link_libraries(fltk_images_STATIC fltk_STATIC)
if (OPTION_USE_SYSTEM_LIBJPEG)
- target_link_libraries(fltk_images ${FLTK_JPEG_LIBRARIES})
+ target_link_libraries(fltk_images_STATIC ${FLTK_JPEG_LIBRARIES})
else()
- target_link_libraries(fltk_images fltk_jpeg)
+ target_link_libraries(fltk_images_STATIC fltk_jpeg_STATIC)
endif (OPTION_USE_SYSTEM_LIBJPEG)
if (OPTION_USE_SYSTEM_ZLIB)
- target_link_libraries(fltk_images ${FLTK_ZLIB_LIBRARIES})
+ target_link_libraries(fltk_images_STATIC ${FLTK_ZLIB_LIBRARIES})
else()
- target_link_libraries(fltk_images fltk_z)
+ target_link_libraries(fltk_images_STATIC fltk_z_STATIC)
endif (OPTION_USE_SYSTEM_ZLIB)
if (OPTION_USE_SYSTEM_LIBPNG)
- target_link_libraries(fltk_images ${FLTK_PNG_LIBRARIES})
+ target_link_libraries(fltk_images_STATIC ${FLTK_PNG_LIBRARIES})
else()
- target_link_libraries(fltk_images fltk_png)
+ target_link_libraries(fltk_images_STATIC fltk_png_STATIC)
endif (OPTION_USE_SYSTEM_LIBPNG)
#######################################################################
if (OPENGL_FOUND)
FL_ADD_LIBRARY(fltk_gl STATIC "${GLCPPFILES}")
- target_link_libraries(fltk_gl fltk ${OPENGL_LIBRARIES})
+ target_link_libraries(fltk_gl_STATIC fltk_STATIC ${OPENGL_LIBRARIES})
endif (OPENGL_FOUND)
#######################################################################
@@ -332,7 +332,7 @@
FL_ADD_LIBRARY(fltk_forms SHARED "${FLCPPFILES}")
if (MSVC)
- target_link_libraries(fltk_forms_SHARED fltk)
+ target_link_libraries(fltk_forms_SHARED fltk_SHARED)
else ()
target_link_libraries(fltk_forms_SHARED fltk_SHARED)
endif (MSVC)
@@ -341,27 +341,27 @@
FL_ADD_LIBRARY(fltk_images SHARED "${IMGCPPFILES}")
if (MSVC)
- target_link_libraries(fltk_images_SHARED fltk)
+ target_link_libraries(fltk_images_SHARED fltk_SHARED)
else ()
target_link_libraries(fltk_images_SHARED fltk_SHARED)
endif (MSVC)
if (OPTION_USE_SYSTEM_LIBJPEG)
- target_link_libraries(fltk_images_SHARED ${FLTK_JPEG_LIBRARIES})
+ target_link_libraries(fltk_images_SHARED ${FLTK_JPEG_LIBRARIES})
else()
- target_link_libraries(fltk_images_SHARED fltk_jpeg_SHARED)
+ target_link_libraries(fltk_images_SHARED fltk_jpeg_SHARED)
endif (OPTION_USE_SYSTEM_LIBJPEG)
if (OPTION_USE_SYSTEM_LIBPNG)
- target_link_libraries(fltk_images_SHARED ${FLTK_PNG_LIBRARIES})
+ target_link_libraries(fltk_images_SHARED ${FLTK_PNG_LIBRARIES})
else()
- target_link_libraries(fltk_images_SHARED fltk_png_SHARED)
+ target_link_libraries(fltk_images_SHARED fltk_png_SHARED)
endif (OPTION_USE_SYSTEM_LIBPNG)
if (OPTION_USE_SYSTEM_ZLIB)
- target_link_libraries(fltk_images_SHARED ${FLTK_ZLIB_LIBRARIES})
+ target_link_libraries(fltk_images_SHARED ${FLTK_ZLIB_LIBRARIES})
else()
- target_link_libraries(fltk_images_SHARED fltk_z_SHARED)
+ target_link_libraries(fltk_images_SHARED fltk_z_SHARED)
endif (OPTION_USE_SYSTEM_ZLIB)
###################################################################
@@ -369,9 +369,9 @@
if (OPENGL_FOUND)
FL_ADD_LIBRARY(fltk_gl SHARED "${GLCPPFILES}")
if (MSVC)
- target_link_libraries(fltk_gl_SHARED fltk ${OPENGL_LIBRARIES})
+ target_link_libraries(fltk_gl_SHARED fltk_SHARED ${OPENGL_LIBRARIES})
else ()
- target_link_libraries(fltk_gl_SHARED fltk_SHARED ${OPENGL_LIBRARIES})
+ target_link_libraries(fltk_gl_SHARED fltk_SHARED ${OPENGL_LIBRARIES})
endif (MSVC)
endif (OPENGL_FOUND)
diff -ruN b/test/CMakeLists.txt a/test/CMakeLists.txt
--- b/test/CMakeLists.txt 2019-03-03 09:40:23.000000000 +0100
+++ a/test/CMakeLists.txt 2019-03-10 23:13:36.096519270 +0100
@@ -25,108 +25,108 @@
endif(APPLE AND NOT OPTION_APPLE_X11)
#######################################################################
-CREATE_EXAMPLE(adjuster adjuster.cxx fltk)
-CREATE_EXAMPLE(arc arc.cxx fltk)
-CREATE_EXAMPLE(animated animated.cxx fltk)
-CREATE_EXAMPLE(ask ask.cxx fltk)
-CREATE_EXAMPLE(bitmap bitmap.cxx fltk)
+CREATE_EXAMPLE(adjuster adjuster.cxx fltk_STATIC)
+CREATE_EXAMPLE(arc arc.cxx fltk_STATIC)
+CREATE_EXAMPLE(animated animated.cxx fltk_STATIC)
+CREATE_EXAMPLE(ask ask.cxx fltk_STATIC)
+CREATE_EXAMPLE(bitmap bitmap.cxx fltk_STATIC)
set(BLOCKS_ICON "${CMAKE_CURRENT_SOURCE_DIR}/blocks.app/Contents/Resources/blocks.icns")
-CREATE_EXAMPLE(blocks "blocks.cxx;${BLOCKS_ICON}" "fltk;${AUDIOLIBS}")
+CREATE_EXAMPLE(blocks "blocks.cxx;${BLOCKS_ICON}" "fltk_STATIC;${AUDIOLIBS}")
-CREATE_EXAMPLE(boxtype boxtype.cxx fltk)
-CREATE_EXAMPLE(browser browser.cxx fltk)
-CREATE_EXAMPLE(button button.cxx fltk)
-CREATE_EXAMPLE(buttons buttons.cxx fltk)
+CREATE_EXAMPLE(boxtype boxtype.cxx fltk_STATIC)
+CREATE_EXAMPLE(browser browser.cxx fltk_STATIC)
+CREATE_EXAMPLE(button button.cxx fltk_STATIC)
+CREATE_EXAMPLE(buttons buttons.cxx fltk_STATIC)
set(CHECKERS_ICON "${CMAKE_CURRENT_SOURCE_DIR}/checkers.app/Contents/Resources/checkers.icns")
-CREATE_EXAMPLE(checkers "checkers.cxx;${CHECKERS_ICON}" fltk)
+CREATE_EXAMPLE(checkers "checkers.cxx;${CHECKERS_ICON}" fltk_STATIC)
-CREATE_EXAMPLE(clock clock.cxx fltk)
-CREATE_EXAMPLE(colbrowser colbrowser.cxx "fltk;fltk_forms")
-CREATE_EXAMPLE(color_chooser color_chooser.cxx fltk)
-CREATE_EXAMPLE(cursor cursor.cxx fltk)
-CREATE_EXAMPLE(curve curve.cxx fltk)
+CREATE_EXAMPLE(clock clock.cxx fltk_STATIC)
+CREATE_EXAMPLE(colbrowser colbrowser.cxx "fltk_STATIC;fltk_forms_STATIC")
+CREATE_EXAMPLE(color_chooser color_chooser.cxx fltk_STATIC)
+CREATE_EXAMPLE(cursor cursor.cxx fltk_STATIC)
+CREATE_EXAMPLE(curve curve.cxx fltk_STATIC)
-CREATE_EXAMPLE(demo "demo.cxx;demo.menu" fltk)
+CREATE_EXAMPLE(demo "demo.cxx;demo.menu" fltk_STATIC)
set_source_files_properties(demo.menu PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
-CREATE_EXAMPLE(device device.cxx fltk)
-CREATE_EXAMPLE(doublebuffer doublebuffer.cxx fltk)
+CREATE_EXAMPLE(device device.cxx fltk_STATIC)
+CREATE_EXAMPLE(doublebuffer doublebuffer.cxx fltk_STATIC)
-CREATE_EXAMPLE(editor editor.cxx fltk)
+CREATE_EXAMPLE(editor editor.cxx fltk_STATIC)
set_target_properties(editor PROPERTIES
MACOSX_BUNDLE_INFO_PLIST "${PROJECT_SOURCE_DIR}/ide/Xcode4/plists/editor-Info.plist"
)
-CREATE_EXAMPLE(fast_slow fast_slow.fl fltk)
-CREATE_EXAMPLE(file_chooser file_chooser.cxx "fltk;fltk_images")
-CREATE_EXAMPLE(fonts fonts.cxx fltk)
-CREATE_EXAMPLE(forms forms.cxx "fltk;fltk_forms")
-CREATE_EXAMPLE(hello hello.cxx fltk)
-CREATE_EXAMPLE(help help.cxx "fltk;fltk_images")
-CREATE_EXAMPLE(icon icon.cxx fltk)
-CREATE_EXAMPLE(iconize iconize.cxx fltk)
-CREATE_EXAMPLE(image image.cxx fltk)
-CREATE_EXAMPLE(inactive inactive.fl fltk)
-CREATE_EXAMPLE(input input.cxx fltk)
-CREATE_EXAMPLE(input_choice input_choice.cxx fltk)
-CREATE_EXAMPLE(keyboard "keyboard.cxx;keyboard_ui.fl" fltk)
-CREATE_EXAMPLE(label label.cxx "fltk;fltk_forms")
-CREATE_EXAMPLE(line_style line_style.cxx fltk)
-CREATE_EXAMPLE(list_visuals list_visuals.cxx fltk)
-CREATE_EXAMPLE(mandelbrot "mandelbrot_ui.fl;mandelbrot.cxx" fltk)
-CREATE_EXAMPLE(menubar menubar.cxx fltk)
-CREATE_EXAMPLE(message message.cxx fltk)
-CREATE_EXAMPLE(minimum minimum.cxx fltk)
-CREATE_EXAMPLE(native-filechooser native-filechooser.cxx "fltk;fltk_images")
-CREATE_EXAMPLE(navigation navigation.cxx fltk)
-CREATE_EXAMPLE(output output.cxx "fltk;fltk_forms")
-CREATE_EXAMPLE(overlay overlay.cxx fltk)
-CREATE_EXAMPLE(pack pack.cxx fltk)
-CREATE_EXAMPLE(pixmap pixmap.cxx fltk)
-CREATE_EXAMPLE(pixmap_browser pixmap_browser.cxx "fltk;fltk_images")
-CREATE_EXAMPLE(preferences preferences.fl fltk)
-CREATE_EXAMPLE(offscreen offscreen.cxx fltk)
-CREATE_EXAMPLE(radio radio.fl fltk)
-CREATE_EXAMPLE(resize resize.fl fltk)
-CREATE_EXAMPLE(resizebox resizebox.cxx fltk)
-CREATE_EXAMPLE(rotated_text rotated_text.cxx fltk)
-CREATE_EXAMPLE(scroll scroll.cxx fltk)
-CREATE_EXAMPLE(subwindow subwindow.cxx fltk)
+CREATE_EXAMPLE(fast_slow fast_slow.fl fltk_STATIC)
+CREATE_EXAMPLE(file_chooser file_chooser.cxx "fltk_STATIC;fltk_images_STATIC")
+CREATE_EXAMPLE(fonts fonts.cxx fltk_STATIC)
+CREATE_EXAMPLE(forms forms.cxx "fltk_STATIC;fltk_forms_STATIC")
+CREATE_EXAMPLE(hello hello.cxx fltk_STATIC)
+CREATE_EXAMPLE(help help.cxx "fltk_STATIC;fltk_images_STATIC")
+CREATE_EXAMPLE(icon icon.cxx fltk_STATIC)
+CREATE_EXAMPLE(iconize iconize.cxx fltk_STATIC)
+CREATE_EXAMPLE(image image.cxx fltk_STATIC)
+CREATE_EXAMPLE(inactive inactive.fl fltk_STATIC)
+CREATE_EXAMPLE(input input.cxx fltk_STATIC)
+CREATE_EXAMPLE(input_choice input_choice.cxx fltk_STATIC)
+CREATE_EXAMPLE(keyboard "keyboard.cxx;keyboard_ui.fl" fltk_STATIC)
+CREATE_EXAMPLE(label label.cxx "fltk_STATIC;fltk_forms_STATIC")
+CREATE_EXAMPLE(line_style line_style.cxx fltk_STATIC)
+CREATE_EXAMPLE(list_visuals list_visuals.cxx fltk_STATIC)
+CREATE_EXAMPLE(mandelbrot "mandelbrot_ui.fl;mandelbrot.cxx" fltk_STATIC)
+CREATE_EXAMPLE(menubar menubar.cxx fltk_STATIC)
+CREATE_EXAMPLE(message message.cxx fltk_STATIC)
+CREATE_EXAMPLE(minimum minimum.cxx fltk_STATIC)
+CREATE_EXAMPLE(native-filechooser native-filechooser.cxx "fltk_STATIC;fltk_images_STATIC")
+CREATE_EXAMPLE(navigation navigation.cxx fltk_STATIC)
+CREATE_EXAMPLE(output output.cxx "fltk_STATIC;fltk_forms_STATIC")
+CREATE_EXAMPLE(overlay overlay.cxx fltk_STATIC)
+CREATE_EXAMPLE(pack pack.cxx fltk_STATIC)
+CREATE_EXAMPLE(pixmap pixmap.cxx fltk_STATIC)
+CREATE_EXAMPLE(pixmap_browser pixmap_browser.cxx "fltk_STATIC;fltk_images_STATIC")
+CREATE_EXAMPLE(preferences preferences.fl fltk_STATIC)
+CREATE_EXAMPLE(offscreen offscreen.cxx fltk_STATIC)
+CREATE_EXAMPLE(radio radio.fl fltk_STATIC)
+CREATE_EXAMPLE(resize resize.fl fltk_STATIC)
+CREATE_EXAMPLE(resizebox resizebox.cxx fltk_STATIC)
+CREATE_EXAMPLE(rotated_text rotated_text.cxx fltk_STATIC)
+CREATE_EXAMPLE(scroll scroll.cxx fltk_STATIC)
+CREATE_EXAMPLE(subwindow subwindow.cxx fltk_STATIC)
set(SUDOKU_ICON "${CMAKE_CURRENT_SOURCE_DIR}/sudoku.app/Contents/Resources/sudoku.icns")
-CREATE_EXAMPLE(sudoku "sudoku.cxx;${SUDOKU_ICON}" "fltk;fltk_images;${AUDIOLIBS}")
+CREATE_EXAMPLE(sudoku "sudoku.cxx;${SUDOKU_ICON}" "fltk_STATIC;fltk_images_STATIC;${AUDIOLIBS}")
-CREATE_EXAMPLE(symbols symbols.cxx fltk)
-CREATE_EXAMPLE(tabs tabs.fl fltk)
-CREATE_EXAMPLE(table table.cxx fltk)
-CREATE_EXAMPLE(threads threads.cxx fltk)
-CREATE_EXAMPLE(tile tile.cxx fltk)
-CREATE_EXAMPLE(tiled_image tiled_image.cxx fltk)
-CREATE_EXAMPLE(tree tree.fl fltk)
-CREATE_EXAMPLE(twowin twowin.cxx fltk)
-CREATE_EXAMPLE(utf8 utf8.cxx fltk)
-CREATE_EXAMPLE(valuators valuators.fl fltk)
-CREATE_EXAMPLE(unittests unittests.cxx fltk)
-CREATE_EXAMPLE(windowfocus windowfocus.cxx fltk)
+CREATE_EXAMPLE(symbols symbols.cxx fltk_STATIC)
+CREATE_EXAMPLE(tabs tabs.fl fltk_STATIC)
+CREATE_EXAMPLE(table table.cxx fltk_STATIC)
+CREATE_EXAMPLE(threads threads.cxx fltk_STATIC)
+CREATE_EXAMPLE(tile tile.cxx fltk_STATIC)
+CREATE_EXAMPLE(tiled_image tiled_image.cxx fltk_STATIC)
+CREATE_EXAMPLE(tree tree.fl fltk_STATIC)
+CREATE_EXAMPLE(twowin twowin.cxx fltk_STATIC)
+CREATE_EXAMPLE(utf8 utf8.cxx fltk_STATIC)
+CREATE_EXAMPLE(valuators valuators.fl fltk_STATIC)
+CREATE_EXAMPLE(unittests unittests.cxx fltk_STATIC)
+CREATE_EXAMPLE(windowfocus windowfocus.cxx fltk_STATIC)
-CREATE_EXAMPLE(fltk-versions ../examples/fltk-versions.cxx fltk)
+CREATE_EXAMPLE(fltk-versions ../examples/fltk-versions.cxx fltk_STATIC)
# OpenGL demos...
if(OPENGL_FOUND)
-CREATE_EXAMPLE(CubeView "CubeMain.cxx;CubeView.cxx;CubeViewUI.fl" "fltk;fltk_gl")
-CREATE_EXAMPLE(cube cube.cxx "fltk;fltk_gl;${OPENGL_LIBRARIES}")
-CREATE_EXAMPLE(fractals "fractals.cxx;fracviewer.cxx" "fltk;fltk_gl")
-CREATE_EXAMPLE(fullscreen fullscreen.cxx "fltk;fltk_gl")
-CREATE_EXAMPLE(glpuzzle glpuzzle.cxx "fltk;fltk_gl;${OPENGL_LIBRARIES}")
-CREATE_EXAMPLE(gl_overlay gl_overlay.cxx "fltk;fltk_gl;${OPENGL_LIBRARIES}")
-CREATE_EXAMPLE(shape shape.cxx "fltk;fltk_gl;${OPENGL_LIBRARIES}")
+CREATE_EXAMPLE(CubeView "CubeMain.cxx;CubeView.cxx;CubeViewUI.fl" "fltk_STATIC;fltk_gl_STATIC")
+CREATE_EXAMPLE(cube cube.cxx "fltk_STATIC;fltk_gl_STATIC;${OPENGL_LIBRARIES}")
+CREATE_EXAMPLE(fractals "fractals.cxx;fracviewer.cxx" "fltk_STATIC;fltk_gl_STATIC")
+CREATE_EXAMPLE(fullscreen fullscreen.cxx "fltk_STATIC;fltk_gl_STATIC")
+CREATE_EXAMPLE(glpuzzle glpuzzle.cxx "fltk_STATIC;fltk_gl_STATIC;${OPENGL_LIBRARIES}")
+CREATE_EXAMPLE(gl_overlay gl_overlay.cxx "fltk_STATIC;fltk_gl_STATIC;${OPENGL_LIBRARIES}")
+CREATE_EXAMPLE(shape shape.cxx "fltk_STATIC;fltk_gl_STATIC;${OPENGL_LIBRARIES}")
endif(OPENGL_FOUND)
# Cairo demo
if(FLTK_HAVE_CAIRO)
- CREATE_EXAMPLE(cairo_test cairo_test.cxx "fltk;fltk_cairo")
+ CREATE_EXAMPLE(cairo_test cairo_test.cxx "fltk_STATIC;fltk_cairo_STATIC")
endif(FLTK_HAVE_CAIRO)
# We need some support files for the demo programs: