diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2016-01-30 21:00:12 +0000 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2016-01-30 21:00:12 +0000 |
| commit | 6cc67c18f24d76ce890e16fb9e55217b8665680b (patch) | |
| tree | 0fd959ea48b098d3013e8d7b455f9ebe8e5b00f2 | |
| parent | e9395133e38691efc3f7d2c6b4fbff6d02ad29f1 (diff) | |
Reflect changes in new Windows IDE (Debug Mode).
Windows executables in Debug mode don't have the trailing 'd'
they used to have with the old (bundled) IDE files.
The removal of 'd' (e.g. from askd.exe) was removed.
Also prepared test/CMakeLists.txt for a better installation
path of test files (copied from the source directory).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11090 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
| -rw-r--r-- | test/CMakeLists.txt | 17 | ||||
| -rw-r--r-- | test/demo.cxx | 22 |
2 files changed, 32 insertions, 7 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 82d67e27b..0e0150a6a 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -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) diff --git a/test/demo.cxx b/test/demo.cxx index ca898a2ab..743acd966 100644 --- a/test/demo.cxx +++ b/test/demo.cxx @@ -44,6 +44,24 @@ #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. Previous versions of Visual Studio + added a 'd' to the executable file name ('demod.exe') in Debug + configurations that needed to be removed. + This is no longer true with CMake-generated IDE's since FLTK 1.4. + The 'old' behavior obviously applied or still applies to + CodeWarrior (__MWERKS__). + *FIXME* is this still true and necessary? +*/ + +// #if ( defined _MSC_VER || defined __MWERKS__ ) && defined _DEBUG + +#if defined(WIN32) && 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 +268,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 +430,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; |
