Understanding the CMake `COMPONENT` keyword in the `install` command

Thanks, it works now. (And is much simpler and clear)

see nomnoms/CMakeLists.txt at develop · ClausKlein/nomnoms · GitHub

I am sorry to say, but your version is still not complete:

CMake Error at CMakeLists.txt:5 (find_package):
  Could not find a configuration file for package "noms" that is compatible
  with requested version "1".

  The following configuration files were considered but not accepted:

    /Users/clausklein/Workspace/cpp/nomnoms/noms/stage/lib/cmake/noms/noms-config.cmake, version: unknown

-- Configuring incomplete, errors occurred!
Claus-iMac:noms clausklein$ git diff
diff --git a/munch/CMakeLists.txt b/munch/CMakeLists.txt
index 5c4a23b..e7e28b4 100644
--- a/munch/CMakeLists.txt
+++ b/munch/CMakeLists.txt
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.0)
 
 project(munch)
 
-find_package(noms REQUIRED CONFIG COMPONENTS veg fruit)
+find_package(noms 1 REQUIRED CONFIG COMPONENTS veg fruit)
 
 add_executable(${PROJECT_NAME})
 target_sources(${PROJECT_NAME} PRIVATE src/main.cpp)
Claus-iMac:noms clausklein$ tree stage/
stage/
├── include
│   └── noms
│       ├── fruit
│       │   └── apple.h
│       └── veg
│           └── asparagus.h
└── lib
    ├── cmake
    │   └── noms
    │       ├── noms-config.cmake
    │       ├── noms-fruit-config-debug.cmake
    │       ├── noms-fruit-config.cmake
    │       ├── noms-veg-config-debug.cmake
    │       └── noms-veg-config.cmake
    ├── libfruit.a
    └── libveg.a

7 directories, 9 files
Claus-iMac:noms clausklein$