Modernize and cleanup CMakeLists.txt
Created by: btolfa
- Set the minimum required version for CMake to 3.5
- Added
UPNPC_BUILD_SAMPLE
option for building sample client application (upnpc.c) - Added interface target library
miniupnpc-private
for common settings like compile definitions, flags and include directories. It helps to keep global scope clean. https://cmake.org/cmake/help/v3.11/manual/cmake-buildsystem.7.html#interface-libraries - Replaced
-fPIC
compile option withPOSITION_INDEPENDENT_CODE
target property https://cmake.org/cmake/help/v3.11/prop_tgt/POSITION_INDEPENDENT_CODE.html#prop_tgt:POSITION_INDEPENDENT_CODE - Set usage requirements for
libminiupnpc-*
targets for more convenient usage throughadd_subdirectory()
(as cmake subproject) https://cmake.org/cmake/help/v3.11/manual/cmake-buildsystem.7.html#build-specification-and-usage-requirements - Removed old and outdated code from CMakeLists.txt