I'm developing a simple library and in the past I've been using Premake. Now, I want to change that and use CMake. I've been struggling with 'porting' my workflow to CMake.
I want to have 2 projects, one for the library and one for the testing program. The library should not be dependent on the testing program but the testing program should include the library and be dependent on it. For example, if I change something in the library and compile my testing program, I want the library to recompile and then the testing program, so that it uses the latest library version.
I was able to do that in Premake but I just can't seem to figure it out yet in CMake. From my understanding, there should a top level CMake file and then the library should have one and the program should have one, just like I did in Premake.
Currently I only managed to create my library CMake file, but nothing else. A little help would be appreciated, especially as I'm noob in CMake.
My project structure looks like this
Root
├───Application
│ ├───Assets/
│ └───src/
│ └───Scenes/
├───Library
├───BUILD/
├───include/
└───src/
└───CMakeLists.txt