
if(FREECAD_BUILD_CAM)
    add_subdirectory(ANN)
endif(FREECAD_BUILD_CAM)

if(FREECAD_BUILD_GUI AND FREECAD_LIBPACK_CHECKFILE6X)
    add_subdirectory(Pivy)
elseif(FREECAD_BUILD_GUI AND FREECAD_LIBPACK_CHECKFILE7X)
    add_subdirectory(Pivy-0.5)
#elseif(FREECAD_BUILD_GUI AND FREECAD_LIBPACK_CHECKCUSTOM)
#   find_path(COIN_VERSION3 Inventor/scxml/ScXML.h ${COIN3D_INCLUDE_DIR})
#   if (COIN_VERSION3)
#   add_subdirectory(Pivy-0.5)
#   else (COIN_VERSION3)
#   add_subdirectory(Pivy)
#   endif(COIN_VERSION3)
#endif(FREECAD_BUILD_GUI AND FREECAD_LIBPACK_CHECKFILE6X)
#if (MINGW)
#   add_subdirectory(Pivy)
#endif(MINGW)
# applies for Unix, MinGW and Windows with custom LibPack
elseif(FREECAD_BUILD_GUI)
    if (NOT FREECAD_USE_EXTERNAL_PIVY)
        find_path(COIN_VERSION3 Inventor/scxml/ScXML.h ${COIN3D_INCLUDE_DIR})
        if (COIN_VERSION3)
        if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/Pivy-0.5)
            add_subdirectory(Pivy-0.5)
        endif (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/Pivy-0.5)
        else (COIN_VERSION3)
        if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/Pivy)
            add_subdirectory(Pivy)
        endif (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/Pivy)
        endif(COIN_VERSION3)
    endif (NOT FREECAD_USE_EXTERNAL_PIVY)
endif(FREECAD_BUILD_GUI AND FREECAD_LIBPACK_CHECKFILE6X)

# Build SalomeMesh for all Platforms since heavily patched
add_subdirectory(salomesmesh)

