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

Update CMakeLists.txt #875

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Update CMakeLists.txt #875

wants to merge 5 commits into from

Conversation

billcxx
Copy link

@billcxx billcxx commented Oct 3, 2022

Use CMAKE_CURRENT_SOURCE_DIR when looking for tag, this will prevent potential problems if the project is grabbed by fetchContent in other project

Issue
Resolves #874

Approach
Should use CMAKE_CURRENT_SOURCE_DIR instead of CMAKE_SOURCE_DIR when looking for tags

Use CMAKE_CURRENT_SOURCE_DIR when looking for tag, this will prevent potential problems if the project is grabbed by fetchContent in other project
@ertomatic
Copy link
Collaborator

Can one of the admins verify this patch?

@lars-petter-hauge
Copy link
Contributor

Hi,

Thanks for the contribution and sorry for the very delayed response.

I suppose the discrepancy using CMAKE_SOURCE_DIR when building ecl as part of a different project will be relevant for all usages of CMAKE_SOURCE_DIR and not only when fetching tags.

Similar using CMAKE_BINARY_DIR vs CMAKE_CURRENT_BINARY_DIR will be affected.

Care to weigh in @pinkwah ?

@pinkwah
Copy link
Collaborator

pinkwah commented Jan 17, 2023

Jenkins test this please

@pinkwah pinkwah closed this Jan 17, 2023
@pinkwah pinkwah reopened this Jan 17, 2023
@pinkwah
Copy link
Collaborator

pinkwah commented Jan 17, 2023

Thanks for your contribution @billcxx!

It seems that the CMake code styling check failed. Would you mind running cmake-format -i CMakeLists.txt (after installing the pip package cmake-format) to satisfy it? I'll merge when that is done. :)

@billcxx
Copy link
Author

billcxx commented Jan 17, 2023

Hi,

Thanks for the contribution and sorry for the very delayed response.

I suppose the discrepancy using CMAKE_SOURCE_DIR when building ecl as part of a different project will be relevant for all usages of CMAKE_SOURCE_DIR and not only when fetching tags.

Similar using CMAKE_BINARY_DIR vs CMAKE_CURRENT_BINARY_DIR will be affected.

Care to weigh in @pinkwah ?

I changed all cmake_source_dir and cmake_binary_dir.
Tested with a simple

mkdir build; cd build
cmake ..
make

Then also format the CMakeLists.txt with cmake-format.

Thanks for your contribution @billcxx!

It seems that the CMake code styling check failed. Would you mind running cmake-format -i CMakeLists.txt (after installing the pip package cmake-format) to satisfy it? I'll merge when that is done. :)

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.

Cannot build the project with cmake fetchContent
4 participants