project(${PUGIXML_LIBRARY})

set(PUGIXML_MAJOR_VERSION 1 PARENT_SCOPE)
set(PUGIXML_MINOR_VERSION 9 PARENT_SCOPE)
set(PUGIXML_PATCH_VERSION 0 PARENT_SCOPE)

vp_include_directories(${CMAKE_CURRENT_SOURCE_DIR})

file(GLOB lib_srcs *.cpp)
file(GLOB lib_hdrs *.hpp)

add_library(${PUGIXML_LIBRARY} STATIC ${lib_srcs} ${lib_hdrs})

if(UNIX)
  if(CMAKE_COMPILER_IS_GNUCXX OR CV_ICC)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
  endif()
endif()

if(ENABLE_SOLUTION_FOLDERS)
  set_target_properties(${PUGIXML_LIBRARY} PROPERTIES FOLDER "3rdparty")
endif()

set_target_properties(${PUGIXML_LIBRARY}
  PROPERTIES OUTPUT_NAME ${PUGIXML_LIBRARY}
  DEBUG_POSTFIX "${VISP_DEBUG_POSTFIX}"
  COMPILE_PDB_NAME ${PUGIXML_LIBRARY}
  COMPILE_PDB_NAME_DEBUG "${PUGIXML_LIBRARY}${VISP_DEBUG_POSTFIX}"
  ARCHIVE_OUTPUT_DIRECTORY ${VISP_3P_LIBRARY_OUTPUT_PATH}
  )

if(NOT BUILD_SHARED_LIBS)
  vp_install_target(${PUGIXML_LIBRARY} EXPORT VISPModules ARCHIVE DESTINATION ${VISP_3P_LIB_INSTALL_PATH} COMPONENT dev)
endif()

#vp_set_source_file_compile_flag(clipper.cpp -Wno-float-equal)
