Porting back changes of branch-1.3-porting.

The old behavior is retained, but the files have been modified
to match the new versions in the porting branch as much as possible.

The porting branch has its own (modified) version. Windows executables
built with the new IDE's (generated by CMake) don't have the trailing 'd'
in Debug mode.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@11091 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Albrecht Schlosser 2016-01-30 21:11:16 +00:00
parent 1139af35af
commit 2fbffa98fa
2 changed files with 30 additions and 7 deletions

View File

@ -109,11 +109,18 @@ endif(FLTK_HAVE_CAIRO)
# - demo.menu: help (help-test.html) can't find its images (not copied)
# - maybe more ...
# prepare for a "better" test file installation path
set (TESTFILE_PATH ${EXECUTABLE_OUTPUT_PATH})
# *FIXME* *DEBUG*
# message ("test/CMakeLists.txt: EXECUTABLE_OUTPUT_PATH = '${EXECUTABLE_OUTPUT_PATH}'")
# message ("test/CMakeLists.txt: TESTFILE_PATH = '${TESTFILE_PATH}'")
# use a target filename to make sure the target directory gets created
configure_file(demo.menu ${EXECUTABLE_OUTPUT_PATH}/demo.menu COPYONLY)
configure_file(demo.menu ${TESTFILE_PATH}/demo.menu COPYONLY)
# use target directory only to avoid redundancy
configure_file(rgb.txt ${EXECUTABLE_OUTPUT_PATH} COPYONLY)
configure_file(help-test.html ${EXECUTABLE_OUTPUT_PATH} COPYONLY)
configure_file(browser.cxx ${EXECUTABLE_OUTPUT_PATH} COPYONLY)
configure_file(editor.cxx ${EXECUTABLE_OUTPUT_PATH} COPYONLY)
configure_file(rgb.txt ${TESTFILE_PATH} COPYONLY)
configure_file(help-test.html ${TESTFILE_PATH} COPYONLY)
configure_file(browser.cxx ${TESTFILE_PATH} COPYONLY)
configure_file(editor.cxx ${TESTFILE_PATH} COPYONLY)

View File

@ -44,6 +44,22 @@
#include <FL/filename.H>
#include <FL/x.H>
/* Define a macro to decide if a trailing 'd' needs to be removed
from the executable file name. Current versions of Visual Studio
bundled IDE solutions add a 'd' to the executable file name
('demod.exe') in Debug configurations that needs to be removed.
This is no longer true with CMake-generated IDE's starting with
FLTK 1.4, but in FLTK 1.3 the OLD behavior is still used.
The 'old' behavior obviously applied or still applies to
CodeWarrior (__MWERKS__).
*/
#if ( defined _MSC_VER || defined __MWERKS__ ) && defined _DEBUG
# define DEBUG_EXE_WITH_D 1
#else
# define DEBUG_EXE_WITH_D 0
#endif
/* The form description */
void doexit(Fl_Widget *, void *);
@ -250,7 +266,7 @@ void dobut(Fl_Widget *, long arg)
char* command = new char[icommand_length+6]; // 6 for extra 'd.exe\0'
if (start_parameters==NULL) { // no parameters required.
# ifdef _DEBUG
# if DEBUG_EXE_WITH_D
sprintf(command, "%sd.exe", start_command);
# else
sprintf(command, "%s.exe", start_command);
@ -412,7 +428,7 @@ int main(int argc, char **argv) {
putenv((char *)"FLTK_DOCDIR=../documentation/html");
char buf[FL_PATH_MAX];
strcpy(buf, argv[0]);
#if ( defined _MSC_VER || defined __MWERKS__ ) && defined _DEBUG
#if DEBUG_EXE_WITH_D
// MS_VisualC appends a 'd' to debugging executables. remove it.
fl_filename_setext( buf, "" );
buf[ strlen(buf)-1 ] = 0;