Documentation updates (STR #568)

More CMake updates (STR #499)

The Watcom C++ compiler needed a small change (STR #567)


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@3869 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Michael R Sweet
2004-10-18 20:29:58 +00:00
parent bf910884cc
commit ca005c4067
13 changed files with 1058 additions and 943 deletions

View File

@@ -1,6 +1,9 @@
CHANGES IN FLTK 1.1.5 CHANGES IN FLTK 1.1.5
- Documentation updates (STR #570) - Documentation updates (STR #568, STR #570)
- More CMake updates (STR #499)
- The Watcom C++ compiler needed a small change (STR
#567)
- Added DESTDIR support and now remove all man pages for - Added DESTDIR support and now remove all man pages for
the "uninstall" target (STR #545) the "uninstall" target (STR #545)
- Fix PNG drawing on buggy WIN32 graphics cards (STR - Fix PNG drawing on buggy WIN32 graphics cards (STR

View File

@@ -5,10 +5,10 @@ PROJECT(FLTK)
SET(EXECUTABLE_OUTPUT_PATH ${FLTK_BINARY_DIR}/bin CACHE INTERNAL SET(EXECUTABLE_OUTPUT_PATH ${FLTK_BINARY_DIR}/bin CACHE INTERNAL
"Where to put the executables for FLTK" "Where to put the executables for FLTK"
) )
SET(LIBRARY_OUTPUT_PATH "${FLTK_BINARY_DIR}/lib" CACHE INTERNAL SET(LIBRARY_OUTPUT_PATH "${FLTK_BINARY_DIR}/lib" CACHE INTERNAL
"Where to put the libraries for FLTK" "Where to put the libraries for FLTK"
) )
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Test for some required system information. # Test for some required system information.
@@ -32,6 +32,18 @@ IF(WIN32)
ENDIF(NOT CYGWIN) ENDIF(NOT CYGWIN)
ENDIF(WIN32) ENDIF(WIN32)
SET(FLTK_X11 1)
SET(FLTK_APPLE 0)
IF(APPLE)
OPTION(FLTK_APPLE_X11 "Use X11 on Mac instead of Carbon" OFF)
MARK_AS_ADVANCED(FLTK_APPLE_X11)
IF(NOT FLTK_APPLE_X11)
SET(FLTK_APPLE 1)
SET(FLTK_X11 0)
OPTION(FLTK_QUARTZ "Use Quartz instead of Quickdraw" OFF)
ENDIF(NOT FLTK_APPLE_X11)
ENDIF(APPLE)
IF(UNIX) IF(UNIX)
INCLUDE(${CMAKE_ROOT}/Modules/FindX11.cmake) INCLUDE(${CMAKE_ROOT}/Modules/FindX11.cmake)
SET( FLTK_PLATFORM_DEPENDENT_LIBS ${X11_LIBRARIES} -lm) SET( FLTK_PLATFORM_DEPENDENT_LIBS ${X11_LIBRARIES} -lm)
@@ -61,6 +73,7 @@ MACRO(CHECK_INCLUDE_FILE_CONCAT FILE VARIABLE)
ENDIF(${VARIABLE}) ENDIF(${VARIABLE})
ENDMACRO(CHECK_INCLUDE_FILE_CONCAT) ENDMACRO(CHECK_INCLUDE_FILE_CONCAT)
CHECK_INCLUDE_FILE_CONCAT("GL/glu.h" HAVE_GL_GLU_H) CHECK_INCLUDE_FILE_CONCAT("GL/glu.h" HAVE_GL_GLU_H)
CHECK_INCLUDE_FILE_CONCAT("OpenGL/glu.h" HAVE_OPENGL_GLU_H)
CHECK_INCLUDE_FILE_CONCAT("dirent.h" HAVE_DIRENT_H) CHECK_INCLUDE_FILE_CONCAT("dirent.h" HAVE_DIRENT_H)
CHECK_INCLUDE_FILE_CONCAT("stdio.h" HAVE_STDIO_H) CHECK_INCLUDE_FILE_CONCAT("stdio.h" HAVE_STDIO_H)
CHECK_INCLUDE_FILE_CONCAT("strings.h" HAVE_STRINGS_H) CHECK_INCLUDE_FILE_CONCAT("strings.h" HAVE_STRINGS_H)
@@ -106,6 +119,7 @@ ENDIF(${SIZEOF_INT} MATCHES "^4$")
IF(${SIZEOF_INT} MATCHES "^8$") IF(${SIZEOF_INT} MATCHES "^8$")
SET(U64 "unsigned") SET(U64 "unsigned")
ELSE(${SIZEOF_INT} MATCHES "^8$") ELSE(${SIZEOF_INT} MATCHES "^8$")
INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR})
IF(${SIZEOF_LONG} MATCHES "^8$") IF(${SIZEOF_LONG} MATCHES "^8$")
SET(U64 "unsigned long") SET(U64 "unsigned long")
ENDIF(${SIZEOF_LONG} MATCHES "^8$") ENDIF(${SIZEOF_LONG} MATCHES "^8$")
@@ -116,10 +130,10 @@ SET(HAVE_GL 0)
# Set an option to build FLTK with OpenGL support # Set an option to build FLTK with OpenGL support
OPTION(USE_OPENGL "OpenGL Support" ON) OPTION(USE_OPENGL "OpenGL Support" ON)
IF(USE_OPENGL) IF(USE_OPENGL)
INCLUDE(${CMAKE_ROOT}/Modules/FindOpenGL.cmake) INCLUDE(${CMAKE_ROOT}/Modules/FindOpenGL.cmake)
IF(OPENGL_FOUND) IF(OPENGL_FOUND)
SET(HAVE_GL 1) SET(HAVE_GL 1)
ENDIF(OPENGL_FOUND) ENDIF(OPENGL_FOUND)
ENDIF(USE_OPENGL) ENDIF(USE_OPENGL)
# #
@@ -164,55 +178,120 @@ ENDMACRO(PERFORM_CMAKE_TEST FILE TEST)
# Set an option to build the zlib library or not # Set an option to build the zlib library or not
OPTION(FLTK_USE_SYSTEM_ZLIB "Use's system zlib" ON) OPTION(FLTK_USE_SYSTEM_ZLIB "Use's system zlib" ON)
IF(FLTK_USE_SYSTEM_ZLIB) IF(FLTK_USE_SYSTEM_ZLIB)
IF(ZLIB_FOUND) IF(ZLIB_FOUND)
SET(CMAKE_TEST_SPECIAL_LIBRARIES ${ZLIB_LIBRARIES}) SET(CMAKE_TEST_SPECIAL_LIBRARIES ${ZLIB_LIBRARIES})
PERFORM_CMAKE_TEST(CMake/PlatformTests.cxx HAVE_LIBZ) PERFORM_CMAKE_TEST(CMake/PlatformTests.cxx HAVE_LIBZ)
ENDIF(ZLIB_FOUND) ENDIF(ZLIB_FOUND)
# We build the fltk zlib # We build the fltk zlib
ELSE(FLTK_USE_SYSTEM_ZLIB) ELSE(FLTK_USE_SYSTEM_ZLIB)
MARK_AS_ADVANCED(ZLIB_INCLUDE_DIR) MARK_AS_ADVANCED(ZLIB_INCLUDE_DIR)
MARK_AS_ADVANCED(ZLIB_LIBRARY) MARK_AS_ADVANCED(ZLIB_LIBRARY)
SUBDIRS(zlib) SUBDIRS(zlib)
ENDIF(FLTK_USE_SYSTEM_ZLIB) ENDIF(FLTK_USE_SYSTEM_ZLIB)
# Set an option to build the jpeg library or not # Set an option to build the jpeg library or not
OPTION(FLTK_USE_SYSTEM_JPEG "Use's system jpeg" ON) OPTION(FLTK_USE_SYSTEM_JPEG "Use's system jpeg" ON)
IF(FLTK_USE_SYSTEM_JPEG) IF(FLTK_USE_SYSTEM_JPEG)
IF(JPEG_FOUND) IF(JPEG_FOUND)
SET(CMAKE_TEST_SPECIAL_LIBRARIES ${JPEG_LIBRARIES}) SET(CMAKE_TEST_SPECIAL_LIBRARIES ${JPEG_LIBRARIES})
PERFORM_CMAKE_TEST(CMake/PlatformTests.cxx HAVE_LIBJPEG) PERFORM_CMAKE_TEST(CMake/PlatformTests.cxx HAVE_LIBJPEG)
ENDIF(JPEG_FOUND) ENDIF(JPEG_FOUND)
# We build the fltk png # We build the fltk png
ELSE(FLTK_USE_SYSTEM_JPEG) ELSE(FLTK_USE_SYSTEM_JPEG)
MARK_AS_ADVANCED(JPEG_INCLUDE_DIR) MARK_AS_ADVANCED(JPEG_INCLUDE_DIR)
MARK_AS_ADVANCED(JPEG_LIBRARY) MARK_AS_ADVANCED(JPEG_LIBRARY)
SUBDIRS(jpeg) SUBDIRS(jpeg)
ENDIF(FLTK_USE_SYSTEM_JPEG) ENDIF(FLTK_USE_SYSTEM_JPEG)
# Set an option to build the png library or not # Set an option to build the png library or not
OPTION(FLTK_USE_SYSTEM_PNG "Use's system png" ON) OPTION(FLTK_USE_SYSTEM_PNG "Use's system png" ON)
IF(FLTK_USE_SYSTEM_PNG) IF(FLTK_USE_SYSTEM_PNG)
IF(PNG_FOUND) IF(PNG_FOUND)
SET(CMAKE_TEST_SPECIAL_LIBRARIES ${PNG_LIBRARIES}) SET(CMAKE_TEST_SPECIAL_LIBRARIES ${PNG_LIBRARIES})
PERFORM_CMAKE_TEST(CMake/PlatformTests.cxx HAVE_LIBPNG) PERFORM_CMAKE_TEST(CMake/PlatformTests.cxx HAVE_LIBPNG)
PERFORM_CMAKE_TEST(CMake/PlatformTests.cxx HAVE_PNG_GET_VALID) PERFORM_CMAKE_TEST(CMake/PlatformTests.cxx HAVE_PNG_GET_VALID)
PERFORM_CMAKE_TEST(CMake/PlatformTests.cxx HAVE_PNG_SET_TRNS_TO_ALPHA) PERFORM_CMAKE_TEST(CMake/PlatformTests.cxx HAVE_PNG_SET_TRNS_TO_ALPHA)
SET(HAVE_PNG_H 1) SET(HAVE_PNG_H 1)
ENDIF(PNG_FOUND) ENDIF(PNG_FOUND)
# We build the fltk png # We build the fltk png
ELSE(FLTK_USE_SYSTEM_PNG) ELSE(FLTK_USE_SYSTEM_PNG)
MARK_AS_ADVANCED(PNG_INCLUDE_DIR) MARK_AS_ADVANCED(PNG_INCLUDE_DIR)
MARK_AS_ADVANCED(PNG_LIBRARY) MARK_AS_ADVANCED(PNG_LIBRARY)
SUBDIRS(png) SUBDIRS(png)
ENDIF(FLTK_USE_SYSTEM_PNG) ENDIF(FLTK_USE_SYSTEM_PNG)
SUBDIRS(src) SUBDIRS(src)
SUBDIRS(fluid) SUBDIRS(fluid)
SET(FLTK_CREATE_SYMLINKS 1)
IF(WIN32)
IF(NOT UNIX)
SET(FLTK_CREATE_SYMLINKS 0)
ENDIF(NOT UNIX)
ENDIF(WIN32)
MACRO(SAFE_CREATE_SYMLINK SOURCE DESTINATION)
IF(EXISTS "${DESTINATION}")
ELSE(EXISTS "${DESTINATION}")
EXEC_PROGRAM(ln ARGS -s
"${SOURCE}"
"${DESTINATION}" OUTPUT_VARIABLE ln_output
RETURN_VALUE ln_retval)
IF("${ln_retval}" GREATER 0)
MESSAGE(FATAL_ERROR "Problem creatin symlink from \"${SOURCE}\" to \"${DESTINATION}\":\n${ln_output}")
ENDIF("${ln_retval}" GREATER 0)
ENDIF(EXISTS "${DESTINATION}")
ENDMACRO(SAFE_CREATE_SYMLINK SOURCE DESTINATION)
# If this is out-of-source build, then copy FL directory
FILE(GLOB FLTK_HEADER_FILES "${FLTK_SOURCE_DIR}/FL/*")
FOREACH(file ${FLTK_HEADER_FILES})
GET_FILENAME_COMPONENT(ext "${file}" EXT)
GET_FILENAME_COMPONENT(namewe "${file}" NAME_WE)
GET_FILENAME_COMPONENT(name "${file}" NAME)
STRING(COMPARE EQUAL "${ext}" ".h" lower_case_h)
STRING(COMPARE EQUAL "${ext}" ".H" upper_case_h)
IF(lower_case_h OR upper_case_h)
SET(outfile_h "${FLTK_BINARY_DIR}/FL/${namewe}.h")
SET(outfile_H "${FLTK_BINARY_DIR}/FL/${namewe}.H")
CONFIGURE_FILE("${file}" "${outfile_H}" COPYONLY IMMEDIATE)
# IF(FLTK_CREATE_SYMLINKS)
# SAFE_CREATE_SYMLINK("${outfile_H}" "${outfile_h}")
# ENDIF(FLTK_CREATE_SYMLINKS)
ELSE(lower_case_h OR upper_case_h)
STRING(COMPARE EQUAL "${ext}" ".r" mac_resource_file)
IF(mac_resource_file)
SET(outfile "${FLTK_BINARY_DIR}/FL/${name}")
CONFIGURE_FILE("${file}" "${outfile}" COPYONLY IMMEDIATE)
ENDIF(mac_resource_file)
ENDIF(lower_case_h OR upper_case_h)
ENDFOREACH(file)
IF(FLTK_CREATE_SYMLINKS)
SAFE_CREATE_SYMLINK(
"${FLTK_BINARY_DIR}/FL"
"${FLTK_BINARY_DIR}/Fl")
SAFE_CREATE_SYMLINK(
"${FLTK_BINARY_DIR}/FL/gl.H"
"${FLTK_BINARY_DIR}/FL/gl.h")
# Create the symlinks
FILE(READ ${FLTK_SOURCE_DIR}/fltk.list.in SYMLINKSFILE)
STRING(REGEX MATCHALL "(l 0000 root sys .includedir/)([^(\n)])+"
SYMLINKS ${SYMLINKSFILE})
FOREACH(var ${SYMLINKS} )
IF("${var}" MATCHES ".H")
STRING(REGEX MATCH "(/F)([^(\n)])+" tmp ${var})
STRING(REGEX MATCH "(/F)([^( )])+" in ${tmp})
STRING(REGEX MATCH "( )([^(\n)])+" out ${tmp})
STRING(REGEX REPLACE "( )" "" out ${out})
SAFE_CREATE_SYMLINK("${FLTK_BINARY_DIR}/FL/${out}" "${FLTK_BINARY_DIR}/${in}")
ENDIF("${var}" MATCHES ".H")
ENDFOREACH(var)
ENDIF(FLTK_CREATE_SYMLINKS)
# Set the fluid executable path # Set the fluid executable path
SET(FLUID_COMMAND ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/fluid) SET(FLUID_COMMAND ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/fluid)
@@ -220,9 +299,10 @@ SET(FLUID_COMMAND ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/fluid)
OPTION(BUILD_TESTS "Build the tests" ON) OPTION(BUILD_TESTS "Build the tests" ON)
IF(BUILD_TESTS) IF(BUILD_TESTS)
SUBDIRS(test) SUBDIRS(test)
ENABLE_TESTING()
INCLUDE(${CMAKE_ROOT}/Modules/Dart.cmake)
ENDIF(BUILD_TESTS ) ENDIF(BUILD_TESTS )
#Genereate the configuration file #Genereate the configuration file
SET(FLTK_EXECUTABLE_DIRS ${EXECUTABLE_OUTPUT_PATH}) SET(FLTK_EXECUTABLE_DIRS ${EXECUTABLE_OUTPUT_PATH})
SET(FLTK_LIBRARY_DIRS ${LIBRARY_OUTPUT_PATH}) SET(FLTK_LIBRARY_DIRS ${LIBRARY_OUTPUT_PATH})

View File

@@ -1,5 +1,5 @@
/* /*
* "$Id: filename.H,v 1.11.2.4.2.14 2004/04/11 04:38:54 easysw Exp $" * "$Id: filename.H,v 1.11.2.4.2.15 2004/10/18 20:29:54 easysw Exp $"
* *
* Filename header file for the Fast Light Tool Kit (FLTK). * Filename header file for the Fast Light Tool Kit (FLTK).
* *
@@ -51,7 +51,7 @@ inline int fl_filename_relative(char *to, const char *from) { return fl_filename
# endif /* __cplusplus */ # endif /* __cplusplus */
# if defined(WIN32) && !defined(__CYGWIN__) # if defined(WIN32) && !defined(__CYGWIN__) && !defined(__WATCOMC__)
struct dirent {char d_name[1];}; struct dirent {char d_name[1];};
@@ -65,6 +65,10 @@ struct dirent {char d_name[1];};
# include <sys/types.h> # include <sys/types.h>
# include "/usr/include/dirent.h" # include "/usr/include/dirent.h"
# elif defined(__WATCOMC__)
# include <sys/types.h>
# include <direct.h>
# else # else
/* /*
* WARNING: on some systems (very few nowadays?) <dirent.h> may not exist. * WARNING: on some systems (very few nowadays?) <dirent.h> may not exist.
@@ -127,5 +131,5 @@ FL_EXPORT int fl_filename_list(const char *d, struct dirent ***l,
#endif /* FL_FILENAME_H */ #endif /* FL_FILENAME_H */
/* /*
* End of "$Id: filename.H,v 1.11.2.4.2.14 2004/04/11 04:38:54 easysw Exp $". * End of "$Id: filename.H,v 1.11.2.4.2.15 2004/10/18 20:29:54 easysw Exp $".
*/ */

View File

@@ -1,10 +1,10 @@
/* /*
* "$Id: configh.cmake.in,v 1.1.2.1 2004/09/13 02:12:40 easysw Exp $" * "$Id: configh.cmake.in,v 1.1.2.2 2004/10/18 20:29:54 easysw Exp $"
* *
* Configuration file for the Fast Light Tool Kit (FLTK). * Configuration file for the Fast Light Tool Kit (FLTK).
* @configure_input@ * @configure_input@
* *
* Copyright 1998-2003 by Bill Spitzak and others. * Copyright 1998-2004 by Bill Spitzak and others.
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * modify it under the terms of the GNU Library General Public
@@ -98,6 +98,30 @@
#define USE_XDBE HAVE_XDBE #define USE_XDBE HAVE_XDBE
/*
* USE_QUARTZ:
*
* Use Quartz instead of Quickdraw on Apple Mac OS X machines.
* FLTK was originally ported to Quickdraw which is no longer
* supported by Apple. If USE_QUARTZ is defined, FLTK will be
* compiled using Quartz instead. This flag has no meaning on
* other operating systems.
*/
#cmakedefine FLTK_APPLE
#ifdef FLTK_APPLE
#cmakedefine FLTK_QUARTZ
#ifdef FLTK_QUARTZ
#define USE_QUARTZ 1
#define __APPLE_QUARTZ__
#undef __APPLE_QD__
#else
#define USE_QUARTZ 0
#undef __APPLE_QUARTZ__
#define __APPLE_QD__
#endif
#endif
/* /*
* HAVE_OVERLAY: * HAVE_OVERLAY:
* *
@@ -230,5 +254,5 @@
#endif #endif
/* /*
* End of "$Id: configh.cmake.in,v 1.1.2.1 2004/09/13 02:12:40 easysw Exp $". * End of "$Id: configh.cmake.in,v 1.1.2.2 2004/10/18 20:29:54 easysw Exp $".
*/ */

View File

@@ -346,7 +346,7 @@ with your application use:
<UL><PRE> <UL><PRE>
#include &quot;icon.xbm&quot; #include &quot;icon.xbm&quot;
fl_opendisplay(); // needed if display has not been previously opened fl_open_display(); // needed if display has not been previously opened
Pixmap p = XCreateBitmapFromData(fl_display, DefaultRootWindow(fl_display), Pixmap p = XCreateBitmapFromData(fl_display, DefaultRootWindow(fl_display),
icon_bits, icon_width, icon_height); icon_bits, icon_width, icon_height);

View File

@@ -161,9 +161,13 @@ SET(CFILES
vsnprintf.c vsnprintf.c
) )
# We need ansi c-flags, especially on HP
SET(CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS}")
SET(CMAKE_REQUIRED_FLAGS ${CMAKE_ANSI_CFLAGS})
ADD_LIBRARY(fltk ${CPPFILES} ${CFILES}) ADD_LIBRARY(fltk ${CPPFILES} ${CFILES})
TARGET_LINK_LIBRARIES(fltk ${FLTK_PLATFORM_DEPENDENT_LIBS}) TARGET_LINK_LIBRARIES(fltk ${FLTK_PLATFORM_DEPENDENT_LIBS} ${CMAKE_THREAD_LIBS_INIT})
IF(X11_FOUND) IF(X11_FOUND)
TARGET_LINK_LIBRARIES(fltk ${X11_LIBRARIES}) TARGET_LINK_LIBRARIES(fltk ${X11_LIBRARIES})