Repository: conan-io/conan

Issue:
[bug] CMakeDeps in v1.37 does not generate files
### Environment Details (include every applicable attribute)
  * Operating System+version: Win10 (and observed in macOS Catalina)
  * Compiler+version: n/a
  * Conan version: 1.35.2 (works) 1.37.0 (does not work)
  * Python version: python 3.92 or 3.95

### Steps to reproduce (Include if Applicable)

Use Conan recipe from gist:
https://gist.github.com/SeanSnyders/c55f461be8addd8d9642c306dbf6ccb7

It is a simple recipe specifying 4 generators 
```
generators = "CMakeDeps", "cmake_paths", "cmake_find_package", "virtualenv"
```
and sources from the Conan HelloWorld example `https://github.com/conan-io/hello.git`.

To show it worked before, use the `conanfile.py` from the gist and on the command line and use **Conan v1.35.2**:
```
conan install . -s build_type=Debug -if=cmake-build-debug_v1352
```

Then upgrade to **Conan v1.37.0** and show it failing to generate the required files, do the same:

```
conan install . -s build_type=Debug -if=cmake-build-debug_v1370
```

### Logs (Executed commands with output) (Include/Attach if Applicable)

#### Conan v1.35.2
Run using Conan v1.35.2 which **works** and generates the typical cmake files the generator should. See image of folder after this run:

