Skip to content
 
 

Repository files navigation

🌸 CppDrive

Structure

.
├── CMakeLists.txt
├── app
│   └── main.cpp  # Application source code.    
├── include
│   ├── example.h # Library header file.
├── src
    └── example.cpp # Library source code.

Sources go in src/, header files in include/, main programs in app/.

If you add a new executable, say app/hello.cpp, you only need to add the following two lines to CMakeLists.txt:

add_executable(main app/main.cpp)   # Name of exec. and location of file.
target_link_libraries(main PRIVATE ${LIBRARY_NAME})  # Link the executable to lib built from src/*.cpp (if it uses it).

Building

Build by making a build directory (i.e. build/), run cmake in that dir, and then use make to build the desired target.

Example:

mkdir build && cd build
cmake ..
make
./main

Setup

Dependencies

  • CMake
  • C++ Compiler: g++, clang or msvc

In ubuntu:

sudo apt-get install build-essential cmake

Visual Studio Code

Install the following extensions:

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages