1- cmake_minimum_required (VERSION 3.10)
2- project (getopt)
3-
4- set (TARGET getopt)
5- set (PUBLIC_HDR_DIR include )
6-
7- # ==================================================================================================
8- # Sources and headers
9- # ==================================================================================================
10- set (PUBLIC_HDRS include /getopt/getopt.h)
11- set (PRIVATE_HDRS include /getopt/getopt.h)
12-
13- set (SRCS
14- src/getopt.c
15- src/getopt_long.c)
16-
17- # ==================================================================================================
18- # Include and target definitions
19- # ==================================================================================================
20- include_directories (${PUBLIC_HDR_DIR} )
21-
22- add_library (${TARGET} STATIC ${PRIVATE_HDRS} ${PUBLIC_HDRS} ${SRCS} )
23- target_include_directories (${TARGET} PUBLIC ${PUBLIC_HDR_DIR} )
24- set_target_properties (${TARGET} PROPERTIES FOLDER ThirdParty)
1+ cmake_minimum_required (VERSION 3.10)
2+ project (getopt)
3+
4+ set (TARGET getopt)
5+ set (PUBLIC_HDR_DIR include )
6+
7+ # ==================================================================================================
8+ # Sources and headers
9+ # ==================================================================================================
10+ set (PUBLIC_HDRS include /getopt/getopt.h)
11+ set (PRIVATE_HDRS include /getopt/getopt.h)
12+
13+ set (SRCS
14+ src/getopt.c
15+ src/getopt_long.c)
16+
17+ # ==================================================================================================
18+ # Include and target definitions
19+ # ==================================================================================================
20+ include_directories (${PUBLIC_HDR_DIR} )
21+
22+ add_library (${TARGET} STATIC ${PRIVATE_HDRS} ${PUBLIC_HDRS} ${SRCS} )
23+ target_include_directories (${TARGET} PUBLIC ${PUBLIC_HDR_DIR} )
24+ set_target_properties (${TARGET} PROPERTIES FOLDER ThirdParty)
25+
26+ # ==================================================================================================
27+ # Installation
28+ # ==================================================================================================
29+ install (TARGETS ${TARGET} ARCHIVE DESTINATION lib/${DIST_DIR} )
30+ install (DIRECTORY ${PUBLIC_HDR_DIR} /getopt DESTINATION include )
0 commit comments