diff --git a/CMakeLists.txt b/CMakeLists.txt index 3bf7757..3515ca6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,12 @@ cmake_minimum_required(VERSION 3.03) project(tcpip VERSION 0.1) +# If the target already exists in a project (e.g. if tcpip is included multiple time as a submodule of submodules), +# this "header guard"-style check prevents defining the same target multiple times (which will lead to CMake errors). +if(TARGET tcpip) + return() +endif() + add_compile_options( -Wall -Wformat=2