Skip to content

Commit

Permalink
Rename test/help demo program to test/help_dialog.
Browse files Browse the repository at this point in the history
This change avoids a name conflict with CMake's auto-generated target 'help'
for "Unix Makefiles", "Ninja", and supposedly other generators as well.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12171 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
  • Loading branch information
Albrecht Schlosser committed Feb 8, 2017
1 parent 759d2f1 commit 16774dd
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
/test/gl_overlay
/test/glpuzzle
/test/hello
/test/help
/test/help_dialog
/test/icon
/test/iconize
/test/image
Expand Down
2 changes: 2 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ Changes in FLTK 1.4.0 Released: ??? ?? 2017
Other Improvements

- (add new items here)
- Renamed test/help demo program to test/help_dialog to avoid name
conflict with CMake auto-generated target 'help'.
- Many documentation fixes, clarifications, and enhancements.


Expand Down
5 changes: 0 additions & 5 deletions CMake/macros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,6 @@ macro(CREATE_EXAMPLE NAME SOURCES LIBRARIES)
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})
Expand Down
8 changes: 4 additions & 4 deletions documentation/src/examples.dox
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ you build FLTK, unlike those in the 'test' directory shown below.
</tr>
<tr>
<td> \ref examples_hello </td>
<td> \ref examples_help </td>
<td> \ref examples_help_dialog </td>
<td> \ref examples_iconize </td>
<td> \ref examples_image </td>
<td> \ref examples_inactive </td>
Expand Down Expand Up @@ -326,13 +326,13 @@ easily under FLTK.
tiny demo shows how little is needed to get a functioning application
running with FLTK. Quite impressive, I'd say.

\subsection examples_help help
\subsection examples_help_dialog help_dialog

\par
\c help displays the built-in FLTK help browser. The
\c help_dialog displays the built-in FLTK help browser. The
Fl_Help_Dialog understands a subset of html and renders
various image formats. This widget makes it easy to provide help
pages to the user without depending on the operating system's
pages to the user without depending on the operating system's
html browser.

\subsection examples_iconize iconize
Expand Down
27 changes: 23 additions & 4 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
#
# "$Id$"
#
# CMakeLists.txt used to build test and demo apps by the CMake build system
#
# Copyright 2004-2017 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
# file is missing or damaged, see the license at:
#
# http://www.fltk.org/COPYING.php
#
# Please report all bugs and problems on the following page:
#
# http://www.fltk.org/str.php
#
#######################################################################

set(EXECUTABLE_OUTPUT_PATH ${FLTK_BINARY_DIR}/bin/examples)

#######################################################################
Expand Down Expand Up @@ -45,7 +64,7 @@ CREATE_EXAMPLE(file_chooser file_chooser.cxx "fltk;fltk_images")
CREATE_EXAMPLE(fonts fonts.cxx fltk)
CREATE_EXAMPLE(forms forms.cxx "fltk;fltk_forms")
CREATE_EXAMPLE(hello hello.cxx fltk)
CREATE_EXAMPLE(help help.cxx "fltk;fltk_images")
CREATE_EXAMPLE(help_dialog help_dialog.cxx "fltk;fltk_images")
CREATE_EXAMPLE(icon icon.cxx fltk)
CREATE_EXAMPLE(iconize iconize.cxx fltk)
CREATE_EXAMPLE(image image.cxx fltk)
Expand Down Expand Up @@ -112,7 +131,7 @@ endif(FLTK_HAVE_CAIRO)
# Note: this is incomplete as of 11 Feb 2015
# Todo: currently all files are copied, but some of them need configuration:
# - demo.menu: fluid can't be started (wrong path)
# - demo.menu: help (help-test.html) can't find its images (not copied)
# - demo.menu: help_dialog (help_dialog.html) can't find its images (not copied)
# - maybe more ...

# prepare for a "better" test file installation path
Expand All @@ -127,12 +146,12 @@ configure_file(demo.menu ${TESTFILE_PATH}/demo.menu COPYONLY)

