This commit contains patch submitted by "fltk.x0" (thanks fltk.x0!) in the middle of May this year - STR #863. Also small change in fluid.cxx - time.h was needed for successful build on MinGW.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4468 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
parent
289434a6e2
commit
1cd06f3ad0
@ -12,7 +12,7 @@ SET(FLTK_SOURCE_DIR "@FLTK_SOURCE_DIR@")
|
||||
SET(FLUID_COMMAND "@FLTK_FLUID_COMMAND@")
|
||||
SET(FLTK_EXECUTABLE_DIRS "@FLTK_EXECUTABLE_DIRS@")
|
||||
SET(FLTK_LIBRARY_DIRS "@FLTK_LIBRARY_DIRS@")
|
||||
SET(FLTK_LIBRARIES "fltk_images;fltk;fltk_gl;fltk_forms")
|
||||
SET(FLTK_LIBRARIES "@FLTK_LIBRARIES@")
|
||||
SET(FLTK_INCLUDE_DIRS "@FLTK_INCLUDE_DIRS@")
|
||||
|
||||
# The C and C++ flags added by FLTK to the cmake-configured flags.
|
||||
|
@ -11,6 +11,8 @@ SET(FLTK_VERSION_PATCH "7")
|
||||
SET(FLTK_VERSION "${FLTK_VERSION_MAJOR}.${FLTK_VERSION_MINOR}")
|
||||
SET(FLTK_VERSION_FULL "${FLTK_VERSION}.${FLTK_VERSION_PATCH}")
|
||||
|
||||
SET(FLTK_LIBRARIES "fltk_images;fltk;fltk_gl;fltk_forms")
|
||||
|
||||
# Executables and libraries should just go to bin
|
||||
SET(EXECUTABLE_OUTPUT_PATH "${FLTK_BINARY_DIR}/bin" CACHE INTERNAL
|
||||
"Where to put the executables for FLTK"
|
||||
@ -72,6 +74,11 @@ IF(CYGWIN)
|
||||
SET( FLTK_PLATFORM_DEPENDENT_LIBS ole32 uuid comctl32 wsock32 supc++ -lm -lgdi32)
|
||||
ENDIF(CYGWIN)
|
||||
|
||||
IF(MINGW)
|
||||
ADD_DEFINITIONS(-DWIN32)
|
||||
SET( FLTK_PLATFORM_DEPENDENT_LIBS ole32 uuid wsock32 gdi32 comdlg32)
|
||||
ENDIF(MINGW)
|
||||
|
||||
INCLUDE(CheckIncludeFiles)
|
||||
# Check if header file exists and add it to the list.
|
||||
MACRO(CHECK_INCLUDE_FILE_CONCAT FILE VARIABLE)
|
||||
@ -85,7 +92,6 @@ CHECK_INCLUDE_FILE_CONCAT("OpenGL/glu.h" HAVE_OPENGL_GLU_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("dirent.h" HAVE_DIRENT_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("stdio.h" HAVE_STDIO_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("strings.h" HAVE_STRINGS_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("locale.h" HAVE_LOCALE_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("sys/dir.h" HAVE_SYS_DIR_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("sys/ndir.h" HAVE_SYS_NDIR_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("sys/select.h" HAVE_SYS_SELECT_H)
|
||||
@ -106,7 +112,6 @@ CHECK_SYMBOL_EXISTS(strlcpy "${PROJECT_INCLUDES}" HAVE_STRLCPY)
|
||||
CHECK_SYMBOL_EXISTS(vsnprintf "${PROJECT_INCLUDES}" HAVE_VSNPRINTF)
|
||||
CHECK_SYMBOL_EXISTS(snprintf "${PROJECT_INCLUDES}" HAVE_SNPRINTF)
|
||||
CHECK_SYMBOL_EXISTS(scandir "${PROJECT_INCLUDES}" HAVE_SCANDIR)
|
||||
CHECK_SYMBOL_EXISTS(localeconv "${PROJECT_INCLUDES}" HAVE_LOCALECONV)
|
||||
|
||||
INCLUDE(CheckTypeSize)
|
||||
|
||||
@ -184,6 +189,7 @@ OPTION(FLTK_USE_SYSTEM_ZLIB "Use's system zlib" OFF)
|
||||
IF(FLTK_USE_SYSTEM_ZLIB)
|
||||
IF(ZLIB_FOUND)
|
||||
SET(CMAKE_TEST_SPECIAL_LIBRARIES ${ZLIB_LIBRARIES})
|
||||
SET(FLTK_ZLIB_LIBRARIES ${ZLIB_LIBRARIES})
|
||||
PERFORM_CMAKE_TEST(CMake/PlatformTests.cxx HAVE_LIBZ)
|
||||
ENDIF(ZLIB_FOUND)
|
||||
# We build the fltk zlib
|
||||
@ -193,6 +199,7 @@ ELSE(FLTK_USE_SYSTEM_ZLIB)
|
||||
SUBDIRS(zlib)
|
||||
SET(HAVE_LIBZ 1)
|
||||
SET(FLTK_ZLIB_LIBRARIES fltk_zlib)
|
||||
SET(FLTK_LIBRARIES "${FLTK_LIBRARIES};fltk_zlib")
|
||||
INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/zlib")
|
||||
ENDIF(FLTK_USE_SYSTEM_ZLIB)
|
||||
|
||||
@ -201,6 +208,7 @@ OPTION(FLTK_USE_SYSTEM_JPEG "Use's system jpeg" OFF)
|
||||
IF(FLTK_USE_SYSTEM_JPEG)
|
||||
IF(JPEG_FOUND)
|
||||
SET(CMAKE_TEST_SPECIAL_LIBRARIES ${JPEG_LIBRARIES})
|
||||
SET(FLTK_JPEG_LIBRARIES ${JPEG_LIBRARIES})
|
||||
PERFORM_CMAKE_TEST(CMake/PlatformTests.cxx HAVE_LIBJPEG)
|
||||
ENDIF(JPEG_FOUND)
|
||||
# We build the fltk png
|
||||
@ -209,7 +217,8 @@ ELSE(FLTK_USE_SYSTEM_JPEG)
|
||||
MARK_AS_ADVANCED(JPEG_LIBRARY)
|
||||
SUBDIRS(jpeg)
|
||||
SET(HAVE_LIBJPEG 1)
|
||||
SET(JPEG_LIBRARIES fltk_jpeg)
|
||||
SET(FLTK_JPEG_LIBRARIES fltk_jpeg)
|
||||
SET(FLTK_LIBRARIES "${FLTK_LIBRARIES};fltk_jpeg")
|
||||
INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/jpeg")
|
||||
ENDIF(FLTK_USE_SYSTEM_JPEG)
|
||||
|
||||
@ -218,6 +227,7 @@ OPTION(FLTK_USE_SYSTEM_PNG "Use's system png" OFF)
|
||||
IF(FLTK_USE_SYSTEM_PNG)
|
||||
IF(PNG_FOUND)
|
||||
SET(CMAKE_TEST_SPECIAL_LIBRARIES ${PNG_LIBRARIES})
|
||||
SET(FLTK_PNG_LIBRARIES ${PNG_LIBRARIES})
|
||||
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_SET_TRNS_TO_ALPHA)
|
||||
@ -230,7 +240,8 @@ ELSE(FLTK_USE_SYSTEM_PNG)
|
||||
SUBDIRS(png)
|
||||
SET(HAVE_LIBPNG 1)
|
||||
SET(HAVE_PNG_H 1)
|
||||
SET(PNG_LIBRARIES fltk_png)
|
||||
SET(FLTK_PNG_LIBRARIES fltk_png)
|
||||
SET(FLTK_LIBRARIES "${FLTK_LIBRARIES};fltk_png")
|
||||
INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/png")
|
||||
ENDIF(FLTK_USE_SYSTEM_PNG)
|
||||
|
||||
|
@ -22,9 +22,9 @@ SET(CPPFILES
|
||||
|
||||
|
||||
ADD_EXECUTABLE(fluid ${CPPFILES})
|
||||
INSTALL_TARGETS(/bin fluid)
|
||||
TARGET_LINK_LIBRARIES(fluid fltk fltk_images fltk_forms ${FLTK_PLATFORM_DEPENDENT_LIBS})
|
||||
IF(OPENGL_FOUND)
|
||||
TARGET_LINK_LIBRARIES(fluid fltk_gl)
|
||||
ENDIF(OPENGL_FOUND)
|
||||
|
||||
INSTALL_TARGETS(/bin fluid)
|
||||
|
@ -43,6 +43,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include <sys/stat.h>
|
||||
#include <time.h> // time(), localtime(), etc.
|
||||
|
||||
#include "../src/flstring.h"
|
||||
#include "alignment_panel.h"
|
||||
|
@ -32,4 +32,5 @@ jdsample.c jdcolor.c jquant1.c jquant2.c jdmerge.c
|
||||
)
|
||||
|
||||
ADD_LIBRARY(fltk_jpeg ${systemdependent_SRCS} ${common_SRCS} ${compression_SRCS} ${decompression_SRCS})
|
||||
INSTALL_TARGETS(/lib fltk_jpeg)
|
||||
|
||||
|
@ -19,6 +19,8 @@ SET(PNG_SRCS
|
||||
)
|
||||
|
||||
ADD_LIBRARY(fltk_png ${PNG_SRCS})
|
||||
INSTALL_TARGETS(/lib fltk_png)
|
||||
|
||||
|
||||
IF(UNIX)
|
||||
TARGET_LINK_LIBRARIES(fltk_png ${FLTK_ZLIB_LIBRARIES} -lm)
|
||||
|
@ -161,6 +161,7 @@ SET(CFILES
|
||||
)
|
||||
|
||||
ADD_LIBRARY(fltk ${CPPFILES} ${CFILES})
|
||||
INSTALL_TARGETS(/lib fltk)
|
||||
SET_TARGET_PROPERTIES(fltk
|
||||
PROPERTIES
|
||||
VERSION ${FLTK_VERSION_MAJOR}.${FLTK_VERSION_MINOR}
|
||||
@ -174,6 +175,7 @@ ENDIF(X11_FOUND)
|
||||
|
||||
IF(OPENGL_FOUND)
|
||||
ADD_LIBRARY(fltk_gl ${GLCPPFILES})
|
||||
INSTALL_TARGETS(/lib fltk_gl)
|
||||
TARGET_LINK_LIBRARIES(fltk_gl fltk ${OPENGL_LIBRARIES})
|
||||
SET_TARGET_PROPERTIES(fltk_gl
|
||||
PROPERTIES
|
||||
@ -182,6 +184,7 @@ IF(OPENGL_FOUND)
|
||||
ENDIF(OPENGL_FOUND)
|
||||
|
||||
ADD_LIBRARY(fltk_forms ${FLCPPFILES})
|
||||
INSTALL_TARGETS(/lib fltk_forms)
|
||||
TARGET_LINK_LIBRARIES(fltk_forms fltk)
|
||||
SET_TARGET_PROPERTIES(fltk_forms
|
||||
PROPERTIES
|
||||
@ -189,21 +192,11 @@ SET_TARGET_PROPERTIES(fltk_forms
|
||||
SOVERSION ${FLTK_VERSION_PATCH})
|
||||
|
||||
ADD_LIBRARY(fltk_images ${IMGCPPFILES})
|
||||
TARGET_LINK_LIBRARIES(fltk_images fltk)
|
||||
INSTALL_TARGETS(/lib fltk_images)
|
||||
TARGET_LINK_LIBRARIES(fltk_images fltk ${FLTK_PNG_LIBRARIES}
|
||||
${FLTK_JPEG_LIBRARIES} ${FLTK_ZLIB_LIBRARIES})
|
||||
SET_TARGET_PROPERTIES(fltk_images
|
||||
PROPERTIES
|
||||
VERSION ${FLTK_VERSION_MAJOR}.${FLTK_VERSION_MINOR}
|
||||
SOVERSION ${FLTK_VERSION_PATCH})
|
||||
|
||||
IF(HAVE_LIBPNG)
|
||||
TARGET_LINK_LIBRARIES(fltk_images ${PNG_LIBRARIES})
|
||||
ENDIF(HAVE_LIBPNG)
|
||||
|
||||
IF(HAVE_LIBJPEG)
|
||||
TARGET_LINK_LIBRARIES(fltk_images ${JPEG_LIBRARIES})
|
||||
ENDIF(HAVE_LIBJPEG)
|
||||
|
||||
INSTALL_TARGETS(/lib fltk)
|
||||
INSTALL_TARGETS(/lib fltk_gl)
|
||||
INSTALL_TARGETS(/lib fltk_forms)
|
||||
INSTALL_TARGETS(/lib fltk_images)
|
||||
|
@ -11,4 +11,5 @@ inflate.c inftrees.c trees.c uncompr.c zutil.c
|
||||
)
|
||||
|
||||
ADD_LIBRARY(fltk_zlib ${ZLIB_SRCS})
|
||||
INSTALL_TARGETS(/lib fltk_zlib)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user