summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMake/macros.cmake30
-rw-r--r--CMakeLists.txt6
-rwxr-xr-xmakesrcdist31
3 files changed, 47 insertions, 20 deletions
diff --git a/CMake/macros.cmake b/CMake/macros.cmake
index caa295eec..a7d3c7a34 100644
--- a/CMake/macros.cmake
+++ b/CMake/macros.cmake
@@ -4,7 +4,7 @@
# macros.cmake defines macros used by the build system
# 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
# 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)
- set(srcs)
- set(flsrcs)
+ set(srcs) # source files
+ 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})
if("${src}" MATCHES ".fl$")
list(APPEND flsrcs ${src})
@@ -90,24 +99,27 @@ macro(CREATE_EXAMPLE NAME SOURCES LIBRARIES)
if(flsrcs)
set(FLTK_WRAP_UI TRUE)
- fltk_wrap_ui(${NAME} ${flsrcs})
+ fltk_wrap_ui(${tname} ${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
if(USE_XFT)
- target_link_libraries(${NAME} ${X11_Xft_LIB})
+ target_link_libraries(${tname} ${X11_Xft_LIB})
endif(USE_XFT)
if(HAVE_XINERAMA)
- target_link_libraries(${NAME} ${X11_Xinerama_LIB})
+ target_link_libraries(${tname} ${X11_Xinerama_LIB})
endif(HAVE_XINERAMA)
# install the example
- install(TARGETS ${NAME}
+ install(TARGETS ${tname}
DESTINATION ${FLTK_EXAMPLES_PATH}
)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9a919fe1a..71bd61a0c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,7 +4,7 @@
# Main CMakeLists.txt to build the FLTK project using CMake (www.cmake.org)
# 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
# the file "COPYING" which should have been included with this file. If this
@@ -17,6 +17,10 @@
# 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)
cmake_minimum_required(VERSION 2.6)
diff --git a/makesrcdist b/makesrcdist
index 1665ecc8b..1a8ed06db 100755
--- a/makesrcdist
+++ b/makesrcdist
@@ -3,6 +3,11 @@
# 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..."
if test $# = 0 -o "x$1" = xsnapshot; then
@@ -10,8 +15,9 @@ if test $# = 0 -o "x$1" = xsnapshot; then
svn up
rev=`svnversion . | sed -e '1,$s/[a-zA-Z]//g'`
version="1.3svn"
- fileversion="1.3svn-r$rev"
- fileurl="ftp://ftp.easysw.com/pub/fltk/snapshots/fltk-$fileversion-source.tar.bz2"
+ fileversion="1.3.x-r$rev"
+ fileurl="$SNAPSHOTS/fltk-$fileversion.tar.gz"
+# e.g. http://fltk.org/pub/fltk/snapshots/fltk-1.3.x-r10337.tar.gz
url="."
else
if test ! -e "documentation/html/"; then
@@ -32,11 +38,16 @@ else
rev="1"
version=$1
fileversion=$1
- fileurl="ftp://ftp.easysw.com/pub/fltk/$version/fltk-$fileversion-source.tar.bz2"
- url="https://svn.easysw.com/public/fltk/fltk/tags/release-$version"
-
- svn copy https://svn.easysw.com/public/fltk/fltk/branches/branch-1.3 "$url" \
+ fileurl="$DOWNLOAD/$version/fltk-$fileversion-source.tar.gz"
+# e.g. http://fltk.org/pub/fltk/1.3.2/fltk-1.3.2-source.tar.gz
+
+ 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
+ fi
fi
echo Exporting $version...
@@ -72,10 +83,10 @@ cd ..
if test $# != 0 -a "x$1" != xsnapshot; then
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..."
- 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
echo "Removing documentation..."
@@ -83,10 +94,10 @@ rm -rf fltk-$version/documentation/html/
rm -f fltk-$version/documentation/fltk.pdf
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..."
-#gtar cjf fltk-$fileversion-source.tar.bz2 fltk-$version
+#$TAR cjf fltk-$fileversion-source.tar.bz2 fltk-$version
#echo "Making Windows distribution..."
#rm -f fltk-$fileversion-source.zip