I am working on a library (you can see the files structure here).
I have packaged and zipped it, I get it from a remote server with FetchContent and everything is (almost) fine.
In the root CMakeLists.txt, I added an INTERFACE library, and use it as target in a call to target_compile_options() (by using also INTERFACE).
In the src/ directory, I define a static library, and I link it to the interface library. No problem either.
In its directory, I export a configuration so that this static library may be built and delivered as a ZIP file.
When I want to use the interface library in an other CMake project (after having used FethContent), I get an error message telling the .lib cannot be found (of course : this interface library only define compilation switches).
target_link_libraries(${PROJECT_NAME} PUBLIC CommonConfig)
But I am not sure how to retrieve it from the consumer.
After FetchContent_Declare(), FetchContent_MakeAvailable(), FetchContent_GetProperties() and find_package(), I can link to the binary library, but I am not sure how I am supposed to retrieve CommonConfig interface library from the library client.
not quite up to date
FILE_SETS, header only libs, cmake workflow preset
From what I can see 3 years later since that blog post was published, none of the essentials became “not up to date” in there. But I can certainly agree that being a blog post it does not replace the entire “Professional CMake” book
GitHub workflow (CI)
Did not know that this is required for everyone nowadays. So far we’ve been hosting our Git repositories with Gitea on internal network. I’ll ask around, could be that we are missing something.