Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small changes to thisREST.cmake / thisREST.sh #308

Merged
merged 5 commits into from
Sep 29, 2022
Merged

Conversation

lobis
Copy link
Member

@lobis lobis commented Sep 29, 2022

lobis Ok: 17

Just some small changes.

  • Use $REST_PATH when available
  • Do not include Garfield in $ROOT_INCLUDE_PATH (ill formatted) if Garfield is not installed.

@jgalan jgalan requested a review from a team September 29, 2022 07:46
@lobis lobis marked this pull request as ready for review September 29, 2022 07:55
fi

export REST_SOURCE=${CMAKE_CURRENT_SOURCE_DIR}
export REST_PATH=\\\${thisdir}
export ROOT_INCLUDE_PATH=\\\${thisdir}/include:${Garfield_INSTALL}/include:\\\$ROOT_INCLUDE_PATH
export ROOT_INCLUDE_PATH=\\\$REST_PATH/include${Garfield_INCLUDE_ENV}:\\\$ROOT_INCLUDE_PATH
Copy link
Member

@juanangp juanangp Sep 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
export ROOT_INCLUDE_PATH=\\\$REST_PATH/include${Garfield_INCLUDE_ENV}:\\\$ROOT_INCLUDE_PATH
export ROOT_INCLUDE_PATH=\\\$REST_PATH/include:\\\$ROOT_INCLUDE_PATH
export ROOT_INCLUDE_PATH=\\\${Garfield_INCLUDE_ENV}:\\\$ROOT_INCLUDE_PATH

Copy link
Member Author

@lobis lobis Sep 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we add a : then when Garfield is not installed it will be two ::. The variable itself has the :. (this suggestion should not be commited).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is strange that the Path contains already the :

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, ok, there is a problem to have :: inside?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, ok, there is a problem to have :: inside?

no, but why do we want double :: when we can just put a single :?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But currently we have export ROOT_INCLUDE_PATH=\\\$REST_PATH/include${Garfield_INCLUDE_ENV}:\\\$ROOT_INCLUDE_PATH

As far as I understand this is not a valid path

Besides, I found misleading to add these paths to inside ROOT_INCLUDE_PATH

why is this not a valid path? it works when Garfield is instaleld or not.

If garfield is installed it expands to:

export ROOT_INCLUDE_PATH=$REST_PATH/include:/usr/local/garfieldpp/install/include:$ROOT_INCLUDE_PATH

If its not:

export ROOT_INCLUDE_PATH=$REST_PATH/include:$ROOT_INCLUDE_PATH

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, I oversee this path set(Garfield_INCLUDE_ENV ":$ENV{GARFIELD_INSTALL}/include")

For me is misleading to add : inside Garfield_INCLUDE_ENV

I believe should be someting that:
set(Garfield_INCLUDE_ENV "$ENV{GARFIELD_INSTALL}/include")

export REST_INCLUDE_PATH=\\\$REST_PATH/include
export REST_INCLUDE_PATH=\\\$ROOT_INCLUDE_PATH:\\\$ REST_INCLUDE_PATH
export REST_INCLUDE_PATH=\\\$Garfield_INCLUDE_ENV:\\\$ REST_INCLUDE_PATH

Copy link
Member

@jgalan jgalan Sep 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but here is a bit different, because sometimes we do not want to add the PATH, to do it the way you mention we should add an if condition somewhere.

Copy link
Member Author

@lobis lobis Sep 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, I oversee this path set(Garfield_INCLUDE_ENV ":$ENV{GARFIELD_INSTALL}/include")

For me is misleading to add : inside Garfield_INCLUDE_ENV

I believe should be someting that: set(Garfield_INCLUDE_ENV "$ENV{GARFIELD_INSTALL}/include")

export REST_INCLUDE_PATH=\\\$REST_PATH/include
export REST_INCLUDE_PATH=\\\$ROOT_INCLUDE_PATH:\\\$ REST_INCLUDE_PATH
export REST_INCLUDE_PATH=\\\$Garfield_INCLUDE_ENV:\\\$ REST_INCLUDE_PATH

Then we will have double : on the final thisREST.sh when it could have been avoided by including the : in the env variable. I prefer my solution since it produces the cleanest result at the expense of a misleading : in a cmake variable that nobody will access anyway, but I don't really care tbh. What do you think @jgalan ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anyhow I think it can be approved without major issue as it is

@lobis lobis self-assigned this Sep 29, 2022
@jgalan jgalan requested a review from nkx111 September 29, 2022 10:26
@lobis lobis requested a review from Oscar-PL September 29, 2022 12:34
@lobis lobis merged commit 46f0620 into master Sep 29, 2022
@lobis lobis deleted the lobis-cmake-garfield branch September 29, 2022 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants