#For WIN32 project (getopt) cmake_minimum_required(VERSION 3.1) add_library (getopt STATIC src/getopt.c src/getopt.h ) target_include_directories (getopt PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src) target_compile_definitions(getopt PRIVATE _CRT_SECURE_NO_WARNINGS) install (TARGETS getopt EXPORT getopt-config ARCHIVE DESTINATION lib INCLUDES DESTINATION include) install (FILES src/getopt.h DESTINATION include) install (EXPORT getopt-config DESTINATION cmake)