diff --git a/conans/client/build/cmake.py b/conans/client/build/cmake.py
index 8237a716b..1703d4345 100644
--- a/conans/client/build/cmake.py
+++ b/conans/client/build/cmake.py
@@ -117,9 +117,8 @@ class CMake(object):
 
         if not self._compiler or not self._compiler_version or not self._arch:
             if self._os_build == "Windows":
-                raise ConanException("You must specify compiler, compiler.version and arch in "
-                                     "your settings to use a CMake generator. You can also declare "
-                                     "the env variable CONAN_CMAKE_GENERATOR.")
+                # Not enough settings to set a generator in Windows
+                return None
             return "Unix Makefiles"
 
         if self._compiler == "Visual Studio":
@@ -243,11 +242,10 @@ class CMake(object):
 
     @property
     def command_line(self):
-        args = [
-            '-G "%s"' % self.generator,
-            self.flags,
-            '-Wno-dev'
-        ]
+        args = ['-G "%s"' % self.generator] if self.generator else []
+        args.append(self.flags)
+        args.append('-Wno-dev')
+
         if self.toolset:
             args.append('-T "%s"' % self.toolset)
         return join_arguments(args)
@@ -422,7 +420,7 @@ class CMake(object):
         if target is not None:
             args = ["--target", target] + args
 
-        if self.parallel:
+        if self.generator and self.parallel:
             if "Makefiles" in self.generator and "NMake" not in self.generator:
                 if "--" not in args:
                     args.append("--")

CMake helper requires compiler during package
To help us debug your issue please explain:

Hi everyone!

I'm trying give some support to taocpp/PEGTL and I would like to use CMake helper to install the project. The project is header-only, thus it installs the license, headers and pegtl-config.cmake.

However, when the package method runs over Windows, I receive the follow message:

    conans.errors.ConanExceptionInUserConanfileMethod: pegtl/2.5.2@taocpp/testing: Error in package() method, line 22
	cmake = CMake(self)
	ConanException: You must specify compiler, compiler.version and arch in your settings to use a CMake generator. You can also declare the env variable CONAN_CMAKE_GENERATOR.

When I run the same recipe on Linux (Travis CI), I have no problems.

Appveyor error log: https://ci.appveyor.com/project/uilianries/pegtl/build/feature/conan-9/job/tnwvkd69gvkgsb6x#L250

The current PR uses just self.copy, but my intention is revert to follow state, using CMake:

https://github.com/uilianries/PEGTL/blob/dc4011991624faedf67fd390e8f53737f562a897/conanfile.py

Current PR for PEGTL: https://github.com/taocpp/PEGTL/pull/112

I'm curious if CONAN_CMAKE_GENERATOR is required by Conan or is just a CMake limitation.

Conan Version: 1.4.3

- [X] I've read the [CONTRIBUTING guide](https://raw.githubusercontent.com/conan-io/conan/develop/.github/CONTRIBUTING.md).
- [X] I've specified the Conan version, operating system version and any tool that can be relevant.
- [X] I've explained the steps to reproduce the error or the motivation/use case of the question/suggestion.


diff --git a/conans/test/build_helpers/cmake_test.py b/conans/test/build_helpers/cmake_test.py
index 09aab1631..4b5d400a9 100644
--- a/conans/test/build_helpers/cmake_test.py
+++ b/conans/test/build_helpers/cmake_test.py
@@ -820,9 +820,8 @@ build_type: [ Release]
         cmake = instance_with_os_build("Macos")
         self.assertEquals(cmake.generator, "Unix Makefiles")
 
-        with self.assertRaisesRegexp(ConanException, "You must specify compiler, "
-                                                     "compiler.version and arch"):
-            instance_with_os_build("Windows")
+        cmake = instance_with_os_build("Windows")
+        self.assertEquals(cmake.generator, None)
 
         with tools.environment_append({"CONAN_CMAKE_GENERATOR": "MyCoolGenerator"}):
             cmake = instance_with_os_build("Windows")
diff --git a/conans/test/integration/cmake_flags_test.py b/conans/test/integration/cmake_flags_test.py
index 89d3308b1..56988dc54 100644
--- a/conans/test/integration/cmake_flags_test.py
+++ b/conans/test/integration/cmake_flags_test.py
@@ -254,13 +254,7 @@ class MyLib(ConanFile):
             client = TestClient()
             client.save({"conanfile.py": conanfile % settings_line})
             client.run("install .")
