RUNINPLACE

3 views
Skip to first unread message

jonas thomas

unread,
Jun 14, 2009, 10:15:52 AM6/14/09
to HeeksCAD - Developers Mailing List
I'm a bit confused by the RUNINPLACE option and was hoping for some
help.

When you run sudo make install in ubuntu. Heekscad installs the
executable in the following directory.
/usr/local/bin/HeeksCAD
/usr/local/share/heekscad/bitmaps
/usr/local/share/heekscad/icons.

The source has folders bitmaps, icons in the main directory.
http://code.google.com/p/heekscad/source/browse/#svn/trunk

(About line 2243)
http://code.google.com/p/heekscad/source/diff?spec=svn486&r=467&format=side&path=/trunk/src/HeeksCAD.cpp&old_path=/trunk/src/HeeksCAD.cpp&old=461
or if you prefer:
src/HeeksCAD.cpp|2246|#ifdef WIN32 || defined(RUNINPLACE)|

{
#ifdef WIN32 || defined(RUNINPLACE)
return GetExeFolder();
#else
return (GetExeFolder() + _T("/../share/heekscad"));
#endif
}

I would like to create a code::blocks project file debugging in linux
for uploading and perhaps, eventually and eventually link /src/
makefile directly(once I understand C::B better) to keep code
maintenance to a minimum.

It appears that work has been done to on RUNINPLACE in the makefile,
but I don't understand the direction where this is heading:
http://code.google.com/p/heekscad/source/diff?spec=svn469&r=469&format=side&path=/trunk/src/Makefile

I added RUNINPLACE to my compiler options string in code::blocks

`wx-config --cxxflags`
-Wall -g -I "./" -I "/usr/include/opencascade" $(WXCFLAGS) -DUNICODE -
D__WXGTK__ -DHEEKSCAD -DHAVE_LIMITS -DWXUSINGDLL -DHAVE_LIMITS -
DTIXML_USE_STL -DRUNINPLACE

I'm assuming the intent -DRUNINPLACE is to have this happen...
Right???
HeeksCAD
/bitmaps
/icons

I'm trying to figured out is I code something hosed up my code::blocks
configuration or if it's something with this line of code in linux/gnu

{
#ifdef WIN32 || defined(RUNINPLACE)
return GetExeFolder();
#else
return (GetExeFolder() + _T("/../share/heekscad"));
#endif
}

I'm pretty sure I have RUNINPLACE correctly defined in C::B but I seem
to be skipping past this in when I run in DEBUG.
Is anyone else havng this happen?
















jonas thomas

unread,
Jun 14, 2009, 10:28:50 AM6/14/09
to HeeksCAD - Developers Mailing List
Ok....
This seems to work...

#ifdef WIN32
return GetExeFolder();
#else
#ifdef RUNINPLACE
return GetExeFolder();
#endif
return (GetExeFolder() + _T("/../share/heekscad"));
#endif


Can anyone see unintended consequences to this?... Or should I just
try my first upload and see what happens....




Mark

unread,
Jun 14, 2009, 12:43:56 PM6/14/09
to heeksca...@googlegroups.com
I did not test runinplace as thoroughly as I should have.  The changes I made were similar to what you did, though I think I wrote a single line something like

#if defined(WIN32) || defined(RUNINPLACE)

If you use 'grep -n RUNINPLACE src/*' you should see the lines I changed.

What you wrote should behave identically to what I did.

I intended to search through the code for all occurences of WIN32 before committing my change, thinking that all #ifdef WIN32's were path-related.  But (grumble grumble) I didn't.

Mark

jonas thomas

unread,
Jun 14, 2009, 12:51:53 PM6/14/09
to heeksca...@googlegroups.com
Hear's what I get.
jonas@Ubuntu4:~/Desktop/HeeksCAD$ grep -n RUNINPLACE src/*

src/HeeksCAD.cpp:2246:#ifdef WIN32 || defined(RUNINPLACE)
src/Makefile:12:ifeq ($(strip $(RUNINPLACE)),yes)
src/Makefile:13:  RIP=-DRUNINPLACE
jonas@Ubuntu4:~/Desktop/HeeksCAD$

I think I just figured out how to upload code to the repository...

I think what I changed s/b ok...
So I give my first upload a try??

jonas thomas

unread,
Jun 14, 2009, 1:09:25 PM6/14/09
to HeeksCAD - Developers Mailing List
Actually... I think I make a mistake...
S/B
#ifdef WIN32
return GetExeFolder();
// THIS was causing some issues #ifdef WIN32 || defined(RUNINPLACE)
#else
#ifdef RUNINPLACE
return GetExeFolder();
#else
return (GetExeFolder() + _T("/../share/heekscad"));
#endif
#endif




On Jun 14, 11:51 am, jonas thomas <jonasthomas...@gmail.com> wrote:
> Hear's what I get.
> jonas@Ubuntu4:~/Desktop/HeeksCAD$ grep -n RUNINPLACE src/*
> src/HeeksCAD.cpp:2246:#ifdef WIN32 || defined(RUNINPLACE)
> src/Makefile:12:ifeq ($(strip $(RUNINPLACE)),yes)
> src/Makefile:13:  RIP=-DRUNINPLACE
> jonas@Ubuntu4:~/Desktop/HeeksCAD$
>
> I think I just figured out how to upload code to the repository...
>
> I think what I changed s/b ok...
> So I give my first upload a try??
>
> On Sun, Jun 14, 2009 at 11:43 AM, Mark <mpic...@gmail.com> wrote:
> > I did not test runinplace as thoroughly as I should have.  The changes I
> > made were similar to what you did, though I think I wrote a single line
> > something like
>
> > #if defined(WIN32) || defined(RUNINPLACE)
>
> > If you use 'grep -n RUNINPLACE src/*' you should see the lines I changed.
>
> > What you wrote should behave identically to what I did.
>
> > I intended to search through the code for all occurences of WIN32 before
> > committing my change, thinking that all #ifdef WIN32's were path-related.
> > But (grumble grumble) I didn't.
>
> > Mark
>

Mark

unread,
Jun 14, 2009, 1:12:35 PM6/14/09
to heeksca...@googlegroups.com
I don't think that #ifdef ... || defined(...) will work. Apparently the change I made was in interface/ rather than in src/ .
$ grep -n RUNINPLACE interface/*
interface/ToolImage.cpp:13:#if defined(WIN32) || defined(RUNINPLACE) //compile with 'RUNINPLACE=yes make' then skip 'sudo make install'

I would compile and run before uploading, to make sure there aren't any showstoppers.

Mark

jonas thomas

unread,
Jun 14, 2009, 1:30:16 PM6/14/09
to heeksca...@googlegroups.com
I just got the project  using my custom code::block file, It seems to work OK, but I'm a little fuzzy if I want I want to RUNNINPLACE using the make file.

Do I need to add some kind of option from the command line?? or do I need to edit the makefile itself?

Mark

unread,
Jun 14, 2009, 2:28:41 PM6/14/09
to heeksca...@googlegroups.com
On the command line, you would do
RUNINPLACE=yes make
This sets the environment variable RUNINPLACE to yes and runs make.  I don't know how you'd go about it with C::B.  If all else fails, start C::B from the command line:
RUNINPLACE=yes CodeBlocks (or whatever the C::B executable is named)

HTH
Mark
Reply all
Reply to author
Forward
0 new messages