@ -1,7 +1,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# T h i s f i l e i s p a r t o f t h e a r g t a b l e 3 l i b r a r y .
#
# Copyright ( C ) 2 0 1 6 - 2 0 1 9 T o m G . H u a n g
# Copyright ( C ) 2 0 1 6 - 2 0 2 1 T o m G . H u a n g
# < t o m g h u a n g @ g m a i l . c o m >
# A l l r i g h t s r e s e r v e d .
#
@ -58,7 +58,7 @@ endif()
add_definitions ( -D_XOPEN_SOURCE=700 )
if ( WIN32 )
if ( BUILD_SHARED_LIBS AND WIN32 )
set ( COMPANY_NAME "The Argtable3 Project" )
set ( FILE_DESC "ANSI C command-line parsing library" )
set ( INTERNAL_NAME "${PROJECT_NAME}" )
@ -69,19 +69,21 @@ if(WIN32)
" $ { P R O J E C T _ S O U R C E _ D I R } / s r c / v e r s i o n . r c . i n "
" $ { P R O J E C T _ B I N A R Y _ D I R } / s r c / v e r s i o n . r c "
)
add_library ( argtable3 SHARED ${ ARGTABLE3_SRC_FILES } "${PROJECT_BINARY_DIR}/src/version.rc" )
add_library ( argtable3 ${ ARGTABLE3_SRC_FILES } "${PROJECT_BINARY_DIR}/src/version.rc" )
target_compile_definitions ( argtable3 INTERFACE argtable3_IMPORTS )
else ( )
add_library ( argtable3 SHARED ${ ARGTABLE3_SRC_FILES } )
add_library ( argtable3 ${ ARGTABLE3_SRC_FILES } )
endif ( )
target_include_directories ( argtable3 PRIVATE ${ PROJECT_SOURCE_DIR } /src )
add_library ( argtable3_static STATIC ${ ARGTABLE3_SRC_FILES } )
target_include_directories ( argtable3_static PRIVATE ${ PROJECT_SOURCE_DIR } /src )
add_library ( ${ ARGTABLE3_PROJECT_NAME } ::argtable3 ALIAS argtable3 )
target_include_directories ( argtable3 PRIVATE ${ PROJECT_SOURCE_DIR } /src )
set_target_properties ( argtable3 argtable3_static PROPERTIES
set_target_properties ( argtable3 PROPERTIES
V E R S I O N $ { P R O J E C T _ V E R S I O N _ M A J O R } . $ { P R O J E C T _ V E R S I O N _ M I N O R } . $ { P R O J E C T _ V E R S I O N _ P A T C H }
S O V E R S I O N $ { P R O J E C T _ V E R S I O N _ M A J O R } . $ { P R O J E C T _ V E R S I O N _ M I N O R } )
S O V E R S I O N $ { P R O J E C T _ V E R S I O N _ M A J O R }
O U T P U T _ N A M E " a r g t a b l e 3 $ < $ < N O T : $ < B O O L : $ { B U I L D _ S H A R E D _ L I B S } > > : _ s t a t i c > "
D E B U G _ P O S T F I X " d "
)
include ( GNUInstallDirs )
if ( UNIX OR MSYS OR MINGW )
@ -94,9 +96,24 @@ install(TARGETS argtable3
E X P O R T $ { A R G T A B L E 3 _ P A C K A G E _ N A M E } C o n f i g
R U N T I M E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ B I N D I R }
L I B R A R Y D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
A R C H I V E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R } )
install ( TARGETS argtable3_static
E X P O R T $ { A R G T A B L E 3 _ P A C K A G E _ N A M E } C o n f i g
A R C H I V E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R } )
install ( FILES "${PROJECT_SOURCE_DIR}/src/argtable3.h" DESTINATION ${ CMAKE_INSTALL_INCLUDEDIR } )
install ( EXPORT ${ ARGTABLE3_PACKAGE_NAME } Config DESTINATION ${ ARGTABLE3_INSTALL_CMAKEDIR } )
A R C H I V E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
)
install ( FILES "${PROJECT_SOURCE_DIR}/src/argtable3.h"
D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ I N C L U D E D I R }
)
install ( EXPORT ${ ARGTABLE3_PACKAGE_NAME } Config
N A M E S P A C E $ { A R G T A B L E 3 _ P R O J E C T _ N A M E } : :
D E S T I N A T I O N $ { A R G T A B L E 3 _ I N S T A L L _ C M A K E D I R }
)
include ( CMakePackageConfigHelpers )
write_basic_package_version_file ( "${PROJECT_BINARY_DIR}/${ARGTABLE3_PACKAGE_NAME}ConfigVersion.cmake"
V E R S I O N $ { A R G T A B L E 3 _ V E R S I O N }
C O M P A T I B I L I T Y S a m e M a j o r V e r s i o n
)
install ( FILES "${PROJECT_BINARY_DIR}/${ARGTABLE3_PACKAGE_NAME}ConfigVersion.cmake"
D E S T I N A T I O N $ { A R G T A B L E 3 _ I N S T A L L _ C M A K E D I R }
)