mirror of https://github.com/fltk/fltk
CMake support: added platform test for HAVE_SCANDIR_POSIX,
added $Id$ tags and added copyright to (some of the) CMake files. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7012 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
parent
ff861ae5c0
commit
1c6e95b545
|
@ -1,3 +1,30 @@
|
|||
#
|
||||
# "$Id$"
|
||||
#
|
||||
# CMake support file to build the FLTK project using CMake (www.cmake.org)
|
||||
#
|
||||
# Copyright 1998-2010 by Bill Spitzak and others.
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Library General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Library General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Library General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
# USA.
|
||||
#
|
||||
# Please report all bugs and problems on the following page:
|
||||
#
|
||||
# http:#www.fltk.org/str.php
|
||||
#
|
||||
|
||||
IF(NOT FLTK11_FOUND)
|
||||
MESSAGE(FATAL_ERROR "Something went wrong. You are including FLTKUse.cmake but FLTK was not found")
|
||||
ENDIF(NOT FLTK11_FOUND)
|
||||
|
@ -66,3 +93,6 @@ SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${FLTK_REQUIRED_EXE_LINKER
|
|||
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${FLTK_REQUIRED_SHARED_LINKER_FLAGS}")
|
||||
SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${FLTK_REQUIRED_MODULE_LINKER_FLAGS}")
|
||||
|
||||
#
|
||||
# End of "$Id$".
|
||||
#
|
||||
|
|
|
@ -1,81 +1,140 @@
|
|||
//
|
||||
// "$Id$"
|
||||
//
|
||||
// CMake platform tests for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
// Copyright 1998-2010 by Bill Spitzak and others.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Library General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// version 2 of the License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Library General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Library General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
// USA.
|
||||
//
|
||||
// Please report all bugs and problems on the following page:
|
||||
//
|
||||
// http://www.fltk.org/str.php
|
||||
//
|
||||
|
||||
//
|
||||
// The platform tests in this file are invoked by the CMake macro
|
||||
// PERFORM_CMAKE_TEST in CMakeLists.txt (or maybe other files).
|
||||
//
|
||||
// Each platform test in this file must begin and end with
|
||||
// #ifdef FOO
|
||||
// ...
|
||||
// #endif
|
||||
// where FOO is the compiler macro to be tested/defined in config.h.
|
||||
//
|
||||
// It must contain a main() function and return 0 if the test succeeded.
|
||||
//
|
||||
|
||||
#ifdef HAVE_LIBZ
|
||||
|
||||
#include <zlib.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
unsigned long compressedSize = 0;
|
||||
unsigned char cd[100];
|
||||
const unsigned char ud[100] = "";
|
||||
unsigned long uncompressedSize = 0;
|
||||
int main() {
|
||||
unsigned long compressedSize = 0;
|
||||
unsigned char cd[100];
|
||||
const unsigned char ud[100] = "";
|
||||
unsigned long uncompressedSize = 0;
|
||||
|
||||
// Call zlib's compress function.
|
||||
if(compress(cd, &compressedSize, ud, uncompressedSize) != Z_OK)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
// Call zlib's compress function.
|
||||
if (compress(cd, &compressedSize, ud, uncompressedSize) != Z_OK) {
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAVE_LIBJPEG
|
||||
|
||||
#include <stdio.h>
|
||||
#include <jpeglib.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
struct jpeg_decompress_struct cinfo;
|
||||
jpeg_create_decompress(&cinfo);
|
||||
jpeg_read_header(&cinfo, TRUE);
|
||||
return 1;
|
||||
int main() {
|
||||
struct jpeg_decompress_struct cinfo;
|
||||
jpeg_create_decompress(&cinfo);
|
||||
jpeg_read_header(&cinfo, TRUE);
|
||||
return 1;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAVE_LIBPNG
|
||||
#include <png.h>
|
||||
int main()
|
||||
{
|
||||
png_structp png_ptr = png_create_read_struct
|
||||
(PNG_LIBPNG_VER_STRING, (png_voidp)NULL,
|
||||
NULL, NULL);
|
||||
png_infop info_ptr = png_create_info_struct(png_ptr);
|
||||
png_set_sig_bytes(png_ptr, 8);
|
||||
png_read_info(png_ptr, info_ptr);
|
||||
png_structp png_ptr = png_create_read_struct
|
||||
(PNG_LIBPNG_VER_STRING, (png_voidp)NULL,
|
||||
NULL, NULL);
|
||||
png_infop info_ptr = png_create_info_struct(png_ptr);
|
||||
png_set_sig_bytes(png_ptr, 8);
|
||||
png_read_info(png_ptr, info_ptr);
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
// This one is probably not used:
|
||||
#ifdef HAVE_PNG_H
|
||||
#include <png.h>
|
||||
int main() { retunr 0;}
|
||||
int main() { return 0;}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAVE_PNG_GET_VALID
|
||||
#include <png.h>
|
||||
int main()
|
||||
{
|
||||
png_structp png_ptr = png_create_read_struct
|
||||
(PNG_LIBPNG_VER_STRING, (png_voidp)NULL,
|
||||
NULL, NULL);
|
||||
png_infop info_ptr = png_create_info_struct(png_ptr);
|
||||
png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS);
|
||||
return 0;
|
||||
|
||||
int main() {
|
||||
png_structp png_ptr = png_create_read_struct
|
||||
(PNG_LIBPNG_VER_STRING, (png_voidp)NULL,
|
||||
NULL, NULL);
|
||||
png_infop info_ptr = png_create_info_struct(png_ptr);
|
||||
png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAVE_PNG_SET_TRNS_TO_ALPHA
|
||||
#include <png.h>
|
||||
int main()
|
||||
{
|
||||
png_structp png_ptr = png_create_read_struct
|
||||
(PNG_LIBPNG_VER_STRING, (png_voidp)NULL,
|
||||
NULL, NULL);
|
||||
png_set_tRNS_to_alpha(png_ptr);
|
||||
return 0;
|
||||
|
||||
int main() {
|
||||
png_structp png_ptr = png_create_read_struct
|
||||
(PNG_LIBPNG_VER_STRING, (png_voidp)NULL,
|
||||
NULL, NULL);
|
||||
png_set_tRNS_to_alpha(png_ptr);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAVE_SCANDIR_POSIX
|
||||
#include <dirent.h>
|
||||
|
||||
int func (const char *d, dirent ***list, void *sort) {
|
||||
int n = scandir(d, list, 0, (int(*)(const dirent **, const dirent **))sort);
|
||||
}
|
||||
|
||||
int main() {
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id$".
|
||||
//
|
||||
|
|
|
@ -1,5 +1,30 @@
|
|||
#
|
||||
# "$Id$"
|
||||
#
|
||||
# Main CMakeLists.txt to build the FLTK project using CMake (www.cmake.org)
|
||||
# Written by Andy Cedilnik and Julien Jomier
|
||||
#
|
||||
# Copyright 1998-2010 by Bill Spitzak and others.
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Library General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Library General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Library General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
# USA.
|
||||
#
|
||||
# Please report all bugs and problems on the following page:
|
||||
#
|
||||
# http:#www.fltk.org/str.php
|
||||
#
|
||||
|
||||
PROJECT(FLTK)
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.0)
|
||||
|
@ -247,6 +272,9 @@ ELSE(FLTK_USE_SYSTEM_PNG)
|
|||
INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/png")
|
||||
ENDIF(FLTK_USE_SYSTEM_PNG)
|
||||
|
||||
# Do we have the POSIX compatible scandir() prototype?
|
||||
PERFORM_CMAKE_TEST(CMake/PlatformTests.cxx HAVE_SCANDIR_POSIX)
|
||||
|
||||
SET(FLTK_DATADIR "${CMAKE_INSTALL_PREFIX}/share/FLTK")
|
||||
SET(FLTK_DOCDIR "${CMAKE_INSTALL_PREFIX}/share/doc/FLTK")
|
||||
|
||||
|
@ -410,3 +438,7 @@ INSTALL_FILES(/lib/FLTK-${FLTK_VERSION} FILES "${FLTK_SOURCE_DIR}/CMake/FLTKUse.
|
|||
INSTALL_FILES(/lib/FLTK-${FLTK_VERSION} FILES "${FLTK_BINARY_DIR}/FLTKBuildSettings.cmake")
|
||||
INSTALL_FILES(/lib/FLTK-${FLTK_VERSION} FILES "${FLTK_BINARY_DIR}/FLTKLibraryDepends.cmake")
|
||||
INSTALL_FILES(/lib/FLTK-${FLTK_VERSION} FILES "${FLTK_BINARY_DIR}/CMake/FLTKConfig.cmake")
|
||||
|
||||
#
|
||||
# End of "$Id$".
|
||||
#
|
||||
|
|
|
@ -162,7 +162,8 @@
|
|||
#cmakedefine U64 @U64@
|
||||
|
||||
/*
|
||||
* HAVE_DIRENT_H, HAVE_SYS_NDIR_H, HAVE_SYS_DIR_H, HAVE_NDIR_H, HAVE_SCANDIR:
|
||||
* HAVE_DIRENT_H, HAVE_SYS_NDIR_H, HAVE_SYS_DIR_H, HAVE_NDIR_H,
|
||||
* HAVE_SCANDIR, HAVE_SCANDIR_POSIX:
|
||||
*
|
||||
* Where is <dirent.h> (used only by fl_file_chooser and scandir).
|
||||
*/
|
||||
|
@ -172,6 +173,7 @@
|
|||
#cmakedefine HAVE_SYS_DIR_H @HAVE_SYS_DIR_H@
|
||||
#cmakedefine HAVE_NDIR_H @HAVE_NDIR_H@
|
||||
#cmakedefine HAVE_SCANDIR @HAVE_SCANDIR@
|
||||
#cmakedefine HAVE_SCANDIR_POSIX @HAVE_SCANDIR_POSIX@
|
||||
|
||||
/*
|
||||
* Possibly missing sprintf-style functions:
|
||||
|
|
Loading…
Reference in New Issue