CMake: Prevent annoying warning under Cygwin.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10368 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Albrecht Schlosser 2014-10-09 16:03:56 +00:00
parent 3e4af3cd8c
commit 078df04bfd
3 changed files with 46 additions and 19 deletions

View File

@ -4,7 +4,7 @@
# macros.cmake defines macros used by the build system # macros.cmake defines macros used by the build system
# Written by Michael Surette # Written by Michael Surette
# #
# Copyright 1998-2010 by Bill Spitzak and others. # Copyright 1998-2014 by Bill Spitzak and others.
# #
# This library is free software. Distribution and use rights are outlined in # 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 # the file "COPYING" which should have been included with this file. If this
@ -78,8 +78,17 @@ endmacro(FL_ADD_LIBRARY LIBNAME LIBTYPE LIBFILES)
####################################################################### #######################################################################
macro(CREATE_EXAMPLE NAME SOURCES LIBRARIES) macro(CREATE_EXAMPLE NAME SOURCES LIBRARIES)
set(srcs) set(srcs) # source files
set(flsrcs) set(flsrcs) # fluid source files
set(tname ${NAME}) # target name
set(oname ${NAME}) # output (executable) name
# rename reserved target name "help" (CMake 2.8.12 and later)
if(${tname} MATCHES "^help$")
set(tname "test_help")
endif(${tname} MATCHES "^help$")
foreach(src ${SOURCES}) foreach(src ${SOURCES})
if("${src}" MATCHES ".fl$") if("${src}" MATCHES ".fl$")
list(APPEND flsrcs ${src}) list(APPEND flsrcs ${src})
@ -90,24 +99,27 @@ macro(CREATE_EXAMPLE NAME SOURCES LIBRARIES)
if(flsrcs) if(flsrcs)
set(FLTK_WRAP_UI TRUE) set(FLTK_WRAP_UI TRUE)
fltk_wrap_ui(${NAME} ${flsrcs}) fltk_wrap_ui(${tname} ${flsrcs})
endif(flsrcs) endif(flsrcs)
add_executable(${NAME} WIN32 ${srcs} ${${NAME}_FLTK_UI_SRCS}) add_executable(${tname} WIN32 ${srcs} ${${tname}_FLTK_UI_SRCS})
set_target_properties(${tname}
PROPERTIES OUTPUT_NAME ${oname}
)
target_link_libraries(${NAME} ${LIBRARIES}) target_link_libraries(${tname} ${LIBRARIES})
# link in optional libraries # link in optional libraries
if(USE_XFT) if(USE_XFT)
target_link_libraries(${NAME} ${X11_Xft_LIB}) target_link_libraries(${tname} ${X11_Xft_LIB})
endif(USE_XFT) endif(USE_XFT)
if(HAVE_XINERAMA) if(HAVE_XINERAMA)
target_link_libraries(${NAME} ${X11_Xinerama_LIB}) target_link_libraries(${tname} ${X11_Xinerama_LIB})
endif(HAVE_XINERAMA) endif(HAVE_XINERAMA)
# install the example # install the example
install(TARGETS ${NAME} install(TARGETS ${tname}
DESTINATION ${FLTK_EXAMPLES_PATH} DESTINATION ${FLTK_EXAMPLES_PATH}
) )

View File

@ -4,7 +4,7 @@
# Main CMakeLists.txt to build the FLTK project using CMake (www.cmake.org) # Main CMakeLists.txt to build the FLTK project using CMake (www.cmake.org)
# Written by Michael Surette # Written by Michael Surette
# #
# Copyright 1998-2010 by Bill Spitzak and others. # Copyright 1998-2014 by Bill Spitzak and others.
# #
# This library is free software. Distribution and use rights are outlined in # 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 # the file "COPYING" which should have been included with this file. If this
@ -17,6 +17,10 @@
# http://www.fltk.org/str.php # http://www.fltk.org/str.php
# #
# Prevent annoying warning under Cygwin; this must be before project().
# Remove when CMake >= 2.8.4 is required
set(CMAKE_LEGACY_CYGWIN_WIN32 0)
project(FLTK) project(FLTK)
cmake_minimum_required(VERSION 2.6) cmake_minimum_required(VERSION 2.6)