-            error = client.run("build .", ignore_error=True)
-            if platform.system() == "Windows":
-                self.assertTrue(error)
-                self.assertIn("You must specify compiler, compiler.version and arch in "
-                              "your settings to use a CMake generator", client.user_io.out,)
-            else:
-                self.assertFalse(error)
+            client.run("build .")
 
     def cmake_shared_flag_test(self):
         conanfile = """
diff --git a/conans/test/integration/cmake_install_package_test.py b/conans/test/integration/cmake_install_package_test.py
index ecd2304f9..f7c222c2b 100644
--- a/conans/test/integration/cmake_install_package_test.py
+++ b/conans/test/integration/cmake_install_package_test.py
@@ -72,3 +72,14 @@ cmake_minimum_required(VERSION 2.8.12)
         client.run("create . user/channel")
         self.assertIn("Test/0.1@user/channel (test package): Content: my header h!!",
                       client.user_io.out)
+
+        # Test also recipe without settings
+        new_conanfile =\
+            conanfile.replace("settings = \"os\", \"compiler\", \"build_type\", \"arch\"", "")
+        self.assertNotIn("settings = \"os\", \"compiler\", \"build_type\", \"arch\"", new_conanfile)
+        client.save({"conanfile.py": new_conanfile})
+
+        client.run("remove * --force")
+        client.run("create . user/channel")
+        self.assertIn("Test/0.1@user/channel (test package): Content: my header h!!",
+                      client.user_io.out)

pip install -e .[dev]
parse_log_pytest
requirements.txt
nose nose-cov pytest
apt-get update apt-get install -y gcc g++-multilib
3.6
conans/requirements.txt conans/requirements_server.txt conans/requirements_dev.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
astroid==1.6.6
attrs==22.2.0
beautifulsoup4==4.12.3
bottle==0.12.25
certifi==2021.5.30
charset-normalizer==2.0.12
codecov==2.1.13
colorama==0.3.9
-e git+https://github.com/conan-io/conan.git@f94602138045e0d9dc9de4dd5a4ca213ce051525#egg=conan
cov-core==1.15.0
coverage==4.2
deprecation==2.0.7
distro==1.1.0
fasteners==0.19
future==0.16.0
idna==3.10
importlib-metadata==4.8.3
iniconfig==1.1.1
isort==5.10.1
lazy-object-proxy==1.7.1
mccabe==0.7.0
mock==1.3.0
node-semver==0.2.0
nose==1.3.7
nose-cov==1.6
packaging==21.3
parameterized==0.8.1
patch==1.16
pbr==6.1.1
pluggy==1.0.0
pluginbase==0.7
py==1.11.0
Pygments==2.14.0
PyJWT==1.7.1
pylint==1.8.4
pyparsing==3.1.4
pytest==7.0.1
PyYAML==3.12
requests==2.27.1
six==1.17.0
soupsieve==2.3.2.post1
tomli==1.2.3
typing_extensions==4.1.1
urllib3==1.26.20
waitress==2.0.0
WebOb==1.8.9
WebTest==2.0.35
wrapt==1.16.0
zipp==3.6.0

name: conan
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - astroid==1.6.6
      - attrs==22.2.0
      - beautifulsoup4==4.12.3
      - bottle==0.12.25
      - charset-normalizer==2.0.12
      - codecov==2.1.13
      - colorama==0.3.9
      - cov-core==1.15.0
      - coverage==4.2
      - deprecation==2.0.7
      - distro==1.1.0
      - fasteners==0.19
      - future==0.16.0
      - idna==3.10
      - importlib-metadata==4.8.3
      - iniconfig==1.1.1
      - isort==5.10.1
      - lazy-object-proxy==1.7.1
      - mccabe==0.7.0
      - mock==1.3.0
      - node-semver==0.2.0
      - nose==1.3.7
      - nose-cov==1.6
      - packaging==21.3
      - parameterized==0.8.1
      - patch==1.16
      - pbr==6.1.1
      - pluggy==1.0.0
      - pluginbase==0.7
      - py==1.11.0
      - pygments==2.14.0
      - pyjwt==1.7.1
      - pylint==1.8.4
      - pyparsing==3.1.4
      - pytest==7.0.1
      - pyyaml==3.12
      - requests==2.27.1
      - six==1.17.0
      - soupsieve==2.3.2.post1
      - tomli==1.2.3
      - typing-extensions==4.1.1
      - urllib3==1.26.20
      - waitress==2.0.0
      - webob==1.8.9
      - webtest==2.0.35
      - wrapt==1.16.0
      - zipp==3.6.0
prefix: /opt/conda/envs/conan

conans/test/build_helpers/cmake_test.py::CMakeTest::test_missing_settings
conans/test/build_helpers/cmake_test.py::CMakeTest::test_clean_sh_path conans/test/build_helpers/cmake_test.py::CMakeTest::test_cmake_system_version_android conans/test/build_helpers/cmake_test.py::CMakeTest::test_cores_ancient_visual conans/test/build_helpers/cmake_test.py::CMakeTest::test_deprecated_behaviour conans/test/build_helpers/cmake_test.py::CMakeTest::test_pkg_config_path conans/test/build_helpers/cmake_test.py::CMakeTest::test_run_tests conans/test/build_helpers/cmake_test.py::CMakeTest::test_shared conans/test/build_helpers/cmake_test.py::CMakeTest::test_sysroot conans/test/build_helpers/cmake_test.py::CMakeTest::test_verbose
conans/client/build/cmake.py
conans/client/build/cmake.py