# #getopt() # #Part of libc on Linux, but implemented here on WIN32. #The following implements getopt() in a WIN32 static library. #Use as follows: # #include (as usual) # #In the cmake script: # #find_package (getopt CONFIG) #if (TARGET getopt) #target_link_libraries (xxx getopt) #endif # if (WIN32) ExternalProject_Add ( getopt PREFIX ${CMAKE_INSTALL_PREFIX} URL https://github.com/alex85k/wingetopt/archive/v0.95.zip URL_MD5 ed2009498f0902c146e814b2eb91479c PATCH_COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_LIST_DIR}/patch . CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH= -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} ) else () #getopt() is available on any *NIX operating system by default. #Implement a dummy getopt external project so that the OSD getopt module is #valid on *NIX, too. The effect of using it is different, though. #No getopt library will be available, instead it is in the standard library. ExternalProject_Add ( getopt PREFIX ${CMAKE_INSTALL_PREFIX} BUILD_IN_SOURCE 1 DOWNLOAD_COMMAND "" UPDATE_COMMAND "" CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND "" ) endif (WIN32)