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

View File

@ -0,0 +1,7 @@
set(MY_LIB "moduleB")
add_library(${MY_LIB} STATIC "src/ClassB.cpp")
target_include_directories(${MY_LIB} PRIVATE "include/moduleB")
target_include_directories(${MY_LIB} PUBLIC "include")

View File

@ -0,0 +1,9 @@
#ifndef CLASS_B_
#define CLASS_B_
class ClassB {
public:
static void hello();
};
#endif

View File

@ -0,0 +1,4 @@
#include "ClassB.h"
#include <iostream>
void ClassB::hello() { std::cout << "Hello from B" << std::endl; }