Skip to content

Commit 97a504a

Browse files
davidsanfalczoido
andauthored
multicmake info added (#4250)
* multicmake info added * wip * Update reference/tools/cmake/cmake.rst Co-authored-by: Carlos Zoido <[email protected]> * Update reference/tools/cmake/cmake.rst Co-authored-by: Carlos Zoido <[email protected]> * Update reference/tools/cmake/cmake.rst Co-authored-by: Carlos Zoido <[email protected]> * Update reference/tools/cmake/cmake.rst Co-authored-by: Carlos Zoido <[email protected]> * Update reference/tools/cmake/cmake.rst Co-authored-by: Carlos Zoido <[email protected]> * wip --------- Co-authored-by: Carlos Zoido <[email protected]>
1 parent dc3d150 commit 97a504a

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

reference/tools/cmake/cmake.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,27 @@ when a package is being built directly by Conan (create, install)
3535
cmake.configure()
3636
cmake.build()
3737
38+
**Experimental** feature. ``CMake.configure()``, ``CMake.build()`` and ``CMake.install()`` methods have the **subfolder** parameter in case you have
39+
more than one ``CMakeLists.txt`` in different folders.
40+
This feature allows you to call the **configure** **build** and **install** method of each **CMakeLists.txt**
41+
separately and without mixing the generated files and artifacts, also creating these folders in the
42+
**build folder** and **package folder**.
3843

44+
In the following example, we can see what it would look like if we had two different **CMakeLists.txt**
45+
(**cmake_1/CMakeLists.txt** and **cmake_2/CMakeLists.txt**) in the **folder1** and **folder2** folders.
46+
47+
.. code-block:: python
48+
49+
def build(self):
50+
cmake = CMake(self)
51+
52+
# Configure and build source_folder/cmake_1/CMakeLists.txt in folder1
53+
cmake.configure(build_script_folder="cmake_1", subfolder="folder1")
54+
cmake.build(subfolder="folder1")
55+
56+
# Configure and build source_folder/cmake_2/CMakeLists.txt in folder2
57+
cmake.configure(build_script_folder="cmake_2" subfolder="folder2")
58+
cmake.build(subfolder="folder2")
3959
4060
Reference
4161
---------

0 commit comments

Comments
 (0)