project(extra)
cmake_minimum_required(VERSION 2.6)
include_directories(${PROJECT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/.. ${GETTEXT_INCLUDE_DIR} ${Boost_INCLUDE_DIRS} ${MINIUPNP_INCLUDE_DIR})
aux_source_directory(${PROJECT_SOURCE_DIR} extra_SRCS)
if (FREE_SPACE_BAR_C)
    if (WIN32)
        list (REMOVE_ITEM extra_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/fsusage.c)
    endif (WIN32)
else (FREE_SPACE_BAR_C)
    list (REMOVE_ITEM extra_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/fsusage.c)
    list (REMOVE_ITEM extra_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/freespace.cpp)
endif(FREE_SPACE_BAR_C)
if (NOT USE_MINIUPNP)
    list (REMOVE_ITEM extra_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/upnpc.cpp)
endif(NOT USE_MINIUPNP)

add_library(extra STATIC ${extra_SRCS})

if (WIN32)
    set_property(TARGET extra PROPERTY COMPILE_FLAGS)
else(WIN32)
    set_property(TARGET extra PROPERTY COMPILE_FLAGS -fPIC)
endif (WIN32)

target_link_libraries (extra ${MINIUPNP_LIBRARY} ${GETTEXT_LIBRARIES})
