Add refactored CMake example
This commit is contained in:
8
app/CMakeLists.txt
Normal file
8
app/CMakeLists.txt
Normal 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
10
app/src/main.cpp
Normal 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();
|
||||
}
|
||||
Reference in New Issue
Block a user