![image](https://user-images.githubusercontent.com/1384135/120561715-2a8dc680-c459-11eb-9cc7-bbe8021d65e7.png)

```
>conan install . -s build_type=Debug -if=cmake-build-debug1
Configuration:
[settings]
arch=x86_64
arch_build=x86_64
build_type=Debug
compiler=Visual Studio
compiler.runtime=MDd
compiler.version=16
os=Windows
os_build=Windows
[options]
[build_requires]
[env]

conanfile.py (ConanCMakeDepsGenerator/0.1.0): Generators in TestRecipe.build_requirements(): ('CMakeDeps', 'cmake_paths', 'cmake_find_package', 'virtualenv')
conanfile.py (ConanCMakeDepsGenerator/0.1.0): Installing package
Requirements
Packages
Build requirements
    cmake/3.19.4 from 'conan-center' - Cache
Build requirements packages
    cmake/3.19.4:01edd76db8e16db9b38c3cca44ec466a9444c388 - Cache

Installing (downloading, building) binaries...
cmake/3.19.4: Already installed!
cmake/3.19.4: Appending PATH environment variable: C:\Users\ssnyder\.conan\data\cmake\3.19.4\_\_\package\01edd76db8e16db9b38c3cca44ec466a9444c388\bin
conanfile.py (ConanCMakeDepsGenerator/0.1.0): Applying build-requirement: cmake/3.19.4
conanfile.py (ConanCMakeDepsGenerator/0.1.0): Generator cmake_find_package created Findcmake.cmake
conanfile.py (ConanCMakeDepsGenerator/0.1.0): Generator 'CMakeDeps' calling 'generate()'
conanfile.py (ConanCMakeDepsGenerator/0.1.0): Generator virtualenv created activate.bat
conanfile.py (ConanCMakeDepsGenerator/0.1.0): Generator virtualenv created deactivate.bat
conanfile.py (ConanCMakeDepsGenerator/0.1.0): Generator virtualenv created environment.bat.env
conanfile.py (ConanCMakeDepsGenerator/0.1.0): Generator virtualenv created activate.ps1
conanfile.py (ConanCMakeDepsGenerator/0.1.0): Generator virtualenv created deactivate.ps1
conanfile.py (ConanCMakeDepsGenerator/0.1.0): Generator virtualenv created environment.ps1.env
conanfile.py (ConanCMakeDepsGenerator/0.1.0): Generator virtualenv created activate.sh
conanfile.py (ConanCMakeDepsGenerator/0.1.0): Generator virtualenv created deactivate.sh
conanfile.py (ConanCMakeDepsGenerator/0.1.0): Generator virtualenv created environment.sh.env
conanfile.py (ConanCMakeDepsGenerator/0.1.0): Generator txt created conanbuildinfo.txt
conanfile.py (ConanCMakeDepsGenerator/0.1.0): Generator cmake_paths created conan_paths.cmake
conanfile.py (ConanCMakeDepsGenerator/0.1.0): Calling generate()
conanfile.py (ConanCMakeDepsGenerator/0.1.0): Generated conaninfo.txt
conanfile.py (ConanCMakeDepsGenerator/0.1.0): Generated graphinfo
```

#### Conan v1.37.0
Run using Conan v1.37.0 which seems to **not work** and does not generate the typical cmake files the generator should. See image of folder after this run:

![image](https://user-images.githubusercontent.com/1384135/120562321-48a7f680-c45a-11eb-9939-e391ce250a5d.png)

```
conan install . -s build_type=Debug -if=cmake-build-debug_v137
Configuration:
[settings]
arch=x86_64
arch_build=x86_64
build_type=Debug
compiler=Visual Studio
compiler.runtime=MDd
compiler.version=16
os=Windows
os_build=Windows
[options]
[build_requires]
[env]

conanfile.py (ConanCMakeDepsGenerator/0.1.0): Generators in TestRecipe.build_requirements(): ('CMakeDeps', 'cmake_paths', 'cmake_find_package', 'virtualenv')
conanfile.py (ConanCMakeDepsGenerator/0.1.0): Installing package
Requirements
Packages
Build requirements
    cmake/3.19.4 from 'conan-center' - Cache
Build requirements packages
    cmake/3.19.4:01edd76db8e16db9b38c3cca44ec466a9444c388 - Cache

Installing (downloading, building) binaries...
cmake/3.19.4: Already installed!
cmake/3.19.4: Appending PATH environment variable: C:\Users\ssnyder\.conan\data\cmake\3.19.4\_\_\package\01edd76db8e16db9b38c3cca44ec466a9444c388\bin
conanfile.py (ConanCMakeDepsGenerator/0.1.0): Applying build-requirement: cmake/3.19.4
conanfile.py (ConanCMakeDepsGenerator/0.1.0): Generator txt created conanbuildinfo.txt
conanfile.py (ConanCMakeDepsGenerator/0.1.0): Generator 'CMakeDeps' calling 'generate()'
conanfile.py (ConanCMakeDepsGenerator/0.1.0): Generator virtualenv created activate.bat
conanfile.py (ConanCMakeDepsGenerator/0.1.0): Generator virtualenv created deactivate.bat
conanfile.py (ConanCMakeDepsGenerator/0.1.0): Generator virtualenv created environment.bat.env
conanfile.py (ConanCMakeDepsGenerator/0.1.0): Generator virtualenv created activate.ps1
conanfile.py (ConanCMakeDepsGenerator/0.1.0): Generator virtualenv created deactivate.ps1
conanfile.py (ConanCMakeDepsGenerator/0.1.0): Generator virtualenv created environment.ps1.env
conanfile.py (ConanCMakeDepsGenerator/0.1.0): Generator virtualenv created activate.sh
conanfile.py (ConanCMakeDepsGenerator/0.1.0): Generator virtualenv created deactivate.sh
conanfile.py (ConanCMakeDepsGenerator/0.1.0): Generator virtualenv created environment.sh.env
conanfile.py (ConanCMakeDepsGenerator/0.1.0): Generator cmake_paths created conan_paths.cmake
conanfile.py (ConanCMakeDepsGenerator/0.1.0): Generator cmake_find_package created Findcmake.cmake
conanfile.py (ConanCMakeDepsGenerator/0.1.0): Calling generate()
conanfile.py (ConanCMakeDepsGenerator/0.1.0): Generated conaninfo.txt
conanfile.py (ConanCMakeDepsGenerator/0.1.0): Generated graphinfo
```





Discussion:
Checking. At first, looks like an issue with the output path as I see the cmake files generated in the root of the project. Thanks so much for the easy example, it really helps 🤟. Will report asap and open a bugfix for a 1.37.1

Resolving patch:
diff --git a/conans/model/conan_file.py b/conans/model/conan_file.py
--- a/conans/model/conan_file.py
+++ b/conans/model/conan_file.py
@@ -272,15 +272,18 @@ def package_folder(self, folder):
 
     @property
     def install_folder(self):
+        # FIXME: Remove in 2.0, no self.install_folder
         return self.folders.base_install
 
     @install_folder.setter
     def install_folder(self, folder):
+        # FIXME: Remove in 2.0, no self.install_folder
         self.folders.set_base_install(folder)
 
     @property
     def generators_folder(self):
-        return self.folders.generators_folder
+        # FIXME: Remove in 2.0, no self.install_folder
+        return self.folders.generators_folder if self.folders.generators else self.install_folder
 
     @property
     def imports_folder(self):


Test patch:
diff --git a/conans/test/functional/layout/test_local_commands.py b/conans/test/functional/layout/test_local_commands.py
--- a/conans/test/functional/layout/test_local_commands.py
+++ b/conans/test/functional/layout/test_local_commands.py
@@ -87,8 +87,7 @@ def layout(self):
 
 def test_no_layout_generators_folder():
     """If we don't configure a generators folder in the layout, the generator files:
-      - all go to the install_folder, EXCEPT the new ones, that NEEDS the generator folder
-        or go to the BASE folder
+      - all go to the install_folder
     """
     client = TestClient()
     conan_file = str(GenConanfile().with_settings("build_type").
@@ -109,11 +108,11 @@ def generate(self):
     assert os.path.exists(conaninfo)
     assert os.path.exists(conanbuildinfo)
     assert os.path.exists(cmake_generator_path)
-    # Not in the install_folder
-    assert not os.path.exists(cmake_toolchain_generator_path)
+    # In the install_folder
+    assert os.path.exists(cmake_toolchain_generator_path)
 
-    # But in the base folder
-    assert os.path.exists(os.path.join(client.current_folder, "conan_toolchain.cmake"))
+    # But not in the base folder
+    assert not os.path.exists(os.path.join(client.current_folder, "conan_toolchain.cmake"))
 
 
 def test_local_build():