include_directories(${CMAKE_BINARY_DIR}) # for config.h
include_directories(${CMAKE_SOURCE_DIR})

set (librozofs_sources
    rozofs.h
    rozofs_service_ports.h
    rozofs_service_ports.c    
    #rozofs.c
    rozofs_srv.h
    rozofs_srv.c
    common/types.h
    common/daemon.h
    common/daemon.c
    common/dist.h
    common/htable.h
    common/htable.c
    common/list.h
    common/log.h
    common/mattr.h
    common/mattr.c
    common/transform.h
    common/transform.c
    common/mojette_transform128.c
    common/xmalloc.h
    common/xmalloc.c
    common/exp_trck_inode_srv_v2.c
    common/export_track.h
    common/rozofs_site.c
    common/rozofs_site.h
    common/export_track_change.h
    common/export_track_change.c
    common/common_config.c    
    common/common_config.h
    rpc/eproto.h
    rpc/eprotoxdr.c
    rpc/eprotosvc.c
    rpc/eprotoclt.c
    rpc/sproto.h
    rpc/sprotoxdr.c
    rpc/sprotosvc.c
    rpc/sprotoclt.c
    rpc/mproto.h
    rpc/mprotoxdr.c
    rpc/mprotosvc.c
    rpc/mprotoclt.c
    rpc/spproto.h
    rpc/epproto.h
    rpc/mpproto.h
    rpc/rpcclt.h
    rpc/rpcclt.c
    rpc/eclient.h
    rpc/eclient.c
    rpc/sclient.h
    rpc/sclient.c
    rpc/mclient.h
    rpc/mclient.c
    rpc/export_lbg.c
    rpc/storcli_lbg_prototypes.h
    rpc/storcli_protoclt.c
    rpc/storcli_protosvc.c
    rpc/storcli_proto.h
    rpc/storcli_protoxdr.c
    rpc/rozofs_rpc_util.c
    rpc/rozofs_rpc_util.h
    rpc/storcli_lbg.c 
    rpc/stcpproto.h
    rpc/geo_replica_protoxdr.c
    rpc/geo_replica_proto.h
    core/af_inet_stream_api.h
    core/af_inet_tcp.c
    core/af_unix_ctx_mgt.c
    core/af_unix_socket_client_generic.c
    core/af_unix_socket_generic_api.h
    core/af_unix_socket_generic.c
    core/af_unix_socket_generic.h
    core/af_unix_socket_recv.c
    core/af_unix_socket_send.c
    core/af_unix_socket_server_generic.c
    core/af_unix_socket_stream_recv.c
    core/af_unix_socket_stream_send.c
    core/af_unix_test.h
    core/dbgScript_api.h
    core/monitoring.h
    core/monitoring.c
    core/norh_lbg_timer.c
    core/north_lbg_api.h
    core/north_lbg.h
    core/north_lbg_timer_api.h
    core/north_lbg_timer.h
    core/north_load_balancer_api.c
    core/north_load_balancer.c
    core/rozofs_north_sock.h
    core/rozofs_socket_family.h
    core/ruc_buffer_api.h
    core/ruc_buffer.c
    core/ruc_buffer.h
    core/ruc_common.h
    core/ruc_list.c
    core/ruc_list.h
    core/ruc_observer_api.h
    core/ruc_observer.c
    core/ruc_sockCtl_api.h
    core/ruc_tcp_client_api.h
    core/ruc_tcp_client.c
    core/ruc_tcp_client.h
    core/ruc_tcpServer_api.h
    core/ruc_tcpServer.c
    core/ruc_tcpServer.h
    core/ruc_timer_api.h
    core/ruc_timer.c
    core/ruc_timer.h
    core/ruc_timer_main.c
    core/ruc_timer_struct.h
    core/ruc_trace_api.h
    core/ruc_trace.c
    core/socketCtrl.c
    core/socketCtrl.h
    core/uma_dbg_api.h
    core/uma_dbg.c
    core/uma_dbg_msgHeader.h
    core/uma_fsm_framework.c
    core/uma_fsm_framework.h
    core/uma_fsm_history.c
    core/uma_fsm_stub.c
    core/uma_tcp.h
    core/uma_tcp_main_api.h
    core/uma_tcp_main.c
    core/uma_tcp_rcvFsm.c
    core/uma_tcp_xmitFsm.c
    core/uma_well_known_ports_api.h
    core/com_tx_timer_api.h
    core/com_tx_timer.h
    core/rozofs_tx_api.h
    core/rozofs_tx_common.h
    core/rozofs_tx_engine.c
    core/com_tx_timer.c
    core/rozofs_ip_utilities.c
    core/rozofs_ip_utilities.h
    core/rozofs_cpu.c
    core/rozofs_cpu.h    
    rozofs_timer_conf.h
    rozofs_timer_conf.c    
    core/rozofs_timer_conf_dbg.c
    core/rozofs_timer_conf_dbg.h
    core/com_cache.c
    core/com_cache.h
    core/ruc_buffer_debug.c
    core/ruc_buffer_debug.h  
    core/rozofs_host_list.c
    core/rozofs_host_list.h          
    core/rozofs_share_memory.h  
    rpc/gwprotoclt.c
    rpc/gwproto.h
    rpc/gwprotosvc.c
    rpc/gwprotoxdr.c
    core/expgw_common.h
    core/expgw_common.c
    core/rozofs_rpc_non_blocking_generic.c
    core/rozofs_rpc_non_blocking_generic.h
    core/rozofs_rpc_non_blocking_generic_srv.c
    core/rozofs_rpc_non_blocking_generic_srv.h
    #core/rozofs_optim.h
    #core/rozofs_optim.c
    core/ruc_traffic_shaping.h
    core/ruc_traffic_shaping.c
    core/rozofs_core_files.c
    core/rozofs_core_files.h    
    core/rozofs_host2ip.h    
    core/disk_table_service.c
    core/disk_table_service.h
    core/rozofs_numa.h
    core/rozofs_numa.c
    core/rozofs_throughput.h
    core/rozofs_throughput.c            
)

add_library(rozofs STATIC ${librozofs_sources})
set_target_properties(rozofs PROPERTIES COMPILE_FLAGS "-fPIC")
