Add refactored CMake example

This commit is contained in:
Petr Hrdina
2025-07-15 07:41:45 +02:00
commit f35345ab0a
13 changed files with 163 additions and 0 deletions

8
app/CMakeLists.txt Normal file
View File

@ -0,0 +1,8 @@
set(MY_EXE "app")
add_executable(${MY_EXE} "src/main.cpp")
target_link_libraries(${MY_EXE} "moduleA" "moduleB" "moduleC")
# no need to include directories, because they are included automatically
# thanks to exposing the directories using PUBLIC

10
app/src/main.cpp Normal file
View File

@ -0,0 +1,10 @@
#include "moduleA/ClassA.h"
#include "moduleB/ClassB.h"
#include "moduleC/ClassC.h"
int main(int argc, char *argv[])
{
ClassA::hello();
ClassB::hello();
ClassC::hello();
}