2022-06-04 06:13:55 +08:00
|
|
|
cmake_minimum_required(VERSION 3.14)
|
|
|
|
|
|
|
|
project(getopt-win32 C)
|
|
|
|
|
|
|
|
if(BUILD_SHARED_LIBS)
|
|
|
|
add_definitions(-DEXPORTS_GETOPT)
|
|
|
|
else()
|
|
|
|
add_definitions(-DSTATIC_GETOPT)
|
|
|
|
endif()
|
2022-12-10 07:30:15 +08:00
|
|
|
|
2022-06-04 06:13:55 +08:00
|
|
|
add_library(getopt getopt.c)
|
2022-12-10 07:30:15 +08:00
|
|
|
|
2022-12-29 05:07:26 +08:00
|
|
|
TARGET_INCLUDE_DIRECTORIES(getopt INTERFACE $<INSTALL_INTERFACE:include>)
|
|
|
|
|
2022-12-10 07:30:15 +08:00
|
|
|
install(
|
|
|
|
TARGETS getopt
|
|
|
|
EXPORT unofficial-getopt-win32
|
|
|
|
RUNTIME DESTINATION bin
|
|
|
|
LIBRARY DESTINATION lib
|
|
|
|
ARCHIVE DESTINATION lib
|
2022-12-21 01:21:39 +08:00
|
|
|
INCLUDES DESTINATION include
|
2022-12-10 07:30:15 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
install(
|
|
|
|
EXPORT unofficial-getopt-win32
|
|
|
|
NAMESPACE unofficial::getopt-win32::
|
|
|
|
DESTINATION share/unofficial-getopt-win32
|
|
|
|
FILE unofficial-getopt-win32-config.cmake
|
|
|
|
)
|