# use target directory only to avoid redundancy
configure_file(rgb.txt ${TESTFILE_PATH} COPYONLY)
configure_file(help-test.html ${TESTFILE_PATH} COPYONLY)
configure_file(help_dialog.html ${TESTFILE_PATH} COPYONLY)
configure_file(browser.cxx ${TESTFILE_PATH} COPYONLY)
configure_file(editor.cxx ${TESTFILE_PATH} COPYONLY)
if(APPLE AND NOT OPTION_APPLE_X11)
configure_file(demo.menu "${TESTFILE_PATH}/demo.app/Contents/Resources/demo.menu" COPYONLY)
configure_file(browser.cxx "${TESTFILE_PATH}/browser.app/Contents/Resources/browser.cxx" COPYONLY)
configure_file(rgb.txt ${TESTFILE_PATH}/colbrowser.app/Contents/Resources/rgb.txt COPYONLY)
configure_file(help-test.html ${TESTFILE_PATH}/help.app/Contents/Resources/help-test.html COPYONLY)
configure_file(help_dialog.html ${TESTFILE_PATH}/help_dialog.app/Contents/Resources/help_dialog.html COPYONLY)
endif(APPLE AND NOT OPTION_APPLE_X11)
14 changes: 7 additions & 7 deletions test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# Test/example program makefile for the Fast Light Tool Kit (FLTK).
#
# Copyright 1998-2010 by Bill Spitzak and others.
# Copyright 1998-2017 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
Expand Down Expand Up @@ -53,7 +53,7 @@ CPPFILES =\
gl_overlay.cxx \
glpuzzle.cxx \
hello.cxx \
help.cxx \
help_dialog.cxx \
icon.cxx \
iconize.cxx \
image.cxx \
Expand Down Expand Up @@ -126,7 +126,7 @@ ALL = \
fonts$(EXEEXT) \
forms$(EXEEXT) \
hello$(EXEEXT) \
help$(EXEEXT) \
help_dialog$(EXEEXT) \
icon$(EXEEXT) \
iconize$(EXEEXT) \
image$(EXEEXT) \
Expand Down Expand Up @@ -368,12 +368,12 @@ forms$(EXEEXT): forms.o

hello$(EXEEXT): hello.o

help$(EXEEXT): help.o $(IMGLIBNAME)
help_dialog$(EXEEXT): help_dialog.o $(IMGLIBNAME)
echo Linking $@...
$(CXX) $(ARCHFLAGS) $(CXXFLAGS) $(LDFLAGS) help.o -o $@ $(LINKFLTKIMG) $(LDLIBS)
$(CXX) $(ARCHFLAGS) $(CXXFLAGS) $(LDFLAGS) help_dialog.o -o $@ $(LINKFLTKIMG) $(LDLIBS)
$(OSX_ONLY) ../fltk-config --post $@
$(OSX_ONLY) mkdir -p help.app/Contents/Resources
$(OSX_ONLY) cp -f help-test.html help.app/Contents/Resources/
$(OSX_ONLY) mkdir -p help_dialog.app/Contents/Resources
$(OSX_ONLY) cp -f help_dialog.html help_dialog.app/Contents/Resources/

icon$(EXEEXT): icon.o

Expand Down
2 changes: 1 addition & 1 deletion test/demo.menu
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
@o:Font Tests...:@of
@of:Fonts:fonts
@of:UTF-8:utf8
@o:HelpDialog:help
@o:HelpDialog:help_dialog
@o:Input Choice:input_choice
@o:Preferences:preferences
@o:Threading:threads
Expand Down
5 changes: 3 additions & 2 deletions test/help.cxx → test/help_dialog.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// Fl_Help_Dialog test program.
//
// Copyright 1999-2010 by Easy Software Products.
// Copyright 2011-2017 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
Expand Down Expand Up @@ -44,7 +45,7 @@ main(int argc, // I - Number of command-line arguments
strcpy(htmlname, argv[0]);
char *slash = strrchr(htmlname, '/');
if (slash)
strcpy(slash, "/../Resources/help-test.html");
strcpy(slash, "/../Resources/help_dialog.html");
FILE *in = fl_fopen(htmlname, "r");
if (in) {
fclose(in);
Expand All @@ -54,7 +55,7 @@ main(int argc, // I - Number of command-line arguments
#endif

if (argc <= 1)
help->load("help-test.html");
help->load("help_dialog.html");
else
help->load(argv[1]);

Expand Down
File renamed without changes.

0 comments on commit 16774dd

Please sign in to comment.