diff options
| -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; |