View File

@ -3,6 +3,11 @@
# makesrcdist - make a distribution of FLTK. # makesrcdist - make a distribution of FLTK.
# #
TAR='tar'
SVN='http://seriss.com/public/fltk/fltk'
DOWNLOAD='http://fltk.org/pub/fltk'
SNAPSHOTS='http://fltk.org/pub/fltk/snapshots'
echo "Getting distribution..." echo "Getting distribution..."
if test $# = 0 -o "x$1" = xsnapshot; then if test $# = 0 -o "x$1" = xsnapshot; then
@ -10,8 +15,9 @@ if test $# = 0 -o "x$1" = xsnapshot; then
svn up svn up
rev=`svnversion . | sed -e '1,$s/[a-zA-Z]//g'` rev=`svnversion . | sed -e '1,$s/[a-zA-Z]//g'`
version="1.3svn" version="1.3svn"
fileversion="1.3svn-r$rev" fileversion="1.3.x-r$rev"
fileurl="ftp://ftp.easysw.com/pub/fltk/snapshots/fltk-$fileversion-source.tar.bz2" fileurl="$SNAPSHOTS/fltk-$fileversion.tar.gz"
# e.g. http://fltk.org/pub/fltk/snapshots/fltk-1.3.x-r10337.tar.gz
url="." url="."
else else
if test ! -e "documentation/html/"; then if test ! -e "documentation/html/"; then
@ -32,12 +38,17 @@ else
rev="1" rev="1"
version=$1 version=$1
fileversion=$1 fileversion=$1
fileurl="ftp://ftp.easysw.com/pub/fltk/$version/fltk-$fileversion-source.tar.bz2" fileurl="$DOWNLOAD/$version/fltk-$fileversion-source.tar.gz"
url="https://svn.easysw.com/public/fltk/fltk/tags/release-$version" # e.g. http://fltk.org/pub/fltk/1.3.2/fltk-1.3.2-source.tar.gz
svn copy https://svn.easysw.com/public/fltk/fltk/branches/branch-1.3 "$url" \ if test "x$2" = xtest; then
url="."
else
url="$SVN/tags/release-$version"
svn copy $SVN/branches/branch-1.3 "$url" \
-m "Tag $version" || exit 1 -m "Tag $version" || exit 1
fi fi
fi
echo Exporting $version... echo Exporting $version...
rm -rf /tmp/fltk-$version rm -rf /tmp/fltk-$version
@ -72,10 +83,10 @@ cd ..
if test $# != 0 -a "x$1" != xsnapshot; then if test $# != 0 -a "x$1" != xsnapshot; then
echo "Making HTML docs distribution..." echo "Making HTML docs distribution..."
gtar czf fltk-$fileversion-docs-html.tar.gz fltk-$version/documentation/html/ $TAR czf fltk-$fileversion-docs-html.tar.gz fltk-$version/documentation/html/
echo "Making PDF docs distribution..." echo "Making PDF docs distribution..."
gtar czf fltk-$fileversion-docs-pdf.tar.gz fltk-$version/documentation/fltk.pdf $TAR czf fltk-$fileversion-docs-pdf.tar.gz fltk-$version/documentation/fltk.pdf
fi fi
echo "Removing documentation..." echo "Removing documentation..."
@ -83,10 +94,10 @@ rm -rf fltk-$version/documentation/html/
rm -f fltk-$version/documentation/fltk.pdf rm -f fltk-$version/documentation/fltk.pdf
echo "Making UNIX distribution..." echo "Making UNIX distribution..."
gtar czf fltk-$fileversion-source.tar.gz fltk-$version $TAR czf fltk-$fileversion-source.tar.gz fltk-$version
#echo "Making BZ2 distribution..." #echo "Making BZ2 distribution..."
#gtar cjf fltk-$fileversion-source.tar.bz2 fltk-$version #$TAR cjf fltk-$fileversion-source.tar.bz2 fltk-$version
#echo "Making Windows distribution..." #echo "Making Windows distribution..."
#rm -f fltk-$fileversion-source.zip #rm -f fltk-$fileversion-source.zip