@ -13,19 +13,55 @@ set(SO_MAJOR 2)
set ( SO_MINOR 0 )
set ( SO_PATCH 2 )
add_definitions (
- D U T F 8 P R O C _ E X P O R T S
)
# c o n f i g u r e b u i l d t y p e
set ( _utf8proc_is_set_build_shared_libs TRUE )
if ( DEFINED BUILD_SHARED_LIBS )
set ( _utf8proc_is_set_build_shared_libs ${ BUILD_SHARED_LIBS } )
endif ( DEFINED BUILD_SHARED_LIBS )
set ( UTF8PROC_BUILD_AS_SHARED ${ _utf8proc_is_set_build_shared_libs } CACHE BOOL "If present and true, this will cause utf8proc to be built shared unless the utf8proc was explicitly added as a static library." )
# s e t a d d i t i o n a l d e f i n e d
if ( NOT MSVC )
if ( NOT DEFINED _utf8proc_additional_defined )
set ( _utf8proc_additional_defined )
endif ( NOT DEFINED _utf8proc_additional_defined )
if ( UTF8PROC_BUILD_AS_SHARED )
list ( APPEND _utf8proc_additional_defined
" - D U T F 8 P R O C _ E X P O R T S "
)
set ( _utf8proc_build_type "SHARED" )
else ( UTF8PROC_BUILD_AS_SHARED )
list ( APPEND _utf8proc_additional_defined
" - D U T F 8 P R O C _ B U I L D _ A S _ L I B "
)
set ( _utf8proc_build_type "STATIC" )
endif ( UTF8PROC_BUILD_AS_SHARED )
list ( REMOVE_DUPLICATES _utf8proc_additional_defined )
add_definitions ( "${_utf8proc_additional_defined}" )
# o t h e r c o n f i g
if ( NOT MSVC )
set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2 -std=c99 -pedantic -Wall" )
endif ( )
endif ( )
add_library ( utf8proc
add_library ( utf8proc ${ _utf8proc_build_type }
u t f 8 p r o c . c
u t f 8 p r o c . h
)
if ( MSVC )
get_target_property ( _utf8proc_msvc_build_prop_val utf8proc COMPILE_FLAGS )
if ( ${ _utf8proc_msvc_build_prop_val } STREQUAL "_utf8proc_msvc_build_prop_val-NOTFOUND" )
set_target_properties ( utf8proc PROPERTIES COMPILE_FLAGS "/Wall" )
else ( ${ _utf8proc_msvc_build_prop_val } STREQUAL "_utf8proc_msvc_build_prop_val-NOTFOUND" )
set_target_properties ( utf8proc PROPERTIES COMPILE_FLAGS "${_utf8proc_msvc_build_prop_val} /Wall" )
endif ( ${ _utf8proc_msvc_build_prop_val } STREQUAL "_utf8proc_msvc_build_prop_val-NOTFOUND" )
endif ( )
set_target_properties ( utf8proc PROPERTIES
P O S I T I O N _ I N D E P E N D E N T _ C O D E O N
V E R S I O N " $ { S O _ M A J O R } . $ { S O _ M I N O R } . $ { S O _ P A T C H } "