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

Change default cmake_layout() source folder #9596

Merged
merged 1 commit into from Sep 14, 2021

Conversation

tapia
Copy link
Contributor

@tapia tapia commented Sep 13, 2021

Changelog: Feature: Change default cmake_layout() source folder from 'src' to '.'
Docs: conan-io/docs#2225

Closes #9549

@@ -216,12 +216,12 @@ def get_cmake_lib_files(name, version, package_name="Pkg"):
package_name=package_name),
"src/{}.cpp".format(name): source_cpp.format(name=name, version=version),
"src/{}.h".format(name): source_h.format(name=name, version=version),
"src/CMakeLists.txt": cmake_v2.format(name=name, version=version),
"CMakeLists.txt": cmake_v2.format(name=name, version=version),
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we want to follow CMake common pattern that is the top root uses a add_subdirectory(src) and keep a CMakeLists.txt inside "src" with the heavy logic.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wouldn't having two CMakeLists.txt be too verbose? I mean, what would go into the root file, besides the add_subdirectory() call?

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 verbose because it is a hello-world simple example. But it would probably be the most common layout out there in CMake projects. It will contain the project(), cmake_minimum_required() and the add_subdirectory()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks completely unnecessary to me, but if it's the consensus, who am I to disagree 😄 What do you think, @lasote ?

Copy link
Contributor

Choose a reason for hiding this comment

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

I dont want to see two CMakeLists.txt in a hello world, please.

@memsharded memsharded added this to the 1.40.1 milestone Sep 13, 2021
@memsharded
Copy link
Member

Please, target the PR to release/1.40 branch @tapia

@tapia tapia changed the base branch from develop to release/1.40 September 13, 2021 11:50
@lasote lasote merged commit 3dbc4ea into conan-io:release/1.40 Sep 14, 2021
@tapia tapia deleted the layout_source_folder branch September 14, 2021 10:38
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.

Default cmake_layout() source folder
3 participants