Author Topic: $(PROJECT_DIR) won't change when open a new workspace.  (Read 5113 times)

Offline huzhongshan

  • Multiple posting newcomer
  • *
  • Posts: 109
$(PROJECT_DIR) won't change when open a new workspace.
« on: February 17, 2012, 03:18:43 am »
First I open a project(.cbp) in default workspace, and compile and debug( such things)...
then I close the project , and open a workspace (.workspace) ,  and compile ,  In post build step , I use $(PROJECT_DIR) , and the $(PROJECT_DIR) is still the first project directory( the first one I opened .cbp).

I click the different project in workspace , the $(PROJECT_DIR) cannot change the value to current active project .

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5211
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: $(PROJECT_DIR) won't change when open a new workspace.
« Reply #1 on: February 17, 2012, 03:54:21 am »
I click the different project in workspace , the $(PROJECT_DIR) cannot change the value to current active project .
So, you try to active a different project in workspace by "click"?
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline huzhongshan

  • Multiple posting newcomer
  • *
  • Posts: 109
Re: $(PROJECT_DIR) won't change when open a new workspace.
« Reply #2 on: February 17, 2012, 04:22:52 am »
I click the different project in workspace , the $(PROJECT_DIR) cannot change the value to current active project .
So, you try to active a different project in workspace by "click"?
yeah , I clicked different project in workspace , many times , $(PROJECT_DIR) is still in last season(but not always).

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5211
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: $(PROJECT_DIR) won't change when open a new workspace.
« Reply #3 on: February 17, 2012, 04:57:02 am »
I click the different project in workspace , the $(PROJECT_DIR) cannot change the value to current active project .
So, you try to active a different project in workspace by "click"?
yeah , I clicked different project in workspace , many times , $(PROJECT_DIR) is still in last season(but not always).
I think: You should right click on the project name, and select "activate" in the context menu to activate the new project. otherwise, project doesn't switch.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline huzhongshan

  • Multiple posting newcomer
  • *
  • Posts: 109
Re: $(PROJECT_DIR) won't change when open a new workspace.
« Reply #4 on: February 17, 2012, 05:14:29 am »
en , It works!

Offline LETARTARE

  • Regular
  • ***
  • Posts: 363
  • L'ami de l'homme.The friend of man.
Re: $(PROJECT_DIR) won't change when open a new workspace.
« Reply #5 on: February 17, 2012, 08:46:40 am »
I had the same problem, but I thought it was from my program!
It is not at all intuitive
A big thank you also
C::B  : svn11562, wxwidgets2.8,  plugins : QtPregen-2.4.2
1-Vista Business Pack 2 32bits :  TDM-GCC 4.9.2, 
2-OpenSuse-42.3-Leap 64bits :  g++-4.8.5,
=> !! The messages are translated by GOOGLE